Macaulay2 Engine
Loading...
Searching...
No Matches
res-moninfo.hpp File Reference

ResMonoid dispatcher — single typedef switch between ResMonoidDense and ResMonoidSparse. More...

Go to the source code of this file.

Typedefs

using ResMonoid = ResMonoidDense

Detailed Description

ResMonoid dispatcher — single typedef switch between ResMonoidDense and ResMonoidSparse.

Note
AI-generated documentation. Verify against the source before relying on it.

Pulls in both monomial-layout implementations the F4 resolution uses and aliases ResMonoid to the active one — ResMonoidDense is the live using in production, with a commented-out using ResMonoid = ResMonoidSparse; line kept directly beneath it as the swap-in toggle. The dense layout stores each monomial in a fixed nslots-word array [hash, component, weights..., exponents_0..exponents_{nvars-1}] and wins for dense exponents or small variable counts; the sparse layout uses a length-prefixed (variable, exponent) list (its monomial_size(m) returns *m) and wins for low-support monomials in many-variable rings.

The two implementations share most of their public surface — mult / divide / monomial_size / to_expvector / from_expvector / from_varpower_monomial / compare_schreyer are live in both. compare_grevlex is live only in ResMonoidSparse; the dense version has it #if 0-d out, so switching the typedef silently changes which grevlex comparator the rest of the resolution sees. The rest of the schreyer-resolution code references ResMonoid through this typedef, which keeps the implementation choice pinned to a single file and lets benchmark-driven swaps stay zero-touch at call sites; future builds may promote the choice to configure-time, but for now the source-comment toggle is the only mechanism.

See also
res-moninfo-dense.hpp
res-moninfo-sparse.hpp
res-poly-ring.hpp
res-schreyer-frame.hpp

Definition in file res-moninfo.hpp.