|
Macaulay2 Engine
|
Builder that accumulates terms into a ResPolynomial and finalises the layout in one shot via setPoly. More...
#include <res-poly-ring.hpp>
Public Member Functions | |
| ResPolynomialConstructor (const ResPolyRing &R) | |
| ~ResPolynomialConstructor () | |
| void | appendMonicTerm (res_packed_monomial monom) |
| void | pushBackTerm (res_packed_monomial monom) |
| ElementArray & | coefficientInserter () |
| void | setPoly (ResPolynomial &result) |
Static Public Member Functions | |
| static void | setPolyFromArrays (ResPolynomial &result, int len, ElementArray &coeffs, std::vector< res_monomial_word > &monoms) |
Static Public Attributes | |
| static long | ncalls = 0 |
| static long | ncalls_fromarray = 0 |
Private Attributes | |
| std::vector< res_packed_monomial > | monoms |
| ElementArray | coeffs |
| const ResPolyRing & | mRing |
Builder that accumulates terms into a ResPolynomial and finalises the layout in one shot via setPoly.
Stages monomials as res_packed_monomial pointers in monoms and grows a parallel ElementArray in coeffs. appendMonicTerm pushes a monomial and an implicit 1 coefficient; pushBackTerm pushes just the monomial (the caller is expected to write the coefficient through coefficientInserter). setPoly allocates the final flat monoms buffer in the target ResPolynomial, copies each monomial in, and swaps the coefficient array over. Maintains two static counters (ncalls, ncalls_fromarray) for tracking how often each construction path is used.
Definition at line 171 of file res-poly-ring.hpp.