Gröbner basis project
Codebase for research into Gröbner basis computation
|
classes related to iterating over polynomials More...
Classes | |
class | Constant_Polynomial_Iterator |
Iterates through a Constant_Polynomial. More... | |
class | DB_Polynomial_Iterator |
Iterator over double-buffered polynomials. More... | |
class | Geobucket_Iterator |
Iterates through polynomials using a geobucket representation. See Mutable_Polynomial_Iterator for details on methods. More... | |
class | LLPolynomial_Iterator |
Iterator over linked list polynomials. More... | |
class | Mutable_Constant_Polynomial_Iterator |
An iterator to modify monomials and coefficients of a Constant_Polynomial. More... | |
class | Mutable_Polynomial_Iterator |
A Mutable_Polynomial_Iterator allows one to modify the terms of a polynomial. More... | |
class | Polynomial_Iterator |
Used to iterate through a polynomial. More... | |
class | Polynomial_Term |
convenience class to help iterate through polynomials More... | |
classes related to iterating over polynomials
class Constant_Polynomial_Iterator |
Iterates through a Constant_Polynomial.
Definition at line 37 of file polynomial_array.hpp.
Public Member Functions | |
Construction | |
Constant_Polynomial_Iterator (const Constant_Polynomial *q, bool at_end=false) | |
Creates an iterator for poly and starts at the leading term. More... | |
Destruction | |
~Constant_Polynomial_Iterator () | |
Iteration | |
virtual void | restart_iteration () override |
This should move the iterator to the leading term. | |
virtual void | moveRight () override |
Moves right in the polynomial, to the next smaller monomial. | |
virtual void | moveLeft () override |
Moves left in the polynomial, to the next larger monomial. | |
virtual bool | canMoveRight () const override |
Can this iterator move right, or would it fall off? | |
virtual bool | canMoveLeft () const override |
virtual bool | fellOff () const override |
Data access | |
virtual const Monomial & | currMonomial () const override |
Reports the monomial at the current position. | |
virtual const Prime_Field_Element & | currCoeff () const override |
Reports the coefficient at the current position. | |
![]() | |
virtual | ~Polynomial_Iterator ()=0 |
needed to avoid undefined behavior when disposing | |
const Polynomial_Iterator & | operator++ () |
Moves right in the polynomial, to the next smaller monomial. | |
virtual const Abstract_Polynomial * | my_poly () const |
Reports the polynomial on which this is iterating. | |
const Polynomial_Term | operator* () const |
C++11 iteration. | |
virtual bool | operator!= (const Polynomial_Iterator &other) const |
Protected Attributes | |
long | i |
current position in p’s array | |
const Constant_Polynomial * | p |
the polynomial we iterate on | |
![]() | |
const Abstract_Polynomial * | p |
the polynomial this points to | |
Constant_Polynomial_Iterator::Constant_Polynomial_Iterator | ( | const Constant_Polynomial * | q, |
bool | at_end = false |
||
) |
Creates an iterator for poly
and starts at the leading term.
at_end | whether to start at the end of the polynomial |
q | polynomial to iterate over |
Definition at line 23 of file polynomial_array.cpp.
|
overridevirtual |
Implements Polynomial_Iterator.
Definition at line 49 of file polynomial_array.cpp.
|
overridevirtual |
This is NOT the same as pointing to a monomial with coefficient zero; this is true when the iterator would probably report inaccurate data.
Implements Polynomial_Iterator.
Definition at line 51 of file polynomial_array.cpp.
class DB_Polynomial_Iterator |
Iterator over double-buffered polynomials.
Definition at line 38 of file polynomial_double_buffered.hpp.
Public Member Functions | |
Construction | |
DB_Polynomial_Iterator (const Double_Buffered_Polynomial *f, bool at_end=false) | |
Destruction | |
~DB_Polynomial_Iterator () | |
Iteration | |
virtual void | restart_iteration () override |
This should move the iterator to the leading term. | |
virtual void | moveRight () override |
Moves right in the polynomial, to the next smaller monomial. | |
virtual void | moveLeft () override |
Moves left in the polynomial, to the next larger monomial. | |
virtual bool | fellOff () const override |
virtual bool | canMoveLeft () const override |
virtual bool | canMoveRight () const override |
Can this iterator move right, or would it fall off? | |
Data access | |
virtual const Monomial & | currMonomial () const override |
Reports the monomial at the current position. | |
virtual const Prime_Field_Element & | currCoeff () const override |
Reports the coefficient at the current position. | |
Data modification | |
virtual void | set_currCoeff (const Prime_Field_Element &a) override |
change coefficient in current position | |
virtual void | set_currMonomial (const Monomial &t) override |
change monomial in current position | |
Data modification | |
![]() | |
virtual | ~Polynomial_Iterator ()=0 |
needed to avoid undefined behavior when disposing | |
const Polynomial_Iterator & | operator++ () |
Moves right in the polynomial, to the next smaller monomial. | |
virtual const Abstract_Polynomial * | my_poly () const |
Reports the polynomial on which this is iterating. | |
const Polynomial_Term | operator* () const |
C++11 iteration. | |
virtual bool | operator!= (const Polynomial_Iterator &other) const |
Protected Attributes | |
Prime_Field_Element * | A |
pointer to coefficients | |
long long | current_position |
current position in the list | |
unsigned | head |
position of first monomial | |
Monomial * | T |
pointer to monomials | |
unsigned | tail |
position of last monomial | |
![]() | |
const Abstract_Polynomial * | p |
the polynomial this points to | |
|
overridevirtual |
Implements Polynomial_Iterator.
Definition at line 35 of file polynomial_double_buffered.cpp.
|
overridevirtual |
This is NOT the same as pointing to a monomial with coefficient zero; this is true when the iterator would probably report inaccurate data.
Implements Polynomial_Iterator.
Definition at line 31 of file polynomial_double_buffered.cpp.
class Geobucket_Iterator |
Iterates through polynomials using a geobucket representation. See Mutable_Polynomial_Iterator for details on methods.
Implementation based on [10].
Definition at line 58 of file polynomial_geobucket.hpp.
Public Member Functions | |
Construction | |
Geobucket_Iterator (const Polynomial_Geobucket *, bool at_end=false) | |
Geobucket_Iterator (Polynomial_Geobucket *, bool at_end=false) | |
Destruction | |
~Geobucket_Iterator () | |
Iteration | |
virtual void | restart_iteration () override |
This should move the iterator to the leading term. | |
virtual void | moveRight () override |
Moves right in the polynomial, to the next smaller monomial. | |
virtual void | moveLeft () override |
Moves left in the polynomial, to the next larger monomial. | |
virtual bool | canMoveRight () const override |
Can this iterator move right, or would it fall off? | |
virtual bool | canMoveLeft () const override |
virtual bool | fellOff () const override |
Data access | |
virtual const Monomial & | currMonomial () const override |
Reports the monomial at the current position. | |
virtual const Prime_Field_Element & | currCoeff () const override |
Reports the coefficient at the current position. | |
Data modification | |
virtual void | set_currCoeff (const Prime_Field_Element &a) override |
change coefficient in current position | |
virtual void | set_currMonomial (const Monomial &t) override |
change monomial in current position | |
Data modification | |
![]() | |
virtual | ~Polynomial_Iterator ()=0 |
needed to avoid undefined behavior when disposing | |
const Polynomial_Iterator & | operator++ () |
Moves right in the polynomial, to the next smaller monomial. | |
virtual const Abstract_Polynomial * | my_poly () const |
Reports the polynomial on which this is iterating. | |
const Polynomial_Term | operator* () const |
C++11 iteration. | |
virtual bool | operator!= (const Polynomial_Iterator &other) const |
Protected Attributes | |
unsigned | bucket_number |
the bucket number at which we’re stopped | |
Polynomial_Geobucket * | g |
to save myself the hassle of static_cast<const Polynomial_Geobucket *>(p) every time I turn around | |
LLPolynomial_Iterator * | pi |
an iterator for the current bucket | |
![]() | |
const Abstract_Polynomial * | p |
the polynomial this points to | |
|
overridevirtual |
Implements Polynomial_Iterator.
Definition at line 23 of file polynomial_geobucket.cpp.
|
overridevirtual |
This is NOT the same as pointing to a monomial with coefficient zero; this is true when the iterator would probably report inaccurate data.
Implements Polynomial_Iterator.
Definition at line 31 of file polynomial_geobucket.cpp.
class LLPolynomial_Iterator |
Iterator over linked list polynomials.
Definition at line 102 of file polynomial_linked_list.hpp.
Public Member Functions | |
Construction | |
LLPolynomial_Iterator (Polynomial_Linked_List *poly, bool at_end=false) | |
Initializes at the leading monomial. | |
LLPolynomial_Iterator (const Polynomial_Linked_List *poly, bool at_end=false) | |
Initializes at the leading monomial. | |
Iteration | |
virtual void | restart_iteration () override |
Initializes at the leading monomial. | |
virtual void | moveRight () override |
Returns the monomial the iterator currently points to. More... | |
virtual void | moveLeft () override |
Moves the iterator left: to the next larger monomial. | |
virtual bool | canMoveLeft () const override |
Can this iterator move left, or would it fall off? | |
virtual bool | canMoveRight () const override |
Can this iterator move right, or would it fall off? | |
virtual bool | fellOff () const override |
true iff the iterator no longer points to a valid monomial. | |
Data access | |
virtual const Monomial & | currMonomial () const override |
Reports the monomial at the current position. | |
virtual const Prime_Field_Element & | currCoeff () const override |
Returns the coefficient of the monomial the iterator currently points to. | |
Data modification | |
![]() | |
virtual | ~Polynomial_Iterator ()=0 |
needed to avoid undefined behavior when disposing | |
const Polynomial_Iterator & | operator++ () |
Moves right in the polynomial, to the next smaller monomial. | |
virtual const Abstract_Polynomial * | my_poly () const |
Reports the polynomial on which this is iterating. | |
const Polynomial_Term | operator* () const |
C++11 iteration. | |
virtual bool | operator!= (const Polynomial_Iterator &other) const |
Data modification | |
Polynomial_Linked_List * | p |
@ More... | |
Monomial_Node * | iter_curr |
the node at which we have stopped | |
virtual void | set_currCoeff (const Prime_Field_Element &a) override |
change coefficient in current position | |
virtual void | set_currMonomial (const Monomial &t) override |
change monomial in current position | |
Additional Inherited Members | |
![]() | |
const Abstract_Polynomial * | p |
the polynomial this points to | |
|
inlineoverridevirtual |
Returns the monomial the iterator currently points to.
Moves the iterator right: to the next smaller monomial.
Implements Polynomial_Iterator.
Definition at line 128 of file polynomial_linked_list.hpp.
|
protected |
class Mutable_Constant_Polynomial_Iterator |
An iterator to modify monomials and coefficients of a Constant_Polynomial.
Sometimes we want to be able to change particular monomials in a Constant_Polynomial. This a bit naughty, since it violates the spirit of a Constant_Polynomial. I guess I need a different name for the latter. This generally mimics a Constant_Polynomial_Iterator, but cannot inherit from it due to issues with the const
keyword. This may reflect bad design.
Definition at line 253 of file polynomial_array.hpp.
Public Member Functions | |
Construction | |
Mutable_Constant_Polynomial_Iterator (Constant_Polynomial *poly) | |
Creates an iterator for poly and starts at its leading term. More... | |
Destruction | |
~Mutable_Constant_Polynomial_Iterator () | |
Iteration | |
virtual void | restart_iteration () override |
This should move the iterator to the leading term. | |
virtual void | moveRight () override |
Moves right in the polynomial, to the next smaller monomial. | |
virtual void | moveLeft () override |
Moves left in the polynomial, to the next larger monomial. | |
virtual bool | fellOff () const override |
Data access | |
virtual const Monomial & | currMonomial () const override |
Reports the monomial at the current position. | |
virtual const Prime_Field_Element & | currCoeff () const override |
Reports the coefficient at the current position. | |
Data modification | |
virtual void | set_currCoeff (const Prime_Field_Element &a) override |
change coefficient in current position | |
virtual void | set_currMonomial (const Monomial &t) override |
change monomial in current position | |
Data modification | |
![]() | |
virtual | ~Polynomial_Iterator ()=0 |
needed to avoid undefined behavior when disposing | |
const Polynomial_Iterator & | operator++ () |
Moves right in the polynomial, to the next smaller monomial. | |
virtual bool | canMoveRight () const =0 |
Can this iterator move right, or would it fall off? | |
virtual bool | canMoveLeft () const =0 |
virtual const Abstract_Polynomial * | my_poly () const |
Reports the polynomial on which this is iterating. | |
const Polynomial_Term | operator* () const |
C++11 iteration. | |
virtual bool | operator!= (const Polynomial_Iterator &other) const |
Protected Attributes | |
long long | i |
the monomial we currently point to | |
Constant_Polynomial * | p |
the polynomial over which we iterate | |
![]() | |
const Abstract_Polynomial * | p |
the polynomial this points to | |
Mutable_Constant_Polynomial_Iterator::Mutable_Constant_Polynomial_Iterator | ( | Constant_Polynomial * | poly | ) |
Creates an iterator for poly
and starts at its leading term.
poly | the polynomial this will iterate over |
Definition at line 267 of file polynomial_array.cpp.
|
overridevirtual |
This is NOT the same as pointing to a monomial with coefficient zero; this is true when the iterator would probably report inaccurate data.
Implements Polynomial_Iterator.
Definition at line 282 of file polynomial_array.cpp.
class Mutable_Polynomial_Iterator |
A Mutable_Polynomial_Iterator allows one to modify the terms of a polynomial.
Definition at line 283 of file polynomial.hpp.
Public Member Functions | |
Data modification | |
virtual void | set_currCoeff (const Prime_Field_Element &)=0 |
change coefficient in current position | |
virtual void | set_currMonomial (const Monomial &)=0 |
change monomial in current position | |
![]() | |
virtual | ~Polynomial_Iterator ()=0 |
needed to avoid undefined behavior when disposing | |
virtual void | restart_iteration ()=0 |
This should move the iterator to the leading term. | |
virtual void | moveRight ()=0 |
Moves right in the polynomial, to the next smaller monomial. | |
const Polynomial_Iterator & | operator++ () |
Moves right in the polynomial, to the next smaller monomial. | |
virtual bool | canMoveRight () const =0 |
Can this iterator move right, or would it fall off? | |
virtual void | moveLeft ()=0 |
Moves left in the polynomial, to the next larger monomial. | |
virtual bool | canMoveLeft () const =0 |
virtual bool | fellOff () const =0 |
virtual const Abstract_Polynomial * | my_poly () const |
Reports the polynomial on which this is iterating. | |
virtual const Monomial & | currMonomial () const =0 |
Reports the monomial at the current position. | |
virtual const Prime_Field_Element & | currCoeff () const =0 |
Reports the coefficient at the current position. | |
const Polynomial_Term | operator* () const |
C++11 iteration. | |
virtual bool | operator!= (const Polynomial_Iterator &other) const |
Additional Inherited Members | |
![]() | |
const Abstract_Polynomial * | p |
the polynomial this points to | |
class Polynomial_Iterator |
Used to iterate through a polynomial.
This class encapsulates the basic functionality needed to iterate through the monomials of a polynomial. A Polynomial_Iterator cannot modify a polynomial, however; to do that, you need a Mutable_Polynomial_Iterator.
Definition at line 224 of file polynomial.hpp.
Public Member Functions | |
Destruction | |
virtual | ~Polynomial_Iterator ()=0 |
needed to avoid undefined behavior when disposing | |
Iteration | |
virtual void | restart_iteration ()=0 |
This should move the iterator to the leading term. | |
virtual void | moveRight ()=0 |
Moves right in the polynomial, to the next smaller monomial. | |
const Polynomial_Iterator & | operator++ () |
Moves right in the polynomial, to the next smaller monomial. | |
virtual bool | canMoveRight () const =0 |
Can this iterator move right, or would it fall off? | |
virtual void | moveLeft ()=0 |
Moves left in the polynomial, to the next larger monomial. | |
virtual bool | canMoveLeft () const =0 |
virtual bool | fellOff () const =0 |
Data access | |
virtual const Abstract_Polynomial * | my_poly () const |
Reports the polynomial on which this is iterating. | |
virtual const Monomial & | currMonomial () const =0 |
Reports the monomial at the current position. | |
virtual const Prime_Field_Element & | currCoeff () const =0 |
Reports the coefficient at the current position. | |
const Polynomial_Term | operator* () const |
C++11 iteration. | |
virtual bool | operator!= (const Polynomial_Iterator &other) const |
Protected Attributes | |
const Abstract_Polynomial * | p |
the polynomial this points to | |
|
pure virtual |
Implemented in LLPolynomial_Iterator, Geobucket_Iterator, DB_Polynomial_Iterator, and Constant_Polynomial_Iterator.
|
pure virtual |
This is NOT the same as pointing to a monomial with coefficient zero; this is true when the iterator would probably report inaccurate data.
Implemented in Mutable_Constant_Polynomial_Iterator, LLPolynomial_Iterator, Geobucket_Iterator, Constant_Polynomial_Iterator, and DB_Polynomial_Iterator.
class Polynomial_Term |
convenience class to help iterate through polynomials
Definition at line 60 of file polynomial.hpp.
Public Member Functions | |
Construction | |
Polynomial_Term (const Monomial &m, const Prime_Field_Element &a) | |
Basic properties | |
const Monomial & | monomial () |
the monomial of this term | |
const Prime_Field_Element & | coefficient () |
the coefficient for this term | |
Protected Attributes | |
const Prime_Field_Element & | c |
the coefficient of this term | |
const Monomial & | t |
the monomial part of this term | |