Gröbner basis project
Codebase for research into Gröbner basis computation
Polynomial_Iterator Class Referenceabstract

Used to iterate through a polynomial. More...

#include <polynomial.hpp>

Inheritance diagram for Polynomial_Iterator:
Constant_Polynomial_Iterator Mutable_Polynomial_Iterator DB_Polynomial_Iterator Geobucket_Iterator LLPolynomial_Iterator Mutable_Constant_Polynomial_Iterator

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_Iteratoroperator++ ()
 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
 Can this iterator move left, or would it fall off?
 
virtual bool fellOff () const =0
 Reports true iff the iterator no longer points to a valid monomial. More...
 
Data access
virtual const Abstract_Polynomialmy_poly () const
 Reports the polynomial on which this is iterating.
 
virtual const MonomialcurrMonomial () const =0
 Reports the monomial at the current position.
 
virtual const Prime_Field_ElementcurrCoeff () 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_Polynomialp
 the polynomial this points to
 

Detailed Description

Used to iterate through a polynomial.

Author
John Perry
Date
2015

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 204 of file polynomial.hpp.

Member Function Documentation

◆ fellOff()

virtual bool Polynomial_Iterator::fellOff ( ) const
pure virtual

Reports true iff the iterator no longer points to a valid monomial.

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, DB_Polynomial_Iterator, and Constant_Polynomial_Iterator.


The documentation for this class was generated from the following files: