1 #ifndef __DYNAMIC_ENGINE_H__ 2 #define __DYNAMIC_ENGINE_H__ 23 #include "monomial.hpp" 24 #include "monomial_ideal.hpp" 25 #include "hilbert_functions.hpp" 26 #include "polynomial.hpp" 27 #include "critical_pair.hpp" 28 #include "lp_solver.hpp" 29 #include "skeleton.hpp" 30 #include "glpk_solver.hpp" 31 #include "ppl_solver.hpp" 37 using std::map;
using std::vector;
using std::cout;
using std::endl;
72 ORD_HILBERT_THEN_LEX, ORD_HILBERT_THEN_DEG, GRAD_HILB_THEN_DEG,
73 MIN_CRIT_PAIRS, GRAD_MIN_CRIT_PAIRS,
74 BETTI_HILBERT_DEG, BIG_BETTI_HILBERT_DEG, GRAD_BETTI_HILBERT_DEG,
75 SMOOTHEST_DEGREES, LARGEST_MAX_COMPONENT,
76 DEG_THEN_GRAD_HILB, DEG_THEN_ORD_HILBERT,
123 const list<Critical_Pair_Dynamic *> & P,
125 ) : t(u), ordering(w), num_new_pairs(-1), min_deg(-1), max_deg(-1),
126 I(u.num_vars(), F, h), pairs(P)
132 : t(PI.t), ordering(PI.ordering), num_new_pairs(PI.num_new_pairs),
133 min_deg(PI.min_deg), max_deg(PI.max_deg), I(PI.I), pairs(PI.pairs)
153 inline const map<DEG_TYPE, unsigned long> &
getIncBetti(
bool graded =
false)
156 return I.inc_betti(ordering.weights());
158 return I.inc_betti();
168 return I.hilbert_numerator(ordering.weights());
170 return I.hilbert_numerator();
180 return I.reduced_hilbert_numerator(ordering.weights());
182 return I.reduced_hilbert_numerator();
188 return I.hilbert_poly();
208 const list<Monomial> & G = I.generators();
209 min_deg = max_deg = G.front().weighted_degree(ordering.weights());
211 int d = g.weighted_degree(ordering.weights());
212 if (d < min_deg) min_deg = d;
213 if (d > max_deg) max_deg = d;
216 return max_deg - min_deg;
222 void computeNumberNewPairs();
232 const list<Critical_Pair_Dynamic *> &
pairs;
257 const set<Monomial> &allPPs,
259 const set<::ray> &bndrys,
260 set<Monomial> &result,
262 set<Monomial> &boundary_mons,
280 const list<Abstract_Polynomial *> ¤tPolys
294 const set<Monomial> &monomialsForComparison,
295 vector<constraint> &result
318 list<Monomial> &CurrentLPPs,
320 const list<Abstract_Polynomial *> &CurrentPolys,
321 const list<Critical_Pair_Dynamic *> & critpairs,
323 bool &ordering_changed,
The general class of a polynomial.
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.
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.
const Monomial_Ideal & getIdeal() const
the old ideal of leading monomials
Dense_Univariate_Integer_Polynomial * getHilbertReducedNumerator(bool graded=false)
the Hilbert numerator obtained by adding the monomial to the ideal (numerator is reduced) ...
int howManyNewPairs() const
estimate of the number of new critical pairs generated by adding the monomial to the ideal ...
A class for monomial ideals.
int getDifferenceInDegree()
computes the difference in degree between the first and last monomials of the ideal ...
int num_new_pairs
estimate of number of new pairs
const list< Critical_Pair_Dynamic * > & pairs
the list of critical pairs of at this point in the algorithm
const map< DEG_TYPE, unsigned long > & getIncBetti(bool graded=false)
the incremental Betti numbers obtained by adding the monomial to the ideal
Dense_Univariate_Rational_Polynomial * getHilbertPolynomial()
the Hilbert polynomial obtained by adding the monomial to the ideal
PPWithIdeal(const PPWithIdeal &PI)
copy constructor
Monomial_Ideal I
the ideal of leading terms
quick-’n-dirty Dense_Univariate integer polynomial class
inline ::ray getOrdering()
the current monomial ordering
int min_deg
minimum weighted degree of monomials in ideal
void compatiblePP(Monomial currentLPP, const set< Monomial > &allPPs, const set<::ray > &bndrys, set< Monomial > &result, set< Monomial > &boundary_mons, LP_Solver *skel)
exact or approximate polyhedral cone solution, with methods allowing definition and refinement ...
Dense_Univariate_Integer_Polynomial * getHilbertNumerator(bool graded=false)
the Hilbert numerator obtained by adding the monomial to the ideal (numerator is not reduced) ...
~PPWithIdeal()
does nothing the default wouldn't do
Implementation of monomials.
bool verifyAndModifyIfNecessary(LP_Solver *skel, const list< Abstract_Polynomial *> ¤tPolys)
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)
const Monomial & getPP() const
the leading monomial being added to the ideal
void ConstraintsForNewPP(const PPWithIdeal &pp_I, const set< Monomial > &monomialsForComparison, vector< constraint > &result)
quick-’n-dirty Dense_Univariate rational polynomial class
Monomial t
the last monomial added to
int degOfNewPairs() const
the degree of the new critical pairs generated by adding the monomial to the ideal ...
int max_deg
minimum weighted degree of monomials in ideal
::ray ordering
the current ordering of the Gröbner basis computation
a ray defined by nonnegative coordinates