Gröbner basis project
Codebase for research into Gröbner basis computation
|
The general class of a polynomial. More...
#include <polynomial.hpp>
Public Member Functions | |
Construction | |
Abstract_Polynomial (Polynomial_Ring &ring, Monomial_Ordering *ordering) | |
Destruction | |
virtual | ~Abstract_Polynomial () |
Basic properties | |
Polynomial_Ring & | base_ring () const |
ring in which this polynomial resides | |
Prime_Field & | ground_field () |
ground field – all coefficients should be in this field | |
unsigned | number_of_variables () const |
number of variables – all monomials should agree with this (though it is never tested by the class) | |
Monomial_Ordering * | monomial_ordering () const |
reports leading monomial’s monomial ordering | |
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 unsigned | length () const =0 |
number of monomials | |
virtual bool | is_zero () const =0 |
is this polynomial zero? | |
virtual bool | can_reduce (Abstract_Polynomial &other) const |
can this reduce other ? | |
virtual Poly_Strategy_Data * | strategy () const |
strategy related information | |
virtual DEG_TYPE | standard_degree () const |
maximum sum of exponents for any monomial | |
virtual DEG_TYPE | weighted_degree (const WT_TYPE *w=nullptr) const |
weighted sum of exponents for any monomial More... | |
Computation | |
virtual Abstract_Polynomial * | zero_polynomial () const =0 |
new zero polynomial of this same type | |
virtual Abstract_Polynomial * | monomial_multiple (const Monomial &) const =0 |
multiple of this and \(u\) | |
virtual Abstract_Polynomial * | scalar_multiple (const Prime_Field_Element &) const =0 |
multiple of this and \(c\) | |
void | set_strategy (Poly_Strategy_Data *psd) |
sets the polynomial’s strategy to psd | |
Ordering monomials | |
virtual void | set_monomial_ordering (Monomial_Ordering *order, bool sort_anew=true)=0 |
set the monomial ordering and sort the polynomials (optionally, but by default) More... | |
virtual void | sort_by_order ()=0 |
sort according to the leading monomial’s ordering More... | |
Iteration | |
virtual Polynomial_Iterator * | new_iterator () const =0 |
An iterator that poses no risk of modifying the polynomial. | |
virtual Polynomial_Iterator * | begin () const =0 |
virtual Polynomial_Iterator * | end () const =0 |
Protected Attributes | |
Polynomial_Ring & | R |
data about polynomial ring | |
Poly_Strategy_Data * | strat = nullptr |
data for computational strategies | |
I/O | |
virtual void | print (ostream &os=cout) const |
virtual void | println (ostream &os=cout) const |
virtual void | printlncout () const |
ostream & | operator<< (ostream &os, const Abstract_Polynomial &p) |
output | |
The general class of a polynomial.
This class encapsulates the minimum feature set necessary for our application. Naturally, it must be possible to identify a leading monomial and coefficient. Every polynomial must also be able to produce an iterator; indicate its its length (number of monomials), and its number of variables; describe its ground field; and produce a zero polynomial of the same type (this has its uses).
Definition at line 84 of file polynomial.hpp.
|
inline |
ring | the polynomial ring in which this polynomial will reside |
ordering | the monomial ordering that first sorts the monomials |
Definition at line 93 of file polynomial.hpp.
|
pure virtual |
set the monomial ordering and sort the polynomials (optionally, but by default)
Implemented in Polynomial_Linked_List, Polynomial_Geobucket, Double_Buffered_Polynomial, and Constant_Polynomial.
|
pure virtual |
sort according to the leading monomial’s ordering
Note that it makes sense to sort even Constant_Polynomial’s, as it is not the polynomial that changes, only the order of its monomials.
Implemented in Polynomial_Linked_List, Double_Buffered_Polynomial, Polynomial_Geobucket, and Constant_Polynomial.
|
virtual |
weighted sum of exponents for any monomial
If the given weight pointer is nullptr
, returns the standard degree.
Definition at line 91 of file polynomial.cpp.