Gröbner basis project
Codebase for research into Gröbner basis computation
|
strategies for Gröbner basis computation More...
Classes | |
class | Normal_Strategy |
ordering critical pairs using the normal strategy More... | |
class | Pair_Strategy_Data |
Structure for sorting critical pairs. More... | |
class | Pair_Sugar_Data |
ordering critical pairs using the sugar strategy More... | |
class | Pair_WSugar_Strategy |
ordering critical pairs using the weighted sugar strategy More... | |
class | Poly_Strategy_Data |
polynomial-related strategy data More... | |
class | Poly_Sugar_Data |
polynomial-related data for a sugar strategy More... | |
class | Poly_WSugar_Data |
polynomial-related data for a weighted sugar strategy More... | |
Enumerations | |
enum | StrategyFlags { NORMAL_STRATEGY = 1, SUGAR_STRATEGY, WSUGAR_STRATEGY } |
flag indicating which strategy to use for computation More... | |
strategies for Gröbner basis computation
class Normal_Strategy |
ordering critical pairs using the normal strategy
Definition at line 32 of file normal_strategy.hpp.
Public Member Functions | |
Construction | |
Normal_Strategy (Critical_Pair_Basic &cpb) | |
all the information we need is in cpb already so no additional processing is necessary | |
Comparison | |
virtual bool | equivalent (const Pair_Strategy_Data &sd) const |
implementation of equivalent() | |
virtual bool | first_larger (const Pair_Strategy_Data &sd) const |
implementation of first_larger() | |
Basic properties | |
virtual StrategyFlags | type () |
![]() | |
virtual | ~Pair_Strategy_Data () |
bool | operator== (const Pair_Strategy_Data &sd) const |
alias for equivalent() | |
bool | operator> (const Pair_Strategy_Data &sd) const |
alias for first_larger() | |
bool | operator>= (const Pair_Strategy_Data &sd) const |
is this larger than or equivalent to other? | |
bool | operator< (const Pair_Strategy_Data &sd) const |
is this smaller than other? | |
bool | operator<= (const Pair_Strategy_Data &sd) const |
is this smaller than or equivalent to other? | |
virtual void | pre_spolynomial_tasks () const |
hook called immediately before computing a new s-polynomiald More... | |
Protected Attributes | |
Critical_Pair_Basic * | cp |
the critical pair to which this Normal_Strategy belongs | |
Friends | |
I/O | |
ostream & | operator<< (ostream &, const Normal_Strategy &) |
class Pair_Strategy_Data |
Public Member Functions | |
Destruction | |
virtual | ~Pair_Strategy_Data () |
Comparison | |
virtual bool | equivalent (const Pair_Strategy_Data &) const =0 |
should return true iff this and other are equivalent | |
bool | operator== (const Pair_Strategy_Data &sd) const |
alias for equivalent() | |
virtual bool | first_larger (const Pair_Strategy_Data &) const =0 |
should return true iff this is larger than other | |
bool | operator> (const Pair_Strategy_Data &sd) const |
alias for first_larger() | |
bool | operator>= (const Pair_Strategy_Data &sd) const |
is this larger than or equivalent to other? | |
bool | operator< (const Pair_Strategy_Data &sd) const |
is this smaller than other? | |
bool | operator<= (const Pair_Strategy_Data &sd) const |
is this smaller than or equivalent to other? | |
Computation | |
virtual void | pre_spolynomial_tasks () const |
hook called immediately before computing a new s-polynomiald More... | |
|
virtual |
hook called immediately before computing a new s-polynomiald
The default is to do nothing, which is good for the normal strategy. Other strategies, however, may require some processing before reduction; the sugar strategy is an example, as an s-polynomial needs to record a new polynomial’s sugar
Definition at line 74 of file strategies.cpp.
class Pair_Sugar_Data |
ordering critical pairs using the sugar strategy
Definition at line 101 of file sugar_strategy.hpp.
Public Member Functions | |
Construction | |
Pair_Sugar_Data (Critical_Pair_Basic &cpb) | |
all the information we need is in cpb already so no additional processing is necessary | |
Comparison | |
virtual bool | equivalent (const Pair_Strategy_Data &sd) const |
implementation of equivalent() | |
virtual bool | first_larger (const Pair_Strategy_Data &sd) const |
implementation of first_larger() | |
Basic properties | |
DEG_TYPE | pair_sugar () const |
![]() | |
virtual | ~Pair_Strategy_Data () |
bool | operator== (const Pair_Strategy_Data &sd) const |
alias for equivalent() | |
bool | operator> (const Pair_Strategy_Data &sd) const |
alias for first_larger() | |
bool | operator>= (const Pair_Strategy_Data &sd) const |
is this larger than or equivalent to other? | |
bool | operator< (const Pair_Strategy_Data &sd) const |
is this smaller than other? | |
bool | operator<= (const Pair_Strategy_Data &sd) const |
is this smaller than or equivalent to other? | |
virtual void | pre_spolynomial_tasks () const |
hook called immediately before computing a new s-polynomiald More... | |
Protected Attributes | |
Critical_Pair_Basic * | cp |
the critical pair to which this Normal_Strategy belongs | |
DEG_TYPE | sugar |
the pair*rsquo;s sugar | |
class Pair_WSugar_Strategy |
ordering critical pairs using the weighted sugar strategy
Definition at line 116 of file weighted_sugar_strategy.hpp.
Public Member Functions | |
Construction | |
Pair_WSugar_Strategy (Critical_Pair_Basic &) | |
creates a pair whose weighted sugar is the maximum of that of the products of the polynomials in the critical pair | |
Comparison | |
virtual bool | equivalent (const Pair_Strategy_Data &sd) const |
implementation of equivalent() | |
virtual bool | first_larger (const Pair_Strategy_Data &sd) const |
implementation of first_larger() | |
Basic properties | |
DEG_TYPE | pair_sugar () |
the weighted sugar | |
Modification | |
Useful for when the ordering changes. | |
virtual void | adjust_sugar (DEG_TYPE new_sugar) |
![]() | |
virtual | ~Pair_Strategy_Data () |
bool | operator== (const Pair_Strategy_Data &sd) const |
alias for equivalent() | |
bool | operator> (const Pair_Strategy_Data &sd) const |
alias for first_larger() | |
bool | operator>= (const Pair_Strategy_Data &sd) const |
is this larger than or equivalent to other? | |
bool | operator< (const Pair_Strategy_Data &sd) const |
is this smaller than other? | |
bool | operator<= (const Pair_Strategy_Data &sd) const |
is this smaller than or equivalent to other? | |
virtual void | pre_spolynomial_tasks () const |
hook called immediately before computing a new s-polynomiald More... | |
Protected Attributes | |
Critical_Pair_Basic * | cp |
the critical pair to which this Normal_Strategy belongs | |
DEG_TYPE | sugar |
the pair*rsquo;s sugar | |
class Poly_Strategy_Data |
polynomial-related strategy data
Some strategies will not need this class, but others will, such as sugar (to store a polynomial’s sugar).
Definition at line 49 of file strategies.hpp.
Public Member Functions | |
Destruction | |
virtual | ~Poly_Strategy_Data () |
Basic properties | |
virtual StrategyFlags | type ()=0 |
Comparison | |
virtual bool | equivalent (const Poly_Strategy_Data &) const =0 |
should return true iff strategy considers this and other equivalent | |
bool | operator== (const Poly_Strategy_Data &other) const |
alias for equivalent() | |
virtual bool | first_larger (const Poly_Strategy_Data &) const =0 |
should return true iff strategy considers this larger than other | |
bool | operator> (const Poly_Strategy_Data &other) const |
alias for first_larger() | |
bool | operator>= (const Poly_Strategy_Data &other) const |
is this larger than or equivalent to other? | |
bool | operator< (const Poly_Strategy_Data &other) const |
is this smaller than other? | |
bool | operator<= (const Poly_Strategy_Data &other) const |
is this smaller than or equivalent to other? | |
Computation | |
virtual void | at_generation_tasks () |
hook called while first generating polynomial More... | |
virtual void | at_generation_tasks (const Monomial &t) |
hook called while first generating a polynomial multiple More... | |
virtual bool | valid_reduction (const Abstract_Polynomial &r, const Abstract_Polynomial &g) const |
hook called while finding a reducer More... | |
void | pre_reduction_tasks (const Monomial &u, const Abstract_Polynomial &g) |
virtual void | pre_reduction_tasks (const EXP_TYPE *u, const Abstract_Polynomial &g) |
hook called immediately before performing reduction More... | |
Protected Attributes | |
const Abstract_Polynomial * | p |
the polynomial to which this strategy applies | |
Friends | |
I/O | |
ostream & | operator<< (ostream &, const Poly_Strategy_Data &) |
print strategy-related data in the polynomial | |
|
inlinevirtual |
hook called while first generating polynomial
The default is to do nothing, which is good for the normal strategy. Other strategies, however, may perform some record-keeping; the sugar strategy, for instance, will compute the polynomial’s sugar.
Reimplemented in Poly_WSugar_Data, and Poly_Sugar_Data.
Definition at line 88 of file strategies.hpp.
|
inlinevirtual |
hook called while first generating a polynomial multiple
t | a Monomial that we are about to multiply to create an s-polynomial |
The default is to do nothing, which is good for the normal strategy. Other strategies, however, may perform some record-keeping; the sugar strategy, for instance, will compute the polynomial’s sugar.
Reimplemented in Poly_WSugar_Data, and Poly_Sugar_Data.
Definition at line 96 of file strategies.hpp.
|
inlinevirtual |
hook called immediately before performing reduction
g | polynomial that reduces r (where r is this ) |
u | exponents of monomial satisfying \(u\textrm{lm}(g)=\textrm{lm}(r)\) |
The default is to do nothing, which is good for the normal strategy. Other strategies, however, may require some processing before reduction; the sugar strategy is an example, as reduction may increase a polynomial’s sugar
Reimplemented in Poly_WSugar_Data, and Poly_Sugar_Data.
Definition at line 124 of file strategies.hpp.
|
virtual |
hook called while finding a reducer
r | polynomial that is to be reduced |
g | polynomial that reduces r |
true
if and only if it is valid to reduce r
by g
The default is to do nothing, which is good for the normal and sugar strategies. Other strategies, however, may impose constraints on the reduction; involutive and signature-based reduction, for instance, both forbid certain reductions.
Definition at line 43 of file strategies.cpp.
class Poly_Sugar_Data |
polynomial-related data for a sugar strategy
Definition at line 33 of file sugar_strategy.hpp.
Public Member Functions | |
Poly_Sugar_Data (const Abstract_Polynomial *poly) | |
records poly as the reference for this More... | |
virtual void | at_generation_tasks () |
sets the sugar to the largest total degree of a monomial in the assigned previously polynomial | |
virtual void | at_generation_tasks (const Monomial &t) |
sets the sugar to the largest total degree of a monomial in the product of the monomial and the previously assigned polynomial More... | |
virtual bool | equivalent (const Poly_Strategy_Data &sd) const |
returns true iff the sugars are equal More... | |
virtual bool | first_larger (const Poly_Strategy_Data &sd) const |
returns true iff this sugar is larger than sd ’s More... | |
virtual void | pre_reduction_tasks (const EXP_TYPE *u, const Abstract_Polynomial &g) |
re-evaluates the sugar, if need be More... | |
Basic properties | |
DEG_TYPE | poly_sugar () const |
the sugar itself | |
virtual StrategyFlags | type () |
the strategy type | |
Modification | |
void | force_sugar (DEG_TYPE new_sugar) |
for those times when a different sugar is appropriate | |
![]() | |
virtual | ~Poly_Strategy_Data () |
bool | operator== (const Poly_Strategy_Data &other) const |
alias for equivalent() | |
bool | operator> (const Poly_Strategy_Data &other) const |
alias for first_larger() | |
bool | operator>= (const Poly_Strategy_Data &other) const |
is this larger than or equivalent to other? | |
bool | operator< (const Poly_Strategy_Data &other) const |
is this smaller than other? | |
bool | operator<= (const Poly_Strategy_Data &other) const |
is this smaller than or equivalent to other? | |
virtual bool | valid_reduction (const Abstract_Polynomial &r, const Abstract_Polynomial &g) const |
hook called while finding a reducer More... | |
void | pre_reduction_tasks (const Monomial &u, const Abstract_Polynomial &g) |
Protected Attributes | |
unsigned long long | sugar |
the polynomial’s sugar | |
![]() | |
const Abstract_Polynomial * | p |
the polynomial to which this strategy applies | |
Friends | |
I/O | |
ostream & | operator<< (ostream &, const Poly_Sugar_Data &) |
I/O |
Poly_Sugar_Data::Poly_Sugar_Data | ( | const Abstract_Polynomial * | poly | ) |
records poly
as the reference for this
poly | the polynomial whose sugar data this should be |
Definition at line 26 of file sugar_strategy.cpp.
|
virtual |
sets the sugar to the largest total degree of a monomial in the product of the monomial and the previously assigned polynomial
t | a Monomial to multiply to this |
Reimplemented from Poly_Strategy_Data.
Definition at line 51 of file sugar_strategy.cpp.
|
virtual |
returns true
iff the sugars are equal
sd | strategy data containing sugar |
true
if and only if the sugar of this
is equivalent to the sugar of sd
Implements Poly_Strategy_Data.
Definition at line 31 of file sugar_strategy.cpp.
|
virtual |
returns true
iff this
sugar is larger than sd
’s
sd | strategy data containing sugar |
true
if and only if this
sugar is larger than sd
’s Implements Poly_Strategy_Data.
Definition at line 36 of file sugar_strategy.cpp.
|
virtual |
re-evaluates the sugar, if need be
u | exponent vector of a Monomial to multiply to g , then subtract from this |
g | a polynomial |
Reimplemented from Poly_Strategy_Data.
Definition at line 61 of file sugar_strategy.cpp.
class Poly_WSugar_Data |
polynomial-related data for a weighted sugar strategy
This strategy is based on a weight vector, rather than simply adding exponents. While the weight vector can be that of a weighted ordering, one is also free to use a different weight altogether. Simply supply the relevant data.
Definition at line 39 of file weighted_sugar_strategy.hpp.
Public Member Functions | |
Poly_WSugar_Data (const Abstract_Polynomial *poly, const WT_TYPE *w) | |
records poly as the reference for this More... | |
virtual void | at_generation_tasks () |
sets the sugar to the largest weighted degree of a monomial in the assigned previously polynomial | |
virtual void | at_generation_tasks (const Monomial &t) |
sets the sugar to the largest weighted degree of a monomial in the product of the monomial and the previously assigned polynomial More... | |
virtual bool | equivalent (const Poly_Strategy_Data &sd) const |
returns true iff the sugars are equal More... | |
virtual bool | first_larger (const Poly_Strategy_Data &sd) const |
returns true iff this sugar is larger than sd ’s More... | |
virtual void | pre_reduction_tasks (const EXP_TYPE *u, const Abstract_Polynomial &g) |
re-evaluates the sugar, if need be More... | |
Basic properties | |
StrategyFlags | type () |
type of strategy | |
DEG_TYPE | poly_sugar () const |
the sugar itself | |
const WT_TYPE * | weighting () const |
the weights used to compute the sugar | |
Modification | |
void | change_weights (const WT_TYPE *w) |
changes the weights used to compute the sugar to w | |
![]() | |
virtual | ~Poly_Strategy_Data () |
bool | operator== (const Poly_Strategy_Data &other) const |
alias for equivalent() | |
bool | operator> (const Poly_Strategy_Data &other) const |
alias for first_larger() | |
bool | operator>= (const Poly_Strategy_Data &other) const |
is this larger than or equivalent to other? | |
bool | operator< (const Poly_Strategy_Data &other) const |
is this smaller than other? | |
bool | operator<= (const Poly_Strategy_Data &other) const |
is this smaller than or equivalent to other? | |
virtual bool | valid_reduction (const Abstract_Polynomial &r, const Abstract_Polynomial &g) const |
hook called while finding a reducer More... | |
void | pre_reduction_tasks (const Monomial &u, const Abstract_Polynomial &g) |
Protected Attributes | |
DEG_TYPE | sugar |
the polynomial’s sugar | |
const WT_TYPE * | weights |
pointer to the weights | |
![]() | |
const Abstract_Polynomial * | p |
the polynomial to which this strategy applies | |
Friends | |
I/O | |
ostream & | operator<< (ostream &, const Poly_WSugar_Data &) |
I/O |
Poly_WSugar_Data::Poly_WSugar_Data | ( | const Abstract_Polynomial * | poly, |
const WT_TYPE * | w | ||
) |
records poly
as the reference for this
This expects the weights to be as long as the number of monomials. It copies the list, so you can subsequently modify it without subsequently affecting correctness.
poly | polynomial whose sugar this is |
w | weight vector to compute weighted sugar |
Definition at line 27 of file weighted_sugar_strategy.cpp.
|
virtual |
sets the sugar to the largest weighted degree of a monomial in the product of the monomial and the previously assigned polynomial
t | a Monomial to multiply to this |
Reimplemented from Poly_Strategy_Data.
Definition at line 56 of file weighted_sugar_strategy.cpp.
|
virtual |
returns true
iff the sugars are equal
sd | sugar data to compare with this |
this
has sugar comparable to sd
Implements Poly_Strategy_Data.
Definition at line 35 of file weighted_sugar_strategy.cpp.
|
virtual |
returns true
iff this
sugar is larger than sd
’s
sd | sugar data to compare with this |
true
if and only if this
has larger sugar than sd
Implements Poly_Strategy_Data.
Definition at line 40 of file weighted_sugar_strategy.cpp.
|
virtual |
re-evaluates the sugar, if need be
u | monomial to multiply to g , then reduce this by the product |
g | a polynomial whose leading monomial divides this |
Reimplemented from Poly_Strategy_Data.
Definition at line 71 of file weighted_sugar_strategy.cpp.
|
strong |
flag indicating which strategy to use for computation
Definition at line 34 of file strategies.hpp.