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

Dense-format ResMonoid implementation: monomials laid out as fixed-width exponent vectors. More...

#include <res-moninfo-dense.hpp>

Public Types

typedef res_packed_monomial monomial
typedef res_const_packed_monomial const_monomial
typedef monomial value

Public Member Functions

 ResMonoidDense (int nvars, const std::vector< int > &var_degrees, const std::vector< int > &weightvecs, MonomialOrderingType moType)
 ~ResMonoidDense ()
int n_vars () const
int max_monomial_size () const
int monomial_size (res_const_packed_monomial m) const
void show () const
res_monomial_word hash_value (res_const_packed_monomial m) const
void copy (res_const_packed_monomial src, res_packed_monomial target) const
void set_component (component_index component, res_packed_monomial m) const
component_index get_component (res_const_packed_monomial m) const
bool from_expvector (res_const_ntuple_monomial e, component_index comp, res_packed_monomial result) const
int skew_vars (const SkewMultiplication *skew, res_const_packed_monomial m, int *skewvars) const
int skew_mult_sign (const SkewMultiplication *skew, res_const_packed_monomial m, res_const_packed_monomial n) const
bool one (component_index comp, res_packed_monomial result) const
bool to_expvector (res_const_packed_monomial m, res_ntuple_monomial result, component_index &result_comp) const
void to_varpower_monomial (res_const_packed_monomial m, res_varpower_monomial result) const
void from_varpower_monomial (res_const_varpower_monomial m, component_index comp, res_packed_monomial result) const
bool is_equal (res_const_packed_monomial m, res_const_packed_monomial n) const
bool monomial_part_is_equal (res_const_packed_monomial m, res_const_packed_monomial n) const
bool is_divisible_by_var_in_range (res_const_packed_monomial monom, int lo, int hi) const
bool check_monomial (res_const_packed_monomial m) const
void unchecked_mult (res_const_packed_monomial m, res_const_packed_monomial n, res_packed_monomial result) const
bool divide (res_const_packed_monomial m, res_const_packed_monomial n, res_packed_monomial result) const
bool mult (res_const_packed_monomial m, res_const_packed_monomial n, res_packed_monomial result) const
void show (res_const_packed_monomial m) const
void showAlpha (res_const_packed_monomial m) const
int compare_schreyer (res_const_packed_monomial m, res_const_packed_monomial n, res_const_packed_monomial m0, res_const_packed_monomial n0, component_index tie1, component_index tie2) const
void variable_as_vp (int v, res_varpower_monomial result) const
int degree_of_vp (res_const_varpower_monomial a) const
void quotient_as_vp (res_const_packed_monomial a, res_const_packed_monomial b, res_varpower_monomial result) const
void dump (std::ostream &o, res_const_packed_monomial mon)

Private Attributes

int nvars
int nslots
std::unique_ptr< res_monomial_word[]> hashfcn
res_monomial_word mask
std::vector< intmVarDegrees
int firstvar
int nweights
std::vector< intweight_vectors
unsigned long ncalls_hash_value
unsigned long ncalls_compare
unsigned long ncalls_mult
unsigned long ncalls_get_component
unsigned long ncalls_from_expvector
unsigned long ncalls_to_expvector
unsigned long ncalls_to_varpower
unsigned long ncalls_from_varpower
unsigned long ncalls_is_equal
unsigned long ncalls_is_equal_true
unsigned long ncalls_divide
unsigned long ncalls_weight
unsigned long ncalls_unneccesary
unsigned long ncalls_quotient_as_vp

Detailed Description

Dense-format ResMonoid implementation: monomials laid out as fixed-width exponent vectors.

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

Each encoded monomial has nslots ints: [hash, Computations, w_1, ..., w_r, e_1, ..., e_n]. Exponents are stored explicitly for every variable, so encode / decode are O(nvars) but the monomial size is fixed at compile-time once nvars is known. The dense representation wins when monomials are typically non-zero in many variables; ResMonoidSparse is the varpower-encoded alternative for sparse settings.

Definition at line 75 of file res-moninfo-dense.hpp.


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