Public Member Functions
CPolyCoeffsEnumerator Class Reference

This is a polynomial enumerator for simple iteration over coefficients of polynomials. More...

#include <PolyEnumerator.h>

Public Member Functions

 CPolyCoeffsEnumerator (poly p)
 
virtual IPolyCoeffsEnumerator::reference Current ()
 Gets the current element in the collection (read and write). More...
 
virtual IPolyCoeffsEnumerator::const_reference Current () const
 Gets the current element in the collection (read only). More...
 
- Public Member Functions inherited from CBasePolyEnumerator
virtual bool IsValid () const
 Current position is inside the collection (not -1 or past the end) More...
 
void Reset (poly p)
 Reset this polynomial Enumerator with a different input polynomial. More...
 
 CBasePolyEnumerator (poly p=NULL)
 This enumerator is an empty polynomial by default. More...
 
virtual void Reset ()
 Sets the position marker to the leading term. More...
 
virtual bool MoveNext ()
 Advances the position to the next term of the polynomial. returns true if the position marker was successfully advanced to the next term which can be used; false if the position marker has passed the end of the polynomial. More...
 

Additional Inherited Members

- Public Types inherited from IAccessor< T >
typedef T value_type
 
typedef value_typereference
 
typedef const value_typeconst_reference
 
- Protected Member Functions inherited from IBaseEnumerator
 IBaseEnumerator ()
 
 ~IBaseEnumerator ()
 
- Protected Member Functions inherited from IAccessor< T >
 IAccessor ()
 
 ~IAccessor ()
 
- Protected Attributes inherited from CBasePolyEnumerator
poly m_position
 current position in the iterable object More...
 

Detailed Description

This is a polynomial enumerator for simple iteration over coefficients of polynomials.

It is required to inherit this class from IEnumerator<number> for its use in coeffs and implement IAccessor<number> interface.

Note also the virtual multiple inheritance due to the diamond problem of inheriting both CBasePolyEnumerator and IEnumerator<T> from IBaseEnumerator.

See also
CBasePolyEnumerator,
IEnumerator

Definition at line 129 of file PolyEnumerator.h.

Constructor & Destructor Documentation

◆ CPolyCoeffsEnumerator()

CPolyCoeffsEnumerator::CPolyCoeffsEnumerator ( poly  p)
inline

Definition at line 132 of file PolyEnumerator.h.

CBasePolyEnumerator(poly p=NULL)
This enumerator is an empty polynomial by default.
int p
Definition: cfModGcd.cc:4019

Member Function Documentation

◆ Current() [1/2]

virtual IPolyCoeffsEnumerator::reference CPolyCoeffsEnumerator::Current ( )
inlinevirtual

Gets the current element in the collection (read and write).

Implements IAccessor< T >.

Definition at line 135 of file PolyEnumerator.h.

136  {
137  assume( IsValid() );
138  return pGetCoeff(m_position);
139  }
virtual bool IsValid() const
Current position is inside the collection (not -1 or past the end)
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy ...
Definition: monomials.h:44
#define assume(x)
Definition: mod2.h:390
poly m_position
current position in the iterable object

◆ Current() [2/2]

virtual IPolyCoeffsEnumerator::const_reference CPolyCoeffsEnumerator::Current ( ) const
inlinevirtual

Gets the current element in the collection (read only).

Implements IAccessor< T >.

Definition at line 142 of file PolyEnumerator.h.

143  {
144  assume( IsValid() );
145  return pGetCoeff(m_position);
146  }
virtual bool IsValid() const
Current position is inside the collection (not -1 or past the end)
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy ...
Definition: monomials.h:44
#define assume(x)
Definition: mod2.h:390
poly m_position
current position in the iterable object

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