My Project  debian-1:4.1.1-p2+ds-4build2
cf_iter.cc
Go to the documentation of this file.
1 /* emacs edit mode for this file is -*- C++ -*- */
2 
3 
4 #include "config.h"
5 
6 
7 #include "cf_assert.h"
8 
9 #include "cf_defs.h"
10 #include "cf_iter.h"
11 #include "int_cf.h"
12 #include "int_poly.h"
13 
14 
16 {
17  data = 0; cursor = 0;
18  ispoly = false; hasterms = false;
19 }
20 
22 {
23  data = i.data;
24  cursor = i.cursor;
25  ispoly = i.ispoly;
26  hasterms = i.hasterms;
27 }
28 
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 }
43 
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 }
82 
84 {
85  data = 0; cursor = 0;
86 }
87 
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 }
100 
101 CFIterator&
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 }
f
FILE * f
Definition: checklibs.c:9
CFIterator
class to iterate through CanonicalForm's
Definition: cf_iter.h:44
CFIterator::~CFIterator
~CFIterator()
Definition: cf_iter.cc:83
CFIterator::data
CanonicalForm data
Definition: cf_iter.h:46
CFIterator::hasterms
bool hasterms
Definition: cf_iter.h:48
CFIterator::CFIterator
CFIterator()
Definition: cf_iter.cc:15
CanonicalForm
factory's main class
Definition: canonicalform.h:77
CanonicalForm::value
InternalCF * value
Definition: canonicalform.h:85
i
int i
Definition: cfEzgcd.cc:125
swapvar
CanonicalForm swapvar(const CanonicalForm &, const Variable &, const Variable &)
swapvar() - swap variables x1 and x2 in f.
Definition: cf_ops.cc:168
ASSERT
#define ASSERT(expression, message)
Definition: cf_assert.h:99
cf_defs.h
int_cf.h
InternalPoly
factory's class for polynomials
Definition: int_poly.h:71
cf_iter.h
Variable::level
int level() const
Definition: factory.h:134
CFIterator::cursor
termList cursor
Definition: cf_iter.h:47
Variable
factory's class for variables
Definition: factory.h:117
CanonicalForm::mvar
Variable mvar() const
mvar() returns the main variable of CO or Variable() if CO is in a base domain.
Definition: canonicalform.cc:560
int_poly.h
cf_assert.h
v
const Variable & v
< [in] a sqrfree bivariate poly
Definition: facBivar.h:37
CFIterator::ispoly
bool ispoly
Definition: cf_iter.h:48
CFIterator::operator=
CFIterator & operator=(const CFIterator &)
Definition: cf_iter.cc:89