Loading...
Searching...
No Matches
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).
virtual IPolyCoeffsEnumerator::const_reference | Current () const
| Gets the current element in the collection (read only).
Public Member Functions inherited from CBasePolyEnumerator
virtual bool | IsValid () const
| Current position is inside the collection (not -1 or past the end).
void | Reset (poly p)
| Reset this polynomial Enumerator with a different input polynomial.
| 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 successfully advanced to the next term which can be used; false if the position marker has passed the end of the polynomial.

## Additional Inherited Members

Public Types inherited from IAccessor< T >
typedef T | value_type
typedef value_type & | reference
typedef const value_type & | const_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

## 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(p) {}
p
int p
Definition cfModGcd.cc:4086
CBasePolyEnumerator::CBasePolyEnumerator
CBasePolyEnumerator(poly p=NULL)
This enumerator is an empty polynomial by default.
Definition PolyEnumerator.h:62

## Member Function Documentation

## Current() [1/2]

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

inline virtual

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

Implements IAccessor< T >.

Definition at line 135 of file PolyEnumerator.h.

{
assume( IsValid() );
return pGetCoeff(m_position);
}
CBasePolyEnumerator::IsValid
virtual bool IsValid() const
Current position is inside the collection (not -1 or past the end).
Definition PolyEnumerator.h:46
CBasePolyEnumerator::m_position
poly m_position
current position in the iterable object
Definition PolyEnumerator.h:43
assume
#define assume(x)
Definition mod2.h:389
pGetCoeff
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

## Current() [2/2]

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

inline virtual

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

Implements IAccessor< T >.

Definition at line 142 of file PolyEnumerator.h.

{
assume( IsValid() );
return pGetCoeff(m_position);
}

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

- libpolys/polys/PolyEnumerator.h