Gröbner basis project
Codebase for research into Gröbner basis computation
|
classes related directly to Gröbner basis computation More...
Classes | |
class | Critical_Pair_Basic |
Controls the creation of s-polynomials. More... | |
class | Critical_Pair_Dynamic |
Controls the creation of s-polynomials, specialized for the dynamic algorithm. More... | |
class | Critical_Pair_XPlor |
contains information on critical pairs by their index in the basis, in addition to the usual information More... | |
class | F4_Reduction_Data |
Implementation of Faugère’s F4 algorithm. More... | |
class | PPWithIdeal |
struct | smaller_lm |
used to sort polynomials by leading monomial More... | |
Enumerations | |
enum | DynamicHeuristic { MIN_HEURISTIC = 0, ORD_HILBERT_THEN_LEX, ORD_HILBERT_THEN_DEG, GRAD_HILB_THEN_DEG, MIN_CRIT_PAIRS, GRAD_MIN_CRIT_PAIRS, BETTI_HILBERT_DEG, BIG_BETTI_HILBERT_DEG, GRAD_BETTI_HILBERT_DEG, SMOOTHEST_DEGREES, LARGEST_MAX_COMPONENT, DEG_THEN_GRAD_HILB, DEG_THEN_ORD_HILBERT, MAX_HEURISTIC } |
enum | DynamicSolver { SKELETON_SOLVER = 1, GLPK_SOLVER, PPL_SOLVER, GLPK_ORACLE_SOLVER } |
used by buchberger_dynamic() to decide which solver to use More... | |
enum | SPolyCreationFlags { MIN_SPCREATE_FLAG = 0, LINKED_LST, GEOBUCKETS, DOUBLE_BUF, MAX_SPCREATE_FLAG } |
flag indicating which structure to use for an s-polynomial More... | |
Functions | |
list< Constant_Polynomial * > | buchberger (const list< Abstract_Polynomial *> &F, SPolyCreationFlags rep=SPolyCreationFlags::GEOBUCKETS, StrategyFlags strategy=StrategyFlags::SUGAR_STRATEGY, WT_TYPE *strategy_weights=nullptr) |
Implementation of Buchberger’s algorithm. More... | |
list< Constant_Polynomial * > | buchberger_dynamic (const list< Abstract_Polynomial *> &F, SPolyCreationFlags method=SPolyCreationFlags::GEOBUCKETS, StrategyFlags strategy=StrategyFlags::SUGAR_STRATEGY, WT_TYPE *strategy_weights=nullptr, DynamicHeuristic heuristic=DynamicHeuristic::ORD_HILBERT_THEN_DEG, DynamicSolver solver=SKELETON_SOLVER, bool analyze_inputs=false) |
implementation of the dynamic Buchberger algorithm More... | |
list< Constant_Polynomial * > | buchberger_explorer (const vector< Abstract_Polynomial *> &F, SPolyCreationFlags method=SPolyCreationFlags::GEOBUCKETS, StrategyFlags strategy=StrategyFlags::NORMAL_STRATEGY, WT_TYPE *strategy_weights=nullptr, const int comm_id=0, const int comm_size=1) |
Alternate implementation of Buchberger’s algorithm, for parallelization. More... | |
list< Constant_Polynomial * > | buchberger_explorer (const list< Abstract_Polynomial *> &F, SPolyCreationFlags method=SPolyCreationFlags::GEOBUCKETS, StrategyFlags strategy=StrategyFlags::NORMAL_STRATEGY, WT_TYPE *strategy_weights=nullptr, const unsigned number_to_advance=2) |
Alternate implementation of Buchberger’s algorithm, for parallelization. More... | |
void | check_correctness (list< Constant_Polynomial *>G, StrategyFlags strategy) |
checks that G is a Gröbner basis by verifying each s-polynomial reduces to zero More... | |
void | compatiblePP (Monomial currentLPP, const set< Monomial > &allPPs, const set<::ray > &bndrys, set< Monomial > &result, set< Monomial > &boundary_mons, LP_Solver *skel) |
void | ConstraintsForNewPP (const PPWithIdeal &pp_I, const set< Monomial > &monomialsForComparison, vector< constraint > &result) |
list< Constant_Polynomial * > | f4_control (const list< Abstract_Polynomial *> &F) |
equivalent to buchberger() , but for Faugère’s F4 algorithm More... | |
template<typename T > | |
Abstract_Polynomial * | find_reducer (Abstract_Polynomial *r, const T &G) |
Find a polynomial in the basis G that can reduce r . More... | |
void | gm_update (list< Critical_Pair_Basic *> &P, list< Abstract_Polynomial *> &G, Abstract_Polynomial *r, StrategyFlags strategy) |
Implementation of Gebauer-Moeller algorithm. Based on description in Becker and Weispfenning (1993). More... | |
void | gm_update_dynamic (list< Critical_Pair_Dynamic *> &P, list< Abstract_Polynomial *> &G, Abstract_Polynomial *r, StrategyFlags strategy, ORDERING_TYPE *ordering) |
implementation of Gebauer-Möller algorithm, adjusted for dynamic computation More... | |
void | gm_update_explorer (list< Critical_Pair_XPlor *> &P, list< Critical_Pair_XPlor *> &Pass, list< Critical_Pair_XPlor *> *Pcancel, vector< Abstract_Polynomial *> &G, Abstract_Polynomial *r, unsigned strategy) |
Implementation of Gebauer-Moeller algorithm, with XPLOR critical pairs. Based on description in Becker and Weispfenning (1993). More... | |
void | gm_update_explorer (list< Critical_Pair_XPlor *> &P, list< Critical_Pair_XPlor *> &Pass, list< Critical_Pair_XPlor *> *Pcancel, vector< Abstract_Polynomial *> &G, Abstract_Polynomial *r, StrategyFlags strategy) |
Implementation of Gebauer-Moeller algorithm, with XPLOR critical pairs. Based on description in Becker and Weispfenning (1993). More... | |
int | hilbertCmp (const Dense_Univariate_Integer_Polynomial &hn1, const Dense_Univariate_Rational_Polynomial &hp1, const Dense_Univariate_Integer_Polynomial &hn2, const Dense_Univariate_Rational_Polynomial &hp2) |
bool | lcm_alike (const Monomial &t, const Monomial &u, const Critical_Pair_Basic *p) |
Checks if the lcm of t and u is like the lcm stored in p . More... | |
template<typename T > | |
bool | no_triplet (const T *p, const list< T *>C) |
Checks whether p is in danger of forming a Buchberger triple with some pair listed in C . We need this to avoid deleting useful new pairs. More... | |
list< Abstract_Polynomial * > | reduce_basis (list< Abstract_Polynomial *>G) |
Remove redundant polynomials from G . More... | |
template<typename T > | |
void | reduce_over_basis (Mutable_Polynomial **sp, const T &G, int comm_id=0) |
Reduce the polynomial r over the basis G. More... | |
void | reduce_over_basis_dynamic (Mutable_Polynomial **sp, const list< Abstract_Polynomial *> G) |
Reduce the polynomial r over the basis G. More... | |
template<typename T > | |
void | report_critical_pairs (const list< T *>P, bool verbose=false) |
A brief report on the number of critical pairs. If verbose is true, also lists them. More... | |
void | SelectMonomial (Abstract_Polynomial *r, list< Monomial > &CurrentLPPs, Dense_Univariate_Integer_Polynomial **current_hilbert_numerator, const list< Abstract_Polynomial *> &CurrentPolys, const list< Critical_Pair_Dynamic *> &critpairs, LP_Solver *currSkel, bool &ordering_changed, DynamicHeuristic method=DynamicHeuristic::ORD_HILBERT_THEN_DEG) |
Selects a leading power product for a polynomial. More... | |
template<typename T > | |
void | sort_pairs_by_strategy (list< T *> &P) |
Applies the strategy to find the “smallest” critical pair. More... | |
void | top_reduce (Mutable_Polynomial *s, Abstract_Polynomial *g, int comm_id) |
reduce the polynomial **sp by *g More... | |
bool | verifyAndModifyIfNecessary (LP_Solver *skel, const list< Abstract_Polynomial *> ¤tPolys) |
classes related directly to Gröbner basis computation
class Critical_Pair_Basic |
Controls the creation of s-polynomials.
This class encapsulates the information necessary to create an \(S\)-polynomial, including the actual generation of an \(S\)-polynomial, though it does not retain that information.
Definition at line 74 of file critical_pair.hpp.
Public Member Functions | |
Construction | |
Critical_Pair_Basic (Abstract_Polynomial *f, StrategyFlags strategy) | |
create critical pair (f,0) for initial polynomial | |
Critical_Pair_Basic (Abstract_Polynomial *f, Abstract_Polynomial *g, StrategyFlags strategy) | |
create critical pair (f,g) for two polynomials | |
Destruction | |
virtual | ~Critical_Pair_Basic () |
Basic properties | |
bool | is_generator () const |
whether this pair is from a generator | |
const Abstract_Polynomial * | first () const |
first polynomial in pair | |
const Abstract_Polynomial * | second () const |
second polynomial in pair | |
const Monomial & | lcm () const |
lcm of leading monomials of polynomials | |
unsigned | lcm_degree (unsigned i) const |
degree of ith variable in lcm | |
const Monomial & | first_multiplier () const |
monomial needed to multiply first polynomial to lcm() | |
const Monomial & | second_multiplier () const |
monomial needed to multiply second polynomial to lcm() | |
const Pair_Strategy_Data * | pair_key () const |
strategy used for comparison of pairs | |
virtual Mutable_Polynomial * | s_polynomial () |
to use only if s-polynomial is already computed by another method More... | |
Computation | |
virtual Mutable_Polynomial * | s_polynomial (SPolyCreationFlags method, StrategyFlags strategy) |
creates the s-polynomial for first() and second() | |
Modification | |
virtual void | set_spoly (Mutable_Polynomial *p) |
sets the s-polynomial to p , for explorer methods | |
Protected Attributes | |
Pair_Strategy_Data * | key = nullptr |
strategy used to sort critical pairs | |
Abstract_Polynomial * | p |
first polynomial in the critical pair | |
Abstract_Polynomial * | q |
second polynomial in the critical pair | |
Mutable_Polynomial * | s |
S-polynomial. | |
Monomial | tp |
monomial multiple of \(p\) that produces \(S\)-polynomial | |
Monomial | tpq |
lcm of leading monomials of \(p\) and \(q\) | |
Monomial | tq |
monomial multiple of \(q\) that produces \(S\)-polynomial | |
Friends | |
I/O | |
ostream & | operator<< (ostream &, const Critical_Pair_Basic &) |
|
inlinevirtual |
to use only if s-polynomial is already computed by another method
nullptr
and is useless. Definition at line 113 of file critical_pair.hpp.
class Critical_Pair_Dynamic |
Controls the creation of s-polynomials, specialized for the dynamic algorithm.
This class encapsulates the information necessary to create an \(S\)-polynomial, including the actual generation of an \(S\)-polynomial, though it does not retain that information. The main difference with Critical_Pair_Basic
is the enabling of late re-sorting.
Definition at line 162 of file critical_pair.hpp.
Public Member Functions | |
Construction | |
Critical_Pair_Dynamic (Abstract_Polynomial *f, StrategyFlags strategy, Weighted_Ordering *how_to_order) | |
create critical pair (f,0) for initial polynomial, with given ordering | |
Critical_Pair_Dynamic (Abstract_Polynomial *f, Abstract_Polynomial *g, StrategyFlags strategy, Weighted_Ordering *how_to_order) | |
create critical pair (f,g) for two polynomials, with given ordering | |
Computation | |
virtual Mutable_Polynomial * | s_polynomial (SPolyCreationFlags method, StrategyFlags strategy) |
creates the s-polynomial for first() and second() More... | |
Basic properties | |
Weighted_Ordering * | how_ordered () const |
the ordering associated with this pair | |
Modification | |
void | change_ordering (Weighted_Ordering *new_order) |
change the ordering associated with this pair More... | |
![]() | |
Critical_Pair_Basic (Abstract_Polynomial *f, StrategyFlags strategy) | |
create critical pair (f,0) for initial polynomial | |
Critical_Pair_Basic (Abstract_Polynomial *f, Abstract_Polynomial *g, StrategyFlags strategy) | |
create critical pair (f,g) for two polynomials | |
virtual | ~Critical_Pair_Basic () |
bool | is_generator () const |
whether this pair is from a generator | |
const Abstract_Polynomial * | first () const |
first polynomial in pair | |
const Abstract_Polynomial * | second () const |
second polynomial in pair | |
const Monomial & | lcm () const |
lcm of leading monomials of polynomials | |
unsigned | lcm_degree (unsigned i) const |
degree of ith variable in lcm | |
const Monomial & | first_multiplier () const |
monomial needed to multiply first polynomial to lcm() | |
const Monomial & | second_multiplier () const |
monomial needed to multiply second polynomial to lcm() | |
const Pair_Strategy_Data * | pair_key () const |
strategy used for comparison of pairs | |
virtual Mutable_Polynomial * | s_polynomial () |
to use only if s-polynomial is already computed by another method More... | |
virtual void | set_spoly (Mutable_Polynomial *p) |
sets the s-polynomial to p , for explorer methods | |
Protected Attributes | |
Weighted_Ordering * | ordering |
the Monomial_Ordering assigned to this pair — might disagree with that of polynomials; they must be updated immediately if this is a generator; otherwise, update can wait until the critical pair is computed. | |
![]() | |
Pair_Strategy_Data * | key = nullptr |
strategy used to sort critical pairs | |
Abstract_Polynomial * | p |
first polynomial in the critical pair | |
Abstract_Polynomial * | q |
second polynomial in the critical pair | |
Mutable_Polynomial * | s |
S-polynomial. | |
Monomial | tp |
monomial multiple of \(p\) that produces \(S\)-polynomial | |
Monomial | tpq |
lcm of leading monomials of \(p\) and \(q\) | |
Monomial | tq |
monomial multiple of \(q\) that produces \(S\)-polynomial | |
Friends | |
I/O | |
ostream & | operator<< (ostream &, const Critical_Pair_Dynamic &) |
outputs the pair, and the ordering | |
I/O |
|
inline |
change the ordering associated with this pair
This is necessary at least for critical pairs where one polynomial is a generator that we have not yet computed. We delay re-sorting the polynomial until the s-polynomial’s computation.
new_order | the new ordering for this critical pair |
Definition at line 234 of file critical_pair.hpp.
|
virtual |
creates the s-polynomial for first() and second()
If either first() or second() was sorted using an ordering different from the one assigned the pair, it is sorted anew.
method | a flag for what structure to use while reducing the s-polynomial; see SPolyCreationFlags |
strategy | a flag for which strategy to use in reduction; see StrategyFlags |
Reimplemented from Critical_Pair_Basic.
Definition at line 152 of file critical_pair.cpp.
class Critical_Pair_XPlor |
contains information on critical pairs by their index in the basis, in addition to the usual information
Definition at line 46 of file algorithm_buchberger_explorer.cpp.
Public Member Functions | |
Construction | |
Critical_Pair_XPlor (int i, StrategyFlags strategy, Abstract_Polynomial *f) | |
create critical pair (f,0) where f is at index i | |
Critical_Pair_XPlor (int i, int j, StrategyFlags strategy, vector< Abstract_Polynomial *>G) | |
create critical pair (f,g) where f, g are at indices i , j | |
Critical_Pair_XPlor (int i, Abstract_Polynomial *g, StrategyFlags strategy, vector< Abstract_Polynomial *>G) | |
create critical pair (f,g) where f is at index i | |
Critical_Pair_XPlor (int i, unsigned strategy, Abstract_Polynomial *f) | |
create critical pair (f,0) where f is at index i | |
Critical_Pair_XPlor (int i, int j, unsigned strategy, vector< Abstract_Polynomial *>G) | |
create critical pair (f,g) where f, g are at indices i , j | |
Critical_Pair_XPlor (int i, Abstract_Polynomial *g, unsigned strategy, vector< Abstract_Polynomial *>G) | |
create critical pair (f,g) where f is at index i | |
Critical_Pair_XPlor (int i, unsigned strategy, Abstract_Polynomial *f) | |
create critical pair (f,0) where f is at index i | |
Critical_Pair_XPlor (int i, int j, unsigned strategy, vector< Abstract_Polynomial *>G) | |
create critical pair (f,g) where f, g are at indices i , j | |
Critical_Pair_XPlor (int i, Abstract_Polynomial *g, unsigned strategy, vector< Abstract_Polynomial *>G) | |
create critical pair (f,g) where f is at index i | |
Basic properties | |
int | first_index () |
returns index of first polynomial in pair | |
int | second_index () |
returns index of second polynomial in pair | |
DEG_TYPE | sugar () |
returns sugar of this pair; use ONLY if with sugar strategy | |
int | first_index () |
returns index of first polynomial in pair | |
int | second_index () |
returns index of second polynomial in pair | |
DEG_TYPE | sugar () |
returns sugar of this pair; use ONLY if with sugar strategy | |
int | first_index () |
returns index of first polynomial in pair | |
int | second_index () |
returns index of second polynomial in pair | |
DEG_TYPE | sugar () |
returns sugar of this pair; use ONLY if with sugar strategy | |
Multiprocessing data | |
void | set_processor (int i) |
record that this pair is assigned to processor i | |
int | get_processor () |
query whether this pair is assigned to a processor, and which (nonnegative value indicates assignment, and to which) | |
void | set_processor (int i) |
record that this pair is assigned to processor i | |
int | get_processor () |
query whether this pair is assigned to a processor, and which (nonnegative value indicates assignment, and to which) | |
void | set_processor (int i) |
record that this pair is assigned to processor i | |
int | get_processor () |
query whether this pair is assigned to a processor, and which (nonnegative value indicates assignment, and to which) | |
![]() | |
Critical_Pair_Basic (Abstract_Polynomial *f, StrategyFlags strategy) | |
create critical pair (f,0) for initial polynomial | |
Critical_Pair_Basic (Abstract_Polynomial *f, Abstract_Polynomial *g, StrategyFlags strategy) | |
create critical pair (f,g) for two polynomials | |
virtual | ~Critical_Pair_Basic () |
bool | is_generator () const |
whether this pair is from a generator | |
const Abstract_Polynomial * | first () const |
first polynomial in pair | |
const Abstract_Polynomial * | second () const |
second polynomial in pair | |
const Monomial & | lcm () const |
lcm of leading monomials of polynomials | |
unsigned | lcm_degree (unsigned i) const |
degree of ith variable in lcm | |
const Monomial & | first_multiplier () const |
monomial needed to multiply first polynomial to lcm() | |
const Monomial & | second_multiplier () const |
monomial needed to multiply second polynomial to lcm() | |
const Pair_Strategy_Data * | pair_key () const |
strategy used for comparison of pairs | |
virtual Mutable_Polynomial * | s_polynomial () |
to use only if s-polynomial is already computed by another method More... | |
virtual Mutable_Polynomial * | s_polynomial (SPolyCreationFlags method, StrategyFlags strategy) |
creates the s-polynomial for first() and second() | |
virtual void | set_spoly (Mutable_Polynomial *p) |
sets the s-polynomial to p , for explorer methods | |
Protected Attributes | |
int | pi |
first polynomial in the critical pair | |
int | proc |
processor to which this pair has been assigned | |
int | qi |
second polynomial in the critical pair | |
![]() | |
Pair_Strategy_Data * | key = nullptr |
strategy used to sort critical pairs | |
Abstract_Polynomial * | p |
first polynomial in the critical pair | |
Abstract_Polynomial * | q |
second polynomial in the critical pair | |
Mutable_Polynomial * | s |
S-polynomial. | |
Monomial | tp |
monomial multiple of \(p\) that produces \(S\)-polynomial | |
Monomial | tpq |
lcm of leading monomials of \(p\) and \(q\) | |
Monomial | tq |
monomial multiple of \(q\) that produces \(S\)-polynomial | |
class F4_Reduction_Data |
Implementation of Faugère’s F4 algorithm.
Currently computes a Gröbner basis by selecting several s-polynomials of lowest lcm degree.
Definition at line 53 of file f4_reduction.hpp.
Public Member Functions | |
Construction | |
F4_Reduction_Data (const list< Critical_Pair_Basic *> &P, const list< Abstract_Polynomial *> &B) | |
encapsulation of one step of the F4 algorithm for the polynomials indicated by P and B More... | |
void | add_monomials (list< Monomial *>::iterator &ti, list< Abstract_Polynomial *>::iterator &ri, const Abstract_Polynomial *g, const Monomial &u, bool new_row=false) |
adds monomials of \( ug \) to M_build More... | |
void | initialize_many (const list< Critical_Pair_Basic *> &P) |
creates the matrix More... | |
F4_Reduction_Data (const list< Critical_Pair_Basic *> &P, const list< Abstract_Polynomial *> &B) | |
encapsulation of one step of the F4 algorithm for the polynomials indicated by P and B More... | |
void | add_monomials (list< Monomial *>::iterator &ti, list< Abstract_Polynomial *>::iterator &ri, const Abstract_Polynomial *g, const Monomial &u, bool new_row=false) |
adds monomials of \( ug \) to M_build More... | |
void | initialize_many (const list< Critical_Pair_Basic *> &P) |
creates the matrix More... | |
Destruction | |
~F4_Reduction_Data () | |
releases space for the matrix and deletes any strategies not already set to nullptr | |
~F4_Reduction_Data () | |
releases space for the matrix and deletes any strategies not already set to nullptr | |
Basic properties | |
bool | is_zero () |
returns true iff all the entries are 0 | |
vector< Poly_Sugar_Data * > | get_strategies () |
returns the strategy currently in use | |
bool | is_zero () |
returns true iff all the entries are 0 | |
vector< Poly_Sugar_Data * > | get_strategies () |
returns the strategy currently in use | |
Conversion | |
vector< Constant_Polynomial * > | finalize () |
converts this to a Constant_Polynomial and returns the result | |
vector< Constant_Polynomial * > | finalize () |
converts this to a Constant_Polynomial and returns the result | |
Modification | |
void | clear_strategy (unsigned i) |
clears the strategy; do this if you have saved it elsewhere | |
void | clear_strategy (unsigned i) |
clears the strategy; do this if you have saved it elsewhere | |
Computation | |
void | advance_head (unsigned i) |
advances head ; useful after a computation | |
void | reduce_by_old () |
reduces polynomials | |
void | reduce_by_new () |
reduces polynomials | |
void | advance_head (unsigned i) |
advances head ; useful after a computation | |
void | reduce_by_old () |
reduces polynomials | |
void | reduce_by_new () |
reduces polynomials | |
I/O | |
void | list_reducers () |
lists the reducers selected for each column, in order | |
void | print_matrix (bool show_data=false) |
prints the matrix More... | |
void | list_reducers () |
lists the reducers selected for each column, in order | |
void | print_matrix (bool show_data=false) |
prints the matrix More... | |
Protected Member Functions | |
void | reduce_my_rows (const set< unsigned > &) |
reduces the specified set of rows, suitable for multithreading | |
Protected Attributes | |
Prime_Field_Element * | A |
coefficient data | |
unsigned | cols |
number of columns in the polynomial | |
const list< Abstract_Polynomial * > & | G |
current basis of ideal | |
vector< unsigned > | heads |
head of the polynomial (location of leading term) | |
vector< Monomial * > | M |
monomials for each column | |
list< Monomial * > | M_build |
monomials while building | |
const Monomial_Ordering * | mord |
how the monomials are ordered | |
vector< unsigned > | nonzero_entries |
number of nonzero entries of each row of A | |
vector< Abstract_Polynomial * > | R |
finalized list of indices of reducers for the corresponding monomials of f | |
list< Abstract_Polynomial * > | R_build |
indices of reducers for the corresponding elements of M | |
unsigned | rows |
number of rows in the polynomial | |
Polynomial_Ring & | Rx |
polynomial ring | |
vector< Poly_Sugar_Data * > | strategies |
strategy data for each polynomial | |
F4_Reduction_Data::F4_Reduction_Data | ( | const list< Critical_Pair_Basic *> & | P, |
const list< Abstract_Polynomial *> & | B | ||
) |
encapsulation of one step of the F4 algorithm for the polynomials indicated by P
and B
P | list of critical pairs that will create a new basis; matrix will have this many rows |
B | list of polynomials currently in the basis |
Definition at line 39 of file f4_reduction.cpp.
F4_Reduction_Data::F4_Reduction_Data | ( | const list< Critical_Pair_Basic *> & | P, |
const list< Abstract_Polynomial *> & | B | ||
) |
encapsulation of one step of the F4 algorithm for the polynomials indicated by P
and B
P | list of critical pairs that will create a new basis; matrix will have this many rows |
B | list of polynomials currently in the basis |
void F4_Reduction_Data::add_monomials | ( | list< Monomial *>::iterator & | ti, |
list< Abstract_Polynomial *>::iterator & | ri, | ||
const Abstract_Polynomial * | g, | ||
const Monomial & | u, | ||
bool | new_row = false |
||
) |
adds monomials of \( ug \) to M_build
If g
is an s-polynomial generator, set the flag to true
, ti
to the beginning of M_build
, ri
to the beginning of R_build
, and u
to the first multiple in the critical pair. Setting the flag to true
signals that ti
and ri
are not at the correct insertion point, so the function needs to find this point. In this case, ti
and ri
will change.
If g
is not a generator, then ti
and ri
should point to appropriate locations for the monomial divisible by the leading term of g
. The algorithm advances both a copy of ti
and an iterator on g
to insert new monomials. In this case, the algorithm modifies neither ti
nor ri
.
ti | iterator through M_build ; see details for more information |
ri | iterator through R_build ; see details for more information |
g | polynomial, such as an s-polynomial generator or a reducer |
u | monomial to multiply to g to add monomials |
new_row | whether g is adding a new row to the basis |
Definition at line 139 of file f4_reduction.cpp.
void F4_Reduction_Data::add_monomials | ( | list< Monomial *>::iterator & | ti, |
list< Abstract_Polynomial *>::iterator & | ri, | ||
const Abstract_Polynomial * | g, | ||
const Monomial & | u, | ||
bool | new_row = false |
||
) |
adds monomials of \( ug \) to M_build
If g
is an s-polynomial generator, set the flag to true
, ti
to the beginning of M_build
, ri
to the beginning of R_build
, and u
to the first multiple in the critical pair. Setting the flag to true
signals that ti
and ri
are not at the correct insertion point, so the function needs to find this point. In this case, ti
and ri
will change.
If g
is not a generator, then ti
and ri
should point to appropriate locations for the monomial divisible by the leading term of g
. The algorithm advances both a copy of ti
and an iterator on g
to insert new monomials. In this case, the algorithm modifies neither ti
nor ri
.
ti | iterator through M_build ; see details for more information |
ri | iterator through R_build ; see details for more information |
g | polynomial, such as an s-polynomial generator or a reducer |
u | monomial to multiply to g to add monomials |
new_row | whether g is adding a new row to the basis |
void F4_Reduction_Data::initialize_many | ( | const list< Critical_Pair_Basic *> & | P | ) |
creates the matrix
called internally by constructor, which has already performed some setup; inadvisable to use elsewhere
P | list of critical pairs that will generate the matrix |
Definition at line 88 of file f4_reduction.cpp.
void F4_Reduction_Data::initialize_many | ( | const list< Critical_Pair_Basic *> & | P | ) |
creates the matrix
called internally by constructor, which has already performed some setup; inadvisable to use elsewhere
P | list of critical pairs that will generate the matrix |
void F4_Reduction_Data::print_matrix | ( | bool | show_data = false | ) |
prints the matrix
show_data | whether to show the monomials that correspond to each column |
Definition at line 197 of file f4_reduction.cpp.
void F4_Reduction_Data::print_matrix | ( | bool | show_data = false | ) |
prints the matrix
show_data | whether to show the monomials that correspond to each column |
class PPWithIdeal |
Definition at line 109 of file dynamic_engine.hpp.
Public Member Functions | |
Construction | |
PPWithIdeal (Monomial u, const list< Monomial > &F, ::ray &w, const list< Critical_Pair_Dynamic *> &P, const Dense_Univariate_Integer_Polynomial *h=nullptr) | |
Construct a monomial/ideal pair. More... | |
PPWithIdeal (const PPWithIdeal &PI) | |
copy constructor | |
Destruction | |
~PPWithIdeal () | |
does nothing the default wouldn't do | |
Basic properties | |
const Monomial & | getPP () const |
the leading monomial being added to the ideal | |
const Monomial_Ideal & | getIdeal () const |
the old ideal of leading monomials | |
inline ::ray | getOrdering () |
the current monomial ordering | |
const map< DEG_TYPE, unsigned long > & | getIncBetti (bool graded=false) |
the incremental Betti numbers obtained by adding the monomial to the ideal | |
Dense_Univariate_Integer_Polynomial * | getHilbertNumerator (bool graded=false) |
the Hilbert numerator obtained by adding the monomial to the ideal (numerator is not reduced) | |
Dense_Univariate_Integer_Polynomial * | getHilbertReducedNumerator (bool graded=false) |
the Hilbert numerator obtained by adding the monomial to the ideal (numerator is reduced) | |
Dense_Univariate_Rational_Polynomial * | getHilbertPolynomial () |
the Hilbert polynomial obtained by adding the monomial to the ideal | |
int | howManyNewPairs () const |
estimate of the number of new critical pairs generated by adding the monomial to the ideal | |
int | degOfNewPairs () const |
the degree of the new critical pairs generated by adding the monomial to the ideal | |
int | getDifferenceInDegree () |
computes the difference in degree between the first and last monomials of the ideal | |
Modification | |
void | computeNumberNewPairs () |
Computes the number of critical pairs the monomial would add. | |
Protected Attributes | |
Monomial_Ideal | I |
the ideal of leading terms | |
int | max_deg |
minimum weighted degree of monomials in ideal | |
int | min_deg |
minimum weighted degree of monomials in ideal | |
int | num_new_pairs |
estimate of number of new pairs | |
::ray | ordering |
the current ordering of the Gröbner basis computation | |
const list< Critical_Pair_Dynamic * > & | pairs |
the list of critical pairs of \(I\) at this point in the algorithm | |
Monomial | t |
the last monomial added to \(I\) | |
|
inline |
Construct a monomial/ideal pair.
u | proposed new Monomial for ideal |
F | current ideal |
w | current monomial ordering |
P | current list of critical pairs |
h | unreduced Hilbert numerator of F (does not verify correctness) |
Definition at line 121 of file dynamic_engine.hpp.
struct smaller_lm |
used to sort polynomials by leading monomial
Definition at line 141 of file algorithm_buchberger_basic.hpp.
Public Member Functions | |
bool | operator() (Abstract_Polynomial *f, Abstract_Polynomial *g) |
returns true iff f’s leading monomial is smaller than g’s More... | |
|
inline |
returns true
iff f’s
leading monomial is smaller than g’s
f | a polynomial of some sort |
g | a polynomial of some sort |
true
iff f’s
leading monomial is smaller than g’s
Definition at line 150 of file algorithm_buchberger_basic.hpp.
|
strong |
Pass this value to SelectMonomial. The methods are:
ORD_HILBERT_THEN_DEG
considers the standard Hilbert polynomial, breaking ties by the standard Hilbert series, breaking remaining ties by the (weighted) degree.DEG_THEN_ORD_HILBERT
considers the degree of the leading power products, breaking ties by the standard Hilbert polynomial, breaking remaining ties by the standard Hilbert series.GRAD_HILB_THEN_DEG
considers the standard Hilbert polynomial, breaking ties by the graded Hilbert series, breaking remaining ties by the (weighted) degree. (The graded Hilbert polynomial is actuall a quasi-polynomial, and we do not yet have a criterion to apply to this.)DEG_THEN_GRAD_HILB
considers the degree of the leading power products, breaking ties by the standard Hilbert polynomial, breaking remaining ties by the graded Hilbert series.MIN_CRIT_PAIRS
tries to minimize the number of new critical pairs.BETTI_HILBERT_DEG
tries to obtain a set of incremental Betti numbers with the largest values, comparing from the bottom and stopping when not equalBIG_BETTI_HILBERT_DEG
tries to obtain a set of incremental Betti with the largest values, comparing from the top and stopping when not equalGRAD_BETTI_HILBERT_DEG
tries to obtain a set of incremental Betti numbers with the largest values, comparing from the bottom and stopping when not equal Definition at line 69 of file dynamic_engine.hpp.
enum DynamicSolver |
used by buchberger_dynamic() to decide which solver to use
Current options include:
Definition at line 78 of file algorithm_buchberger_dynamic.hpp.
|
strong |
flag indicating which structure to use for an s-polynomial
The following options are currently available:
Definition at line 55 of file critical_pair.hpp.
list<Constant_Polynomial *> buchberger | ( | const list< Abstract_Polynomial *> & | F, |
SPolyCreationFlags | rep = SPolyCreationFlags::GEOBUCKETS , |
||
StrategyFlags | strategy = StrategyFlags::SUGAR_STRATEGY , |
||
WT_TYPE * | strategy_weights = nullptr |
||
) |
Implementation of Buchberger’s algorithm.
F | generators of the ideal whose Gröbner basis you’d like to compute |
rep | which polynomial representation to use for the s-polynomials (default is GEOBUCKETS) |
strategy | which strategy to use when selecting a critical pair (default is SUGAR_STRATEGY) |
strategy_weights | if using a weighted sugar strategy, place an array of weights here |
F
Definition at line 181 of file algorithm_buchberger_basic.cpp.
list<Constant_Polynomial *> buchberger_dynamic | ( | const list< Abstract_Polynomial *> & | F, |
SPolyCreationFlags | method = SPolyCreationFlags::GEOBUCKETS , |
||
StrategyFlags | strategy = StrategyFlags::SUGAR_STRATEGY , |
||
WT_TYPE * | strategy_weights = nullptr , |
||
DynamicHeuristic | heuristic = DynamicHeuristic::ORD_HILBERT_THEN_DEG , |
||
DynamicSolver | solver = SKELETON_SOLVER , |
||
bool | analyze_inputs = false |
||
) |
implementation of the dynamic Buchberger algorithm
F | generators of a polynomial ideal |
method | how to represent the S-polynomials during reduction |
strategy | strategy to use while sorting pairs |
strategy_weights | used by strategy |
heuristic | see DynamicHeuristic |
solver | how to compute possible monomial orderings (polyhedral skeleton) |
analyze_inputs | set to true if you want the solver to analyze the inputs to find an initial ordering (see notes) |
F
Upon termination, every polynomial in the basis should be sorted according to the same ordering, so the eventual ordering will be listed there.
F
by increasing degree before passing it to this function, as the algorithm starts from the first polynomial. This is an effective preprocessing technique that is equivalent to the standard Hilbert heuristic, since a monomial of degree \( d \) will have Hilbert numerator \( \lambda^d - 1 \). The other effective heuristics (minimum critical pairs, incremental Betti numbers) do not make sense with an empty basis. analyze_inputs
to true
. This is probably a waste of time input polynomials where many polynomials can be reduced by others, so the default is false
. Definition at line 293 of file algorithm_buchberger_dynamic.cpp.
list<Constant_Polynomial *> buchberger_explorer | ( | const vector< Abstract_Polynomial *> & | F, |
SPolyCreationFlags | method = SPolyCreationFlags::GEOBUCKETS , |
||
StrategyFlags | strategy = StrategyFlags::NORMAL_STRATEGY , |
||
WT_TYPE * | strategy_weights = nullptr , |
||
const int | comm_id = 0 , |
||
const int | comm_size = 1 |
||
) |
Alternate implementation of Buchberger’s algorithm, for parallelization.
Computes a Gröbner basis by selecting number_to_advance
pairs, reducing them as completely as possible, comparing their Hilbert functions, accepting the one with the smallest Hilbert function, and returning the others to the list of pairs.
Definition at line 410 of file algorithm_buchberger_explorer.cpp.
list<Constant_Polynomial *> buchberger_explorer | ( | const list< Abstract_Polynomial *> & | F, |
SPolyCreationFlags | method = SPolyCreationFlags::GEOBUCKETS , |
||
StrategyFlags | strategy = StrategyFlags::NORMAL_STRATEGY , |
||
WT_TYPE * | strategy_weights = nullptr , |
||
const unsigned | number_to_advance = 2 |
||
) |
Alternate implementation of Buchberger’s algorithm, for parallelization.
Computes a Gröbner basis by selecting number_to_advance
pairs, reducing them as completely as possible, comparing their Hilbert functions, accepting the one with the smallest Hilbert function, and returning the others to the list of pairs.
Definition at line 82 of file algorithm_buchberger_explorer_serial.cpp.
void check_correctness | ( | list< Constant_Polynomial *> | G, |
StrategyFlags | strategy | ||
) |
checks that G
is a Gröbner basis by verifying each s-polynomial reduces to zero
G | list of generators of an ideal |
strategy | how to select critical pairs |
Definition at line 69 of file algorithm_buchberger_basic.cpp.
void compatiblePP | ( | Monomial | currentLPP, |
const set< Monomial > & | allPPs, | ||
const set<::ray > & | bndrys, | ||
set< Monomial > & | result, | ||
set< Monomial > & | boundary_mons, | ||
LP_Solver * | skel | ||
) |
currentLPP | the current leading power product of the polynomial |
allPPs | set of all power products of the polynomial |
bndrys | boundary (or, “corner”) vectors of current cone |
result | set of power products of the polynomial compatible with bndrys |
skel | existing skeleton that defines currently-compatible orderings |
boundary_mons | boundary monomials (no apparent purpose at the moment) |
Definition at line 510 of file dynamic_engine.cpp.
void ConstraintsForNewPP | ( | const PPWithIdeal & | pp_I, |
const set< Monomial > & | monomialsForComparison, | ||
vector< constraint > & | result | ||
) |
pp_I | pair of PP with the ideal it would have. |
monomialsForComparison | monomials used to generate constraints with LPP |
result | the new constraints |
Definition at line 701 of file dynamic_engine.cpp.
list<Constant_Polynomial *> f4_control | ( | const list< Abstract_Polynomial *> & | F | ) |
equivalent to buchberger()
, but for Faugère’s F4 algorithm
F | generators of a polynomial ideal |
Definition at line 359 of file f4_reduction.cpp.
Abstract_Polynomial* find_reducer | ( | Abstract_Polynomial * | r, |
const T & | G | ||
) |
Find a polynomial in the basis G
that can reduce r
.
r | the polynomial we want to reduce |
G | a set of potential reductors, usually the basis of an ideal |
Definition at line 34 of file reduction_support.hpp.
void gm_update | ( | list< Critical_Pair_Basic *> & | P, |
list< Abstract_Polynomial *> & | G, | ||
Abstract_Polynomial * | r, | ||
StrategyFlags | strategy | ||
) |
Implementation of Gebauer-Moeller algorithm. Based on description in Becker and Weispfenning (1993).
P | list of critical pairs |
G | current basis |
r | polynomial to add to basis (and to generate new pairs) |
strategy | how to sort pairs |
Definition at line 87 of file algorithm_buchberger_basic.cpp.
void gm_update_dynamic | ( | list< Critical_Pair_Dynamic *> & | P, |
list< Abstract_Polynomial *> & | G, | ||
Abstract_Polynomial * | r, | ||
StrategyFlags | strategy, | ||
ORDERING_TYPE * | ordering | ||
) |
implementation of Gebauer-Möller algorithm, adjusted for dynamic computation
Based on description in Becker and Weispfenning (1993).
P | list of critical pairs |
G | current basis |
r | polynomial to add to basis (and to generate new pairs) |
strategy | how to sort pairs |
ordering | current ordering in the basis |
Definition at line 99 of file algorithm_buchberger_dynamic.cpp.
void gm_update_explorer | ( | list< Critical_Pair_XPlor *> & | P, |
list< Critical_Pair_XPlor *> & | Pass, | ||
list< Critical_Pair_XPlor *> * | Pcancel, | ||
vector< Abstract_Polynomial *> & | G, | ||
Abstract_Polynomial * | r, | ||
unsigned | strategy | ||
) |
Implementation of Gebauer-Moeller algorithm, with XPLOR critical pairs. Based on description in Becker and Weispfenning (1993).
P | list of critical pairs that are not assigned |
Pass | list of critical pairs that are assigned |
Pcancel | array of critical pairs that are discovered to be redundant |
G | current basis |
r | polynomial to add to basis (and to generate new pairs) |
strategy | how to sort pairs |
Definition at line 239 of file algorithm_buchberger_explorer_postcustomreduce.cpp.
void gm_update_explorer | ( | list< Critical_Pair_XPlor *> & | P, |
list< Critical_Pair_XPlor *> & | Pass, | ||
list< Critical_Pair_XPlor *> * | Pcancel, | ||
vector< Abstract_Polynomial *> & | G, | ||
Abstract_Polynomial * | r, | ||
StrategyFlags | strategy | ||
) |
Implementation of Gebauer-Moeller algorithm, with XPLOR critical pairs. Based on description in Becker and Weispfenning (1993).
P | list of critical pairs that are not assigned |
Pass | list of critical pairs that are assigned |
Pcancel | array of critical pairs that are discovered to be redundant |
G | current basis |
r | polynomial to add to basis (and to generate new pairs) |
strategy | how to sort pairs |
Definition at line 296 of file algorithm_buchberger_explorer.cpp.
int hilbertCmp | ( | const Dense_Univariate_Integer_Polynomial & | hn1, |
const Dense_Univariate_Rational_Polynomial & | hp1, | ||
const Dense_Univariate_Integer_Polynomial & | hn2, | ||
const Dense_Univariate_Rational_Polynomial & | hp2 | ||
) |
hn1 | unreduced Hilbert numerator for first function |
hn2 | unreduced Hilbert numerator for second function |
hp1 | Hilbert polynomial for first function |
hp2 | Hilbert polynomial for second function |
nullptr
. Definition at line 32 of file dynamic_engine.cpp.
bool lcm_alike | ( | const Monomial & | t, |
const Monomial & | u, | ||
const Critical_Pair_Basic * | p | ||
) |
Checks if the lcm of t
and u
is like the lcm stored in p
.
t | a monomial |
u | a monomial |
p | a critical pair |
true
iff \( lcm(t,u) \) is p’s
lcm Definition at line 25 of file algorithm_buchberger_basic.cpp.
bool no_triplet | ( | const T * | p, |
const list< T *> | C | ||
) |
Checks whether p
is in danger of forming a Buchberger triple with some pair listed in C
. We need this to avoid deleting useful new pairs.
p | a critical pair of some sort |
C | a list of critical pairs |
true
iff p
does not form a Buchberger triple with some pair in C
Definition at line 61 of file algorithm_buchberger_basic.hpp.
list<Abstract_Polynomial *> reduce_basis | ( | list< Abstract_Polynomial *> | G | ) |
Remove redundant polynomials from G
.
(A polynomial g in G is redundant when we can find h in G whose leading monomial divides g’s leading monomial.)
G | list of generators of a polynomial ideal, of which some may be redundant |
Definition at line 35 of file algorithm_buchberger_basic.cpp.
void reduce_over_basis | ( | Mutable_Polynomial ** | sp, |
const T & | G, | ||
int | comm_id = 0 |
||
) |
Reduce the polynomial r over the basis G.
sp | the s-polynomial we want to reduce |
G | the generators of an ideal |
comm_id | for MPI multiprocessing |
This is a complete reduction, not just the head, so the value of *sp may change.
Definition at line 71 of file reduction_support.hpp.
void reduce_over_basis_dynamic | ( | Mutable_Polynomial ** | sp, |
const list< Abstract_Polynomial *> | G | ||
) |
Reduce the polynomial r over the basis G.
sp | the s-polynomial to reduce |
G | a set of reducers, usually the generators of an ideal |
This is a complete reduction, not just the head, so the value of *sp may change.
Definition at line 35 of file algorithm_buchberger_dynamic.cpp.
void report_critical_pairs | ( | const list< T *> | P, |
bool | verbose = false |
||
) |
A brief report on the number of critical pairs. If verbose
is true, also lists them.
P | a list of critical pairs |
verbose | whether to list the pairs as well as report their number |
Definition at line 126 of file algorithm_buchberger_basic.hpp.
void SelectMonomial | ( | Abstract_Polynomial * | r, |
list< Monomial > & | CurrentLPPs, | ||
Dense_Univariate_Integer_Polynomial ** | current_hilbert_numerator, | ||
const list< Abstract_Polynomial *> & | CurrentPolys, | ||
const list< Critical_Pair_Dynamic *> & | critpairs, | ||
LP_Solver * | currSkel, | ||
bool & | ordering_changed, | ||
DynamicHeuristic | method = DynamicHeuristic::ORD_HILBERT_THEN_DEG |
||
) |
Selects a leading power product for a polynomial.
Applies a particular DynamicHeuristic (default is ORD_HILBERT_THEN_DEG
) and ensures compatibility with previous choices of LPP for other monomials.
r | the polynomial in need of a new choice of LPP |
CurrentLPPs | the current choices of LPPs for CurrentPolys |
CurrentPolys | the current basis of the ideal |
critpairs | the current list of critical pairs |
currSkel | the current skeleton, corresponding to the choices CurrentLPPs |
ordering_changed | whether the monomial selected changes the ordering |
method | the method to apply; see DynamicHeuristic |
current_hilbert_numerator | Hilbert numerator for CurrentLPPs (changes to match new monomial, hence the double reference) |
Definition at line 730 of file dynamic_engine.cpp.
void sort_pairs_by_strategy | ( | list< T *> & | P | ) |
Applies the strategy to find the “smallest” critical pair.
Rather than sort each time, which typically shuffles about a lot of pairs that will later be deleted, we simply pass through the list once, find the smallest one, and move it to the front.
P | a list of critical pairs |
Definition at line 212 of file algorithm_buchberger_basic.hpp.
void top_reduce | ( | Mutable_Polynomial * | s, |
Abstract_Polynomial * | g, | ||
int | comm_id | ||
) |
reduce the polynomial **sp
by *g
This is only a top reduction, though it is repetitive, as in: it continues to reduce **sp
by g
until it can be done no more.
s | a Mutable_Polynomial, the one you want to reduce |
g | a polynomial, the one you want to use in reduction |
comm_id | pass this for verbose messages during multiprocessing/MPI |
This is only a top reduction, though it is repetitive.
Definition at line 32 of file reduction_support.cpp.
bool verifyAndModifyIfNecessary | ( | LP_Solver * | skel, |
const list< Abstract_Polynomial *> & | currentPolys | ||
) |
skel | the skeleton corresponding to the choice of \(w\) |
currentPolys | the current basis |
true
if and only if we were able to make this skeleton (and thus the corresponding choice of a leading monomial) consistent with the existing basis. Definition at line 622 of file dynamic_engine.cpp.