My Project
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Private Attributes
CRecursivePolyCoeffsEnumerator< ConverterPolicy > Class Template Reference

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

#include <PolyEnumerator.h>

Public Member Functions

 CRecursivePolyCoeffsEnumerator (IPolyCoeffsEnumerator &itr)
 NOTE: carefull: don't destruct the input enumerator before doing it with this one... this also changes the original IPolyCoeffsEnumerator& itr! More...
 
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. More...
 
virtual void Reset ()
 Sets the enumerator to its initial position: -1, which is before the first element in the collection. More...
 
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...
 
virtual bool MoveNext ()=0
 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. More...
 
virtual void Reset ()=0
 Sets the enumerator to its initial position: -1, which is before the first element in the collection. More...
 
virtual bool IsValid () const =0
 Current position is inside the collection (not -1 or past the end) More...
 
virtual reference Current ()=0
 Gets the current element in the collection (read and write). More...
 
virtual const_reference Current () const =0
 Gets the current element in the collection (read only). More...
 

Protected Member Functions

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

Private Attributes

IPolyCoeffsEnumeratorm_global_enumerator
 iterates the input polynomial More...
 
CBasePolyEnumerator m_local_enumerator
 iterates the current coeff. of m_global_enumerator More...
 

Additional Inherited Members

- Public Types inherited from IAccessor< T >
typedef T value_type
 
typedef value_typereference
 
typedef const value_typeconst_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: carefull: 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.

IPolyCoeffsEnumerator & m_global_enumerator
iterates the input polynomial
CBasePolyEnumerator m_local_enumerator
iterates the current coeff. of m_global_enumerator
#define NULL
Definition: omList.c:12

Member Function Documentation

◆ Current() [1/2]

template<class ConverterPolicy >
virtual IPolyCoeffsEnumerator::reference CRecursivePolyCoeffsEnumerator< ConverterPolicy >::Current ( )
inlinevirtual

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

Implements IAccessor< T >.

Definition at line 208 of file PolyEnumerator.h.

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

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

Implements IAccessor< T >.

Definition at line 215 of file PolyEnumerator.h.

216 {
217 assume( IsValid() );
219 }

◆ IsValid()

template<class ConverterPolicy >
virtual bool CRecursivePolyCoeffsEnumerator< ConverterPolicy >::IsValid ( ) const
inlineprotectedvirtual

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

Implements IBaseEnumerator.

Definition at line 168 of file PolyEnumerator.h.

169 {
171 }
virtual bool IsValid() const
Current position is inside the collection (not -1 or past the end)
virtual bool IsValid() const =0
Current position is inside the collection (not -1 or past the end)

◆ MoveNext()

template<class ConverterPolicy >
virtual bool CRecursivePolyCoeffsEnumerator< ConverterPolicy >::MoveNext ( )
inlinevirtual

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.

180 {
182 return true;
183
184 if( !m_global_enumerator.MoveNext() ) // at the end of the main input polynomial?
185 return false;
186
187 // TODO: make the following changeable (metaprogramming: use policy?),
188 // leave the following as default option...
189 poly p = ConverterPolicy::convert(m_global_enumerator.Current()); // Assumes that these numbers are just polynomials!
190 assume( p != NULL );
191
192 // the followig actually needs CPolyCoeffsEnumerator
193 m_local_enumerator.Reset( p ); // -1 position in p :: to be skipped now!
194
195 if( m_local_enumerator.MoveNext() ) // should be true
196 return true;
197
198 assume( FALSE ); return MoveNext(); // this should not happen as p should be non-zero, but just in case...
199 }
#define FALSE
Definition: auxiliary.h:96
int p
Definition: cfModGcd.cc:4078
virtual bool MoveNext()
Advances the position to the next term of the polynomial. returns true if the position marker was suc...
void Reset(poly p)
Reset this polynomial Enumerator with a different input polynomial.
virtual bool MoveNext()
Advances the enumerator to the next element of the collection. returns true if the enumerator was suc...
virtual reference Current()=0
Gets the current element in the collection (read and write).
virtual bool MoveNext()=0
Advances the enumerator to the next element of the collection. returns true if the enumerator was suc...

◆ Reset()

template<class ConverterPolicy >
virtual void CRecursivePolyCoeffsEnumerator< ConverterPolicy >::Reset ( )
inlinevirtual

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.

202 {
205 }
virtual void Reset()=0
Sets the enumerator to its initial position: -1, which is before the first element in the collection.

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: