My Project
Public Member Functions | Private Attributes
CFIterator Class Reference

class to iterate through CanonicalForm's More...

#include <cf_iter.h>

Public Member Functions

 CFIterator ()
 
 CFIterator (const CFIterator &)
 
 CFIterator (const CanonicalForm &)
 
 CFIterator (const CanonicalForm &, const Variable &)
 
 ~CFIterator ()
 
CFIteratoroperator= (const CFIterator &)
 
CFIteratoroperator= (const CanonicalForm &)
 
CF_NO_INLINE CFIteratoroperator++ ()
 
CF_NO_INLINE CFIteratoroperator++ (int)
 
CF_NO_INLINE int hasTerms () const
 check if iterator has reached the end of CanonicalForm More...
 
CF_NO_INLINE CanonicalForm coeff () const
 get the current coefficient More...
 
CF_NO_INLINE int exp () const
 get the current exponent More...
 
 CFIterator ()
 
 CFIterator (const CFIterator &)
 
 CFIterator (const CanonicalForm &)
 
 CFIterator (const CanonicalForm &, const Variable &)
 
 ~CFIterator ()
 
CFIteratoroperator= (const CFIterator &)
 
CFIteratoroperator= (const CanonicalForm &)
 
CF_NO_INLINE CFIteratoroperator++ ()
 
CF_NO_INLINE CFIteratoroperator++ (int)
 
CF_NO_INLINE int hasTerms () const
 check if iterator has reached the end of CanonicalForm More...
 
CF_NO_INLINE CanonicalForm coeff () const
 get the current coefficient More...
 
CF_NO_INLINE int exp () const
 get the current exponent More...
 
 CFIterator ()
 
 CFIterator (const CFIterator &)
 
 CFIterator (const CanonicalForm &)
 
 CFIterator (const CanonicalForm &, const Variable &)
 
 ~CFIterator ()
 
CFIteratoroperator= (const CFIterator &)
 
CFIteratoroperator= (const CanonicalForm &)
 
CF_NO_INLINE CFIteratoroperator++ ()
 
CF_NO_INLINE CFIteratoroperator++ (int)
 
CF_NO_INLINE int hasTerms () const
 check if iterator has reached the end of CanonicalForm More...
 
CF_NO_INLINE CanonicalForm coeff () const
 get the current coefficient More...
 
CF_NO_INLINE int exp () const
 get the current exponent More...
 

Private Attributes

CanonicalForm data
 
termList cursor
 
bool ispoly
 
bool hasterms
 

Detailed Description

class to iterate through CanonicalForm's

Note
a (multivariate) polynomial is viewed as a univariate poly in its main variable

Definition at line 44 of file cf_iter.h.

Constructor & Destructor Documentation

◆ CFIterator() [1/12]

CFIterator::CFIterator ( )

Definition at line 15 of file cf_iter.cc.

16{
17 data = 0; cursor = 0;
18 ispoly = false; hasterms = false;
19}
bool ispoly
Definition: cf_iter.h:48
CanonicalForm data
Definition: cf_iter.h:46
termList cursor
Definition: cf_iter.h:47
bool hasterms
Definition: cf_iter.h:48

◆ CFIterator() [2/12]

CFIterator::CFIterator ( const CFIterator i)

Definition at line 21 of file cf_iter.cc.

22{
23 data = i.data;
24 cursor = i.cursor;
25 ispoly = i.ispoly;
26 hasterms = i.hasterms;
27}
int i
Definition: cfEzgcd.cc:132

◆ CFIterator() [3/12]

CFIterator::CFIterator ( const CanonicalForm f)

Definition at line 29 of file cf_iter.cc.

30{
31 if ( f.inBaseDomain() || f.inQuotDomain() )
32 {
33 data = f; cursor = 0;
34 ispoly = false; hasterms = true;
35 }
36 else
37 {
38 data = f;
39 cursor = ((InternalPoly*)(f.value))->firstTerm;
40 ispoly = true; hasterms = true;
41 }
42}
FILE * f
Definition: checklibs.c:9
factory's class for polynomials
Definition: int_poly.h:71

◆ CFIterator() [4/12]

CFIterator::CFIterator ( const CanonicalForm f,
const Variable v 
)

Definition at line 44 of file cf_iter.cc.

45{
46 ASSERT( !f.inQuotDomain(), "illegal iterator" );
47 ASSERT( v.level() > 0, "illegal iterator" );
48 if ( f.inBaseDomain() )
49 {
50 data = f; cursor = 0;
51 ispoly = false; hasterms = true;
52 }
53 else
54 {
55 if ( f.mvar() == v )
56 {
57 data = f;
58 cursor = ((InternalPoly*)(f.value))->firstTerm;
59 ispoly = true; hasterms = true;
60 }
61 else if ( v > f.mvar() )
62 {
63 data = f; cursor = 0;
64 ispoly = false; hasterms = true;
65 }
66 else
67 {
68 data = swapvar( f, v, f.mvar().next() );
69 if ( data.mvar() == f.mvar().next() )
70 {
71 cursor = ((InternalPoly*)(data.value))->firstTerm;
72 ispoly = true; hasterms = true;
73 }
74 else
75 {
76 cursor = 0;
77 ispoly = false; hasterms = true;
78 }
79 }
80 }
81}
CanonicalForm FACTORY_PUBLIC swapvar(const CanonicalForm &, const Variable &, const Variable &)
swapvar() - swap variables x1 and x2 in f.
Definition: cf_ops.cc:168
#define ASSERT(expression, message)
Definition: cf_assert.h:99
InternalCF * value
Definition: canonicalform.h:88
Variable mvar() const
mvar() returns the main variable of CO or Variable() if CO is in a base domain.
int level() const
Definition: factory.h:143
const Variable & v
< [in] a sqrfree bivariate poly
Definition: facBivar.h:39

