Loading...
Searching...
No Matches
CRecursivePolyCoeffsEnumerator< ConverterPolicy > Class Template Reference

go into polynomials over an alg. extension recursively More...

`#include <PolyEnumerator.h>`

## Public Member Functions

| CRecursivePolyCoeffsEnumerator (IPolyCoeffsEnumerator &itr)
| NOTE: careful: don't destruct the input enumerator before doing it with this one... this also changes the original IPolyCoeffsEnumerator& itr!
virtual bool | MoveNext ()
| Advances the enumerator to the next element of the collection. returns true if the enumerator was successfully advanced to the next element; false if the enumerator has passed the end of the collection.
virtual void | Reset ()
| Sets the enumerator to its initial position: -1, which is before the first element in the collection.
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).

## Protected Member Functions

virtual bool | IsValid () const
| Current position is inside the collection (not -1 or past the end).
Protected Member Functions inherited from IBaseEnumerator
| IBaseEnumerator ()
| ~IBaseEnumerator ()
Protected Member Functions inherited from IAccessor< T >
| IAccessor ()
| ~IAccessor ()

## Private Attributes

IPolyCoeffsEnumerator & | m_global_enumerator
| iterates the input polynomial
CBasePolyEnumerator | m_local_enumerator
| iterates the current coeff. of m_global_enumerator

## Additional Inherited Members

Public Types inherited from IAccessor< T >
typedef T | value_type
typedef value_type & | reference
typedef const value_type & | const_reference

## Detailed Description

template<class ConverterPolicy>
class CRecursivePolyCoeffsEnumerator< ConverterPolicy >

go into polynomials over an alg. extension recursively

Definition at line 161 of file PolyEnumerator.h.

## Constructor & Destructor Documentation

## CRecursivePolyCoeffsEnumerator()

template<class ConverterPolicy>

CRecursivePolyCoeffsEnumerator< ConverterPolicy >::CRecursivePolyCoeffsEnumerator | ( | IPolyCoeffsEnumerator & | itr | ) |

inline

NOTE: careful: don't destruct the input enumerator before doing it with this one... this also changes the original IPolyCoeffsEnumerator& itr!

Definition at line 177 of file PolyEnumerator.h.

: m_global_enumerator(itr), m_local_enumerator(NULL) {}
CRecursivePolyCoeffsEnumerator
go into polynomials over an alg. extension recursively
Definition PolyEnumerator.h:162
CRecursivePolyCoeffsEnumerator::m_global_enumerator
IPolyCoeffsEnumerator & m_global_enumerator
iterates the input polynomial
Definition PolyEnumerator.h:164
CRecursivePolyCoeffsEnumerator::m_local_enumerator
CBasePolyEnumerator m_local_enumerator
iterates the current coeff. of m_global_enumerator
Definition PolyEnumerator.h:165

## Member Function Documentation

## Current() [1/2]

template<class ConverterPolicy>

virtual IPolyCoeffsEnumerator::reference CRecursivePolyCoeffsEnumerator< ConverterPolicy >::Current | ( |  | ) |

inline virtual

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

Implements IAccessor< T >.

Definition at line 208 of file PolyEnumerator.h.

{
assume( IsValid() );
return pGetCoeff(m_local_enumerator.m_position);
}
CRecursivePolyCoeffsEnumerator::IsValid
virtual bool IsValid() const
Current position is inside the collection (not -1 or past the end).
Definition PolyEnumerator.h:168
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]

template<class ConverterPolicy>

virtual IPolyCoeffsEnumerator::const_reference CRecursivePolyCoeffsEnumerator< ConverterPolicy >::Current | ( |  | ) | const

inline virtual

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

Implements IAccessor< T >.

Definition at line 215 of file PolyEnumerator.h.

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

## IsValid()

template<class ConverterPolicy>

virtual bool CRecursivePolyCoeffsEnumerator< ConverterPolicy >::IsValid | ( |  | ) | const

inline protected virtual

Current position is inside the collection (not -1 or past the end).

Implements IBaseEnumerator.

Definition at line 168 of file PolyEnumerator.h.

{
return m_global_enumerator.IsValid() && m_local_enumerator.IsValid();
}

## MoveNext()

template<class ConverterPolicy>

virtual bool CRecursivePolyCoeffsEnumerator< ConverterPolicy >::MoveNext | ( |  | ) |

inline virtual

Advances the enumerator to the next element of the collection. returns true if the enumerator was successfully advanced to the next element; false if the enumerator has passed the end of the collection.

Implements IBaseEnumerator.

Definition at line 179 of file PolyEnumerator.h.

{
if( m_local_enumerator.MoveNext() )
return true;
if( !m_global_enumerator.MoveNext() ) // at the end of the main input polynomial?
return false;
// TODO: make the following changeable (metaprogramming: use policy?),
// leave the following as default option...
poly p = ConverterPolicy::convert(m_global_enumerator.Current()); // Assumes that these numbers are just polynomials!
assume( p != NULL );
// the following actually needs CPolyCoeffsEnumerator
m_local_enumerator.Reset( p ); // -1 position in p :: to be skipped now!
if( m_local_enumerator.MoveNext() ) // should be true
return true;
assume( FALSE ); return MoveNext(); // this should not happen as p should be non-zero, but just in case...
}
CRecursivePolyCoeffsEnumerator::MoveNext
virtual bool MoveNext()
Advances the enumerator to the next element of the collection. returns true if the enumerator was suc...
Definition PolyEnumerator.h:179

## Reset()

template<class ConverterPolicy>

virtual void CRecursivePolyCoeffsEnumerator< ConverterPolicy >::Reset | ( |  | ) |

inline virtual

Sets the enumerator to its initial position: -1, which is before the first element in the collection.

Implements IBaseEnumerator.

Definition at line 201 of file PolyEnumerator.h.

{
m_global_enumerator.Reset();
m_local_enumerator.Reset(NULL);
}

## Field Documentation

## m_global_enumerator

template<class ConverterPolicy>

IPolyCoeffsEnumerator& CRecursivePolyCoeffsEnumerator< ConverterPolicy >::m_global_enumerator

private

iterates the input polynomial

Definition at line 164 of file PolyEnumerator.h.

## m_local_enumerator

template<class ConverterPolicy>

CBasePolyEnumerator CRecursivePolyCoeffsEnumerator< ConverterPolicy >::m_local_enumerator

private

iterates the current coeff. of m_global_enumerator

Definition at line 165 of file PolyEnumerator.h.

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

- libpolys/polys/PolyEnumerator.h