Macaulay2 Engine
Loading...
Searching...
No Matches
dpoly.hpp File Reference

Native univariate polynomial arithmetic over QQ extensions and finite fields. More...

#include <cstdio>
#include <sstream>
#include <vector>
#include "ExponentVector.hpp"
#include "ringelem.hpp"
#include "buffer.hpp"

Go to the source code of this file.

Classes

struct  TowerPolynomial
 Heap-allocated node of a tower polynomial: a dense degree-indexed coefficient array that recurses through levels. More...
class  DPoly
 Arithmetic engine for tower-polynomial rings: (Z/p)[x_0][x_1]...[x_{nvars-1}] modulo a chain of extensions. More...
class  DRing
 Single-level view of a tower-polynomial ring: a DPoly plus a fixed working level and a Tower-flavoured ring_type typedef. More...
class  DPolyTraverser
 Visitor base class that walks every term of a TowerPolynomial, calling viewTerm(coeff, exponents) once per leaf. More...

Detailed Description

Native univariate polynomial arithmetic over QQ extensions and finite fields.

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

Declares TowerPolynomialStruct (a (deg, len, union {long* ints; TowerPolynomial* polys;}) recursive layout that bottoms out at long coefficients at level 0 and recurses upward through pointers at each higher level), the DPoly class that drives arithmetic over such towers, and the DPolyTraverser visitor. DPoly provides the engine's dependency-free GCD machinery for algebraic-extension construction and modular factorisation paths: "monic GCD mod p" over a finite extension field, and a modular GCD over QQ (lift to many Z/p, then CRT back). The in-file comment flags multivariate and function-field extensions as planned but not yet implemented.

The point of having this code alongside Factory (interface/factory.h) is twofold: it gives the engine a dependency-free path that still works when Factory is unavailable, and it provides an end-to-end-debuggable native implementation that the tower layers reach into. Real consumers are tower.hpp (the legacy Tower : public Ring class, which holds a DRing* back-end pointing at this machinery) and aring-tower.hpp (the modern ARingTower aring, whose element pointers are reinterpreted as TowerPolynomials).

See also
tower.hpp
aring-tower.hpp
ExponentVector.hpp

Definition in file dpoly.hpp.