Macaulay2 Engine
Loading...
Searching...
No Matches
ResPolynomialConstructor Class Reference

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)
ElementArraycoefficientInserter ()
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_monomialmonoms
ElementArray coeffs
const ResPolyRingmRing

Detailed Description

Builder that accumulates terms into a ResPolynomial and finalises the layout in one shot via setPoly.

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

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.


The documentation for this class was generated from the following files: