24 #include <initializer_list> 26 #include "system_constants.hpp" 29 #include "monomial_ordering.hpp" 35 using std::initializer_list;
40 #define PACKSIZE uint8_t 41 #define NPACK sizeof(unsigned long long)/sizeof(PACKSIZE) 75 exponents =
nullptr; ordering_data =
nullptr; ordering = ord;
81 void initialize_exponents(NVAR_TYPE number_of_vars);
88 void set_exponent(NVAR_TYPE i, DEG_TYPE e);
91 NVAR_TYPE number_of_vars,
103 initializer_list<EXP_TYPE> powers,
115 NVAR_TYPE size,
const EXP_TYPE *powers,
134 DEG_TYPE degree(NVAR_TYPE i)
const;
136 DEG_TYPE operator[](NVAR_TYPE i)
const;
144 DEG_TYPE total_degree(NVAR_TYPE m=0)
const;
155 DEG_TYPE weighted_degree(
const WT_TYPE *weights, NVAR_TYPE m=0)
const;
157 const EXP_TYPE *
log()
const {
return exponents; }
168 return ordering_data;
179 bool operator ==(
const Monomial &other)
const;
181 bool operator !=(
const Monomial &other)
const;
185 bool is_coprime(
const Monomial &other)
const;
188 return monomial_ordering()->cmp(*
this, u);
191 bool is_like(
const Monomial &other)
const;
198 bool like_multiple(EXP_TYPE * e,
const Monomial & v)
const;
202 bool larger_than(
const Monomial &)
const;
206 bool operator >(
const Monomial & u)
const;
210 bool operator >=(
const Monomial & u)
const;
214 bool operator <(
const Monomial & u)
const;
218 bool operator <=(
const Monomial & u)
const;
222 bool larger_than_multiple(
226 bool divisible_by(
const Monomial &other)
const;
228 bool operator |(
const Monomial &other)
const;
249 bool operator /=(
const Monomial &other);
265 void print(
bool=
true, ostream & = cout,
const string * names =
nullptr)
const;
273 friend ostream & operator << (ostream &,
const Monomial & u);
278 void *
operator new(size_t);
280 void operator delete(
void *);
NVAR_TYPE n
number of variables
void printlncout()
equivalent to print() with default values
DEG_TYPE ordering_degree() const
returns the ordering degree for this Monomial
const Monomial_Ordering * ordering
Monomial_Ordering associated with this polynomial.
int cmp(const Monomial &u) const
Returns 0 if like, negative if smaller.
data for a monomial ordering: optional, but stored in Monomial
ray operator*(RAYENT_TYPE a, ray &r)
Multiply every coordinate in the given ray by the given scalar.
Monomial_Order_Data * ordering_data
optional data for a monomial ordering
NVAR_TYPE num_vars() const
number of variables
Implementation of monomials.
interface to a monomial ordering
EXP_TYPE * exponents
has size n
const EXP_TYPE * log() const
Direct access to the exponents, for whatever reason.
Monomial_Order_Data * monomial_ordering_data() const
the Monomial_Order_Data associated with this Monomial
const Monomial_Ordering * monomial_ordering() const
the Monomial_Ordering associated with this Monomial
DEG_TYPE ord_degree
degree associated with monomial ordering (used for faster comparisons)
uint64_t mask
divisibility mask (up to 64 variables)
void set_ordering_degree(DEG_TYPE d)
sets the ordering degree for this Monomial
void common_initialization(const Monomial_Ordering *ord=nullptr)
things all Monomial initializers must do