39#include <gtest/gtest.h>
60 for (
auto a : m) { hash += a.first + a.second; }
75 for (
int i=0; i<100000; ++i)
80 for (
int i=0; i<10000; ++i)
85 std::cout << std::endl;
93 const std::string polys = R
"(1*x^1+2*y^1+2*z^1+1235952426
94y^1*z^1+494380972*z^2+370785728*y^1+247190485*z^1
95y^2+988761941*z^2+741571456*y^1+494380971*z^1
961*z^3+924021576*z^2+700373042*y^1+653289140*z^1
108 std::cout <<
"Number of monomials: " << monHashTable.size() << std::endl;
112TEST(NewF4MonomialLookupTable, mask_creation)
115 for (
int i=1; i<10; ++i)
119 std::cout << std::bitset<64>(mask) << std::endl;
128 EXPECT_FALSE(newf4::MonomialLookupTable::maskDivides(abMask,acMask));
129 EXPECT_TRUE(newf4::MonomialLookupTable::maskDivides(abMask,ab2Mask));
131 std::cout << std::endl;
134TEST(NewF4MonomialLookupTable, monomialDivides)
152TEST(NewF4MonomialLookupTable, monomialOperations)
164 std::cout << lcm.size() << std::endl;
165 for (
auto i = lcm.begin(); i != lcm.end(); ++i)
167 std::cout << i.var() <<
" ";
168 std::cout << i.power() <<
" ";
170 std::cout << std::endl;
172 std::cout << product.
size() << std::endl;
173 for (
auto i = product.
begin(); i != product.
end(); ++i)
175 std::cout << i.var() <<
" ";
176 std::cout << i.power() <<
" ";
178 std::cout << std::endl;
180 std::cout << quotient.
size() << std::endl;
181 for (
auto i = quotient.
begin(); i != quotient.
end(); ++i)
183 std::cout << i.var() <<
" ";
184 std::cout << i.power() <<
" ";
186 std::cout << std::endl;
std::vector< BasicPoly > BasicPolyList
void toStream(const BasicPolyList &Fs, S &str)
BasicPolyList parseBasicPolyListFromString(std::string contents, const IdentifierHash &idenMap)
Parsers from text (string or file) into a BasicPolyList, including the Msolve input format.
newf4::MonomialHashFunction and the new-F4 monomial-to-index hash table.
newf4::MonomialLookupTable — divisibility-aware leading-term index for the new F4.
newf4::HashInt hashFunction(const newf4::MonomialView &m)
Hash-table-keyed polynomial storage for the new F4.
Coefficient-ring-erased arithmetic dispatcher used by F4, GB, and resolution code.
Thin RAII wrapper around memtailor::Arena providing bump-pointer array allocation with optional mutex...
virtual const Ring * getCoefficients() const
Abstract base for the engine's polynomial-ring hierarchy.
Runtime dispatcher that hides the concrete coefficient ring behind a std::variant of ConcreteVectorAr...
auto find(const MonomialView &m, HashInt mhash) -> MonomialIndex
Essentially the previous case when monomial(n) = monomial 1.
void dump() const
stats and debugging information.
static MonomialMask createMask(const MonomialView &monView)
static MonomialView quotient(const MonomialView &left, const MonomialView &right, MemoryBlock &block)
auto begin() const -> MonomialIterator< true >
auto end() const -> MonomialIterator< true >
static MonomialView lcm(const MonomialView &left, const MonomialView &right, MemoryBlock &block)
static MonomialView product(const MonomialView &left, const MonomialView &right, MemoryBlock &block)
static bool monomialDivides(const MonomialView &divisor, const MonomialView &divisee)
implements the stream functions for creating a PolynomialList from a stream
PolynomialRing — abstract polynomial-ring base, the engine's most-reused class.
const PolynomialRing * simplePolynomialRing(const Ring *kk, const std::vector< std::string > &names, MonomialOrdering *monorder)
One-line helpers for building degree monoids and polynomial rings inside gtest cases.