◆ ~CFIterator() [1/3]

CFIterator::~CFIterator ( )

Definition at line 83 of file cf_iter.cc.

84{
85 data = 0; cursor = 0;
86}

◆ CFIterator() [5/12]

CFIterator::CFIterator ( )

◆ CFIterator() [6/12]

CFIterator::CFIterator ( const CFIterator )

◆ CFIterator() [7/12]

CFIterator::CFIterator ( const CanonicalForm )

◆ CFIterator() [8/12]

CFIterator::CFIterator ( const CanonicalForm ,
const Variable  
)

◆ ~CFIterator() [2/3]

CFIterator::~CFIterator ( )

◆ CFIterator() [9/12]

CFIterator::CFIterator ( )

◆ CFIterator() [10/12]

CFIterator::CFIterator ( const CFIterator )

◆ CFIterator() [11/12]

CFIterator::CFIterator ( const CanonicalForm )

◆ CFIterator() [12/12]

CFIterator::CFIterator ( const CanonicalForm ,
const Variable  
)

◆ ~CFIterator() [3/3]

CFIterator::~CFIterator ( )

Member Function Documentation

◆ coeff() [1/3]

CF_NO_INLINE CanonicalForm CFIterator::coeff ( ) const

get the current coefficient

◆ coeff() [2/3]

CF_NO_INLINE CanonicalForm CFIterator::coeff ( ) const

get the current coefficient

◆ coeff() [3/3]

CF_NO_INLINE CanonicalForm CFIterator::coeff ( ) const

get the current coefficient

◆ exp() [1/3]

CF_NO_INLINE int CFIterator::exp ( ) const

get the current exponent

◆ exp() [2/3]

CF_NO_INLINE int CFIterator::exp ( ) const

get the current exponent

◆ exp() [3/3]

CF_NO_INLINE int CFIterator::exp ( ) const

get the current exponent

◆ hasTerms() [1/3]

CF_NO_INLINE int CFIterator::hasTerms ( ) const

check if iterator has reached the end of CanonicalForm

◆ hasTerms() [2/3]

CF_NO_INLINE int CFIterator::hasTerms ( ) const

check if iterator has reached the end of CanonicalForm

◆ hasTerms() [3/3]

CF_NO_INLINE int CFIterator::hasTerms ( ) const

check if iterator has reached the end of CanonicalForm

◆ operator++() [1/6]

CF_NO_INLINE CFIterator & CFIterator::operator++ ( )

◆ operator++() [2/6]

CF_NO_INLINE CFIterator & CFIterator::operator++ ( )

◆ operator++() [3/6]

CF_NO_INLINE CFIterator & CFIterator::operator++ ( )

◆ operator++() [4/6]

CF_NO_INLINE CFIterator & CFIterator::operator++ ( int  )

◆ operator++() [5/6]

CF_NO_INLINE CFIterator & CFIterator::operator++ ( int  )

◆ operator++() [6/6]

CF_NO_INLINE CFIterator & CFIterator::operator++ ( int  )

◆ operator=() [1/6]

CFIterator & CFIterator::operator= ( const CanonicalForm f)

Definition at line 102 of file cf_iter.cc.

103{
104 if ( f.inBaseDomain() || f.inQuotDomain() )
105 {
106 data = f; cursor = 0;
107 ispoly = false; hasterms = true;
108 }
109 else
110 {
111 data = f;
112 cursor = ((InternalPoly*)(f.value))->firstTerm;
113 ispoly = true; hasterms = true;
114 }
115 return *this;
116}

◆ operator=() [2/6]

CFIterator & CFIterator::operator= ( const CanonicalForm )

◆ operator=() [3/6]

CFIterator & CFIterator::operator= ( const CanonicalForm )

◆ operator=() [4/6]

CFIterator & CFIterator::operator= ( const CFIterator i)

Definition at line 89 of file cf_iter.cc.

90{
91 if ( this != &i )
92 {
93 data = i.data;
94 cursor = i.cursor;
95 ispoly = i.ispoly;
96 hasterms = i.hasterms;
97 }
98 return *this;
99}

◆ operator=() [5/6]

CFIterator & CFIterator::operator= ( const CFIterator )

◆ operator=() [6/6]

CFIterator & CFIterator::operator= ( const CFIterator )

Field Documentation

◆ cursor

termList CFIterator::cursor
private

Definition at line 47 of file cf_iter.h.

◆ data

CanonicalForm CFIterator::data
private

Definition at line 46 of file cf_iter.h.

◆ hasterms

bool CFIterator::hasterms
private

Definition at line 48 of file cf_iter.h.

◆ ispoly

bool CFIterator::ispoly
private

Definition at line 48 of file cf_iter.h.


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