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

Arithmetic engine for tower-polynomial rings: (Z/p)[x_0][x_1]...[x_{nvars-1}] modulo a chain of extensions. More...

#include <dpoly.hpp>

Public Member Functions

int degree_of_extension (int level)
bool down_level (int newlevel, int oldlevel, TowerPolynomial &f)
void remove (int level, TowerPolynomial &f)
int compare (int level, const TowerPolynomial f, const TowerPolynomial g)
TowerPolynomial random (int level, int deg)
TowerPolynomial random (int level)
TowerPolynomial var (int level, int v)
void add_term (int level, TowerPolynomial &result, long coeff, exponents_t exp) const
void negate_in_place (int level, TowerPolynomial &f)
void add_in_place (int level, TowerPolynomial &f, const TowerPolynomial g)
void subtract_in_place (int level, TowerPolynomial &f, const TowerPolynomial g)
TowerPolynomial mult_by_int (int level, long c, const TowerPolynomial f)
TowerPolynomial mult (int level, const TowerPolynomial f, const TowerPolynomial g, bool reduce_by_extension)
void remainder (int level, TowerPolynomial &f, const TowerPolynomial g)
TowerPolynomial division_in_place_monic (int level, TowerPolynomial &f, const TowerPolynomial g)
bool division_in_place (int level, TowerPolynomial &f, const TowerPolynomial g, TowerPolynomial &result_quot)
void pseudo_remainder (int level, TowerPolynomial &f, const TowerPolynomial g)
TowerPolynomial pseudo_division (int level, TowerPolynomial &f, const TowerPolynomial g)
TowerPolynomial gcd (int level, const TowerPolynomial f, const TowerPolynomial g)
TowerPolynomial gcd_coefficients (int level, const TowerPolynomial f, const TowerPolynomial g, TowerPolynomial &result_u, TowerPolynomial &result_v)
TowerPolynomial resultant (int level, TowerPolynomial f, TowerPolynomial g)
void make_monic (int level, TowerPolynomial &f)
TowerPolynomial invert (int level, const TowerPolynomial a)
void normal_form (int level, TowerPolynomial &f)
void subtract_multiple_to (int level, TowerPolynomial &f, long a, int i, TowerPolynomial g)
void elem_text_out (buffer &o, int level, const TowerPolynomial f, bool p_one, bool p_plus, bool p_parens, M2_ArrayString names) const
void extensions_text_out (buffer &o, M2_ArrayString names) const
int degree (int level, int var, const TowerPolynomial f) const
TowerPolynomial diff (int level, int var, const TowerPolynomial f)
TowerPolynomial power_mod (int level, const TowerPolynomial f, mpz_srcptr n, const TowerPolynomial g)
TowerPolynomial lowerP (int level, const TowerPolynomial f)
int index_of_var (int level, const TowerPolynomial f) const
void degrees_of_vars (int level, const TowerPolynomial f, std::vector< int > &result_max_degs) const
 ~DPoly ()
 DPoly (long p, int nvars0, const TowerPolynomial *extensions=nullptr)

Static Public Member Functions

static void increase_size_0 (int newdeg, TowerPolynomial &f)
static void increase_size_n (int newdeg, TowerPolynomial &f)
static TowerPolynomial alloc_poly_n (int deg, TowerPolynomial *elems=nullptr)
static TowerPolynomial alloc_poly_0 (int deg, long *elems=nullptr)
static void dealloc_poly (TowerPolynomial &f)
static void display_poly (FILE *fil, int level, const TowerPolynomial f)
static TowerPolynomial read_poly (char *&str, int level)
static std::ostream & append_to_stream (std::ostream &o, int level, const TowerPolynomial f)
static char * to_string (int level, const TowerPolynomial f)
static bool is_equal (int level, const TowerPolynomial f, const TowerPolynomial g)
static TowerPolynomial copy (int level, const TowerPolynomial f)
static TowerPolynomial from_long (int level, long c)
static bool is_zero (TowerPolynomial f)
static bool is_one (int level, const TowerPolynomial f)

Private Member Functions

void initialize (long p, int nvars0, const TowerPolynomial *ext0)
void reset_degree_0 (TowerPolynomial &f)
void reset_degree_n (int level, TowerPolynomial &f)
void mult_by_coeff_0 (TowerPolynomial &f, long b)
void mult_by_coeff_n (int level, TowerPolynomial &f, TowerPolynomial b)
void make_monic_0 (TowerPolynomial &f, long &result_multiplier)
void make_monic_n (int level, TowerPolynomial &f, TowerPolynomial &result_multiplier)
bool make_monic3 (int level, TowerPolynomial &u1, TowerPolynomial &u2, TowerPolynomial &u3)
void add_in_place_0 (TowerPolynomial &f, const TowerPolynomial g)
void add_in_place_n (int level, TowerPolynomial &f, const TowerPolynomial g)
void subtract_in_place_0 (TowerPolynomial &f, const TowerPolynomial g)
void subtract_in_place_n (int level, TowerPolynomial &f, const TowerPolynomial g)
TowerPolynomial mult_0 (const TowerPolynomial f, const TowerPolynomial g, bool reduce_by_extension)
TowerPolynomial mult_n (int level, const TowerPolynomial f, const TowerPolynomial g, bool reduce_by_extension)
TowerPolynomial random_0 (int deg)
TowerPolynomial random_n (int level, int deg)
TowerPolynomial diff_0 (const TowerPolynomial f)
TowerPolynomial diff_n (int level, int whichvar, const TowerPolynomial f)
TowerPolynomial mult_by_int_0 (long c, const TowerPolynomial f)
TowerPolynomial mult_by_int_n (int level, long c, const TowerPolynomial f)

Static Private Member Functions

static TowerPolynomial read_poly_0 (char *&str)
static TowerPolynomial read_poly_n (char *&str, int level)

Private Attributes

int nvars
int nlevels
TowerPolynomial * extensions
long charac

Friends

class DPolyTraverser

Detailed Description

Arithmetic engine for tower-polynomial rings: (Z/p)[x_0][x_1]...[x_{nvars-1}] modulo a chain of extensions.

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

Holds the characteristic p, the number of variables, and an extensions array — one tower-polynomial per algebraic level giving the relation that defines the next variable over the previous (nullptr means transcendental, captured by degree_of_extension < 0). Almost every public operation (mult, add_in_place, gcd, resultant, pseudo_division, ...) takes an explicit level argument that dispatches the recursive descent down the tower. Used by DRing, which fixes a particular working level on top of a shared DPoly.

Definition at line 109 of file dpoly.hpp.


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