15#ifndef POLYENUMERATOR_H
16#define POLYENUMERATOR_H
160template <
class ConverterPolicy>
Abstract API for enumerators.
IEnumerator< number > IPolyCoeffsEnumerator
This is the interface we use in coeffs.h for ClearDenominators and ClearContent.
Base polynomial enumerator for simple iteration over terms of polynomials.
CBasePolyEnumerator(poly p=NULL)
This enumerator is an empty polynomial by default.
virtual void Reset()
Sets the position marker to the leading term.
virtual bool MoveNext()
Advances the position to the next term of the polynomial. returns true if the position marker was suc...
static const spolyrec m_prevposition_struct
tag for "-1" position
virtual bool IsValid() const
Current position is inside the collection (not -1 or past the end)
poly m_poly
essentially immutable original iterable object
void Reset(poly p)
Reset this polynomial Enumerator with a different input polynomial.
poly m_position
current position in the iterable object
This is a polynomial enumerator for simple iteration over coefficients of polynomials.
CPolyCoeffsEnumerator(poly p)
virtual IPolyCoeffsEnumerator::reference Current()
Gets the current element in the collection (read and write).
virtual IPolyCoeffsEnumerator::const_reference Current() const
Gets the current element in the collection (read only).
go into polynomials over an alg. extension recursively
IPolyCoeffsEnumerator & m_global_enumerator
iterates the input polynomial
virtual bool MoveNext()
Advances the enumerator to the next element of the collection. returns true if the enumerator was suc...
virtual IPolyCoeffsEnumerator::reference Current()
Gets the current element in the collection (read and write).
virtual bool IsValid() const
Current position is inside the collection (not -1 or past the end)
virtual IPolyCoeffsEnumerator::const_reference Current() const
Gets the current element in the collection (read only).
CBasePolyEnumerator m_local_enumerator
iterates the current coeff. of m_global_enumerator
virtual void Reset()
Sets the enumerator to its initial position: -1, which is before the first element in the collection.
CRecursivePolyCoeffsEnumerator(IPolyCoeffsEnumerator &itr)
NOTE: carefull: don't destruct the input enumerator before doing it with this one....
const value_type & const_reference
virtual reference Current()=0
Gets the current element in the collection (read and write).
Base enumerator interface for simple iteration over a generic collection.
virtual bool IsValid() const =0
Current position is inside the collection (not -1 or past the end)
virtual void Reset()=0
Sets the enumerator to its initial position: -1, which is before the first element in the collection.
virtual bool MoveNext()=0
Advances the enumerator to the next element of the collection. returns true if the enumerator was suc...
Templated enumerator interface for simple iteration over a generic collection of T's.
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy
static poly convert(const number &n)