1 #ifndef __REDUCTION_SUPPORT_HPP 2 #define __REDUCTION_SUPPORT_HPP 21 #include "system_constants.hpp" 22 #include "polynomial.hpp" 23 #include "monomial.hpp" 42 g->leading_monomial() | t
76 bool very_verbose =
false;
79 if (verbose) cout << comm_id <<
" reducing " << s->
leading_monomial() <<
"?\n";
80 if (very_verbose) s->println();
81 if ((g = find_reducer<T>(s, G))) {
82 if (verbose) cout << comm_id <<
" yes! by " << g->
leading_monomial() << endl;
83 if (very_verbose) { cout <<
"yes! by "; g->println(); }
86 cout <<
"\tresults in ";
95 if (verbose or very_verbose) cout <<
"no!\n";
The general class of a polynomial.
virtual bool is_zero() const =0
is this polynomial zero?
virtual Monomial & leading_monomial() const =0
leading monomial – call after sort_by_order()!
virtual Prime_Field_Element leading_coefficient() const =0
leading coefficient – call after sort_by_order()!
virtual Mutable_Polynomial * zero_polynomial() const =0
zero polynomial of this type
virtual bool valid_reduction(const Abstract_Polynomial &r, const Abstract_Polynomial &g) const
hook called while finding a reducer
void reduce_over_basis(Mutable_Polynomial **sp, const T &G, int comm_id=0)
Reduce the polynomial r over the basis G.
virtual void add_last(const Prime_Field_Element &, const Monomial &)=0
Attach a new monomial to the tail – check that it belongs at tail!
Polynomials that need arithmetic typically descend from this class.
Implementation of monomials.
virtual Mutable_Polynomial * detach_head()=0
Remove and return the head.
void top_reduce(Mutable_Polynomial *s, Abstract_Polynomial *g, int comm_id)
reduce the polynomial **sp by *g
void set_strategy(Poly_Strategy_Data *psd)
sets the polynomial’s strategy to psd
Abstract_Polynomial * find_reducer(Abstract_Polynomial *r, const T &G)
Find a polynomial in the basis G that can reduce r.
virtual Poly_Strategy_Data * strategy() const
strategy related information