My Project  UNKNOWN_GIT_VERSION
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Friends
Variable Class Reference

factory's class for variables More...

#include <factory.h>

Public Member Functions

 Variable ()
 
 Variable (int l)
 
 Variable (char name)
 
 Variable (int l, char name)
 
 Variable (const Variable &v)
 
 ~Variable ()
 
Variableoperator= (const Variable &v)
 
int level () const
 
char name () const
 
Variable next () const
 
 Variable ()
 
 Variable (int l)
 
 Variable (char name)
 
 Variable (int l, char name)
 
 Variable (const Variable &v)
 
 ~Variable ()
 
Variableoperator= (const Variable &v)
 
int level () const
 
char name () const
 
Variable next () const
 
 Variable ()
 
 Variable (int l)
 
 Variable (char name)
 
 Variable (int l, char name)
 
 Variable (const Variable &v)
 
 ~Variable ()
 
Variableoperator= (const Variable &v)
 
int level () const
 
char name () const
 
Variable next () const
 

Static Public Member Functions

static Variable highest ()
 
static Variable highest ()
 
static Variable highest ()
 

Private Member Functions

 Variable (int l, bool flag)
 
 Variable (int l, bool flag)
 
 Variable (int l, bool flag)
 

Private Attributes

int _level
 

Friends

bool operator== (const Variable &lhs, const Variable &rhs)
 
bool operator!= (const Variable &lhs, const Variable &rhs)
 
bool operator> (const Variable &lhs, const Variable &rhs)
 
bool operator< (const Variable &lhs, const Variable &rhs)
 
bool operator>= (const Variable &lhs, const Variable &rhs)
 
bool operator<= (const Variable &lhs, const Variable &rhs)
 
OSTREAMoperator<< (OSTREAM &os, const Variable &v)
 
void swap_levels ()
 
Variable rootOf (const CanonicalForm &, char name)
 returns a symbolic root of polynomial with name name. More...
 
bool operator== (const Variable &lhs, const Variable &rhs)
 
bool operator!= (const Variable &lhs, const Variable &rhs)
 
bool operator> (const Variable &lhs, const Variable &rhs)
 
bool operator< (const Variable &lhs, const Variable &rhs)
 
bool operator>= (const Variable &lhs, const Variable &rhs)
 
bool operator<= (const Variable &lhs, const Variable &rhs)
 
OSTREAMoperator<< (OSTREAM &os, const Variable &v)
 
void swap_levels ()
 
Variable rootOf (const CanonicalForm &, char name)
 returns a symbolic root of polynomial with name name. More...
 
bool operator== (const Variable &lhs, const Variable &rhs)
 
bool operator!= (const Variable &lhs, const Variable &rhs)
 
bool operator> (const Variable &lhs, const Variable &rhs)
 
bool operator< (const Variable &lhs, const Variable &rhs)
 
bool operator>= (const Variable &lhs, const Variable &rhs)
 
bool operator<= (const Variable &lhs, const Variable &rhs)
 
OSTREAMoperator<< (OSTREAM &os, const Variable &v)
 
void swap_levels ()
 
Variable rootOf (const CanonicalForm &, char name)
 returns a symbolic root of polynomial with name name. More...
 

Detailed Description

factory's class for variables

Definition at line 117 of file factory.h.

Constructor & Destructor Documentation

◆ Variable() [1/18]

Variable::Variable ( int  l,
bool  flag 
)
private

Definition at line 47 of file variable.cc.

47  : _level(l)
48 {
49  ASSERT( flag, "illegal level" );
50 }
int _level
Definition: factory.h:120
#define ASSERT(expression, message)
Definition: cf_assert.h:99
int l
Definition: cfEzgcd.cc:93

◆ Variable() [2/18]

Variable::Variable ( )
inline

Definition at line 123 of file factory.h.

123 : _level(LEVELBASE) {}
#define LEVELBASE
Definition: factory.h:80
int _level
Definition: factory.h:120

◆ Variable() [3/18]

Variable::Variable ( int  l)

Definition at line 52 of file variable.cc.

52  : _level(l)
53 {
54  //ASSERT( l > 0 && l != LEVELQUOT, "illegal level" );
55 }
int _level
Definition: factory.h:120
int l
Definition: cfEzgcd.cc:93

◆ Variable() [4/18]

Variable::Variable ( char  name)

Definition at line 57 of file variable.cc.

58 {
59  bool isext = false;
60  int n, i;
61  if ( var_names_ext != 0 ) {
62  n = strlen( var_names_ext );
63  i = 1;
64  while ( i < n && var_names_ext[i] != name ) i++;
65  if ( i < n ) {
66  _level = -i;
67  isext = true;
68  }
69  }
70  if ( ! isext ) {
71  if ( var_names == 0 ) {
72  var_names = new char [3];
73  var_names[0] = '@';
74  var_names[1] = name;
75  var_names[2] = '\0';
76  _level = 1;
77  }
78  else {
79  n = strlen( var_names );
80  i = 1;
81  while ( i < n && var_names[i] != name ) i++;
82  if ( i < n )
83  _level = i;
84  else {
85  ASSERT( name != '@', "illegal variable name" );
86  char * newvarnames = new char [n+2];
87  for ( i = 0; i < n; i++ )
88  newvarnames[i] = var_names[i];
89  newvarnames[n] = name;
90  newvarnames[n+1] = 0;
91  delete [] var_names;
92  var_names = newvarnames;
93  _level = n;
94  }
95  }
96  }
97 }
static char * var_names_ext
Definition: variable.cc:43
int _level
Definition: factory.h:120
int i
Definition: cfEzgcd.cc:125
char name() const
Definition: variable.cc:122
#define ASSERT(expression, message)
Definition: cf_assert.h:99
static char * var_names
Definition: variable.cc:42

◆ Variable() [5/18]

Variable::Variable ( int  l,
char  name 
)

Definition at line 99 of file variable.cc.

99  : _level(l)
100 {
101  ASSERT( l > 0 && l != LEVELQUOT, "illegal level" );
102  int n;
103  if ( (n = (var_names == 0 ? 0 : strlen( var_names ))) <= l ) {
104  char * newvarnames = new char [l+2];
105  int i;
106  for ( i = 0; i < n; i++ )
107  newvarnames[i] = var_names[i];
108  for ( i = n; i < l; i++ )
109  newvarnames[i] = '@';
110  newvarnames[l] = name;
111  newvarnames[l+1] = 0;
112  delete [] var_names;
113  var_names = newvarnames;
114  }
115  else {
116  ASSERT( var_names[l] == '@', "illegal name" );
117  var_names[l] = name;
118  }
119 }
int _level
Definition: factory.h:120
#define LEVELQUOT
Definition: cf_defs.h:18
int i
Definition: cfEzgcd.cc:125
char name() const
Definition: variable.cc:122
#define ASSERT(expression, message)
Definition: cf_assert.h:99
static char * var_names
Definition: variable.cc:42
int l
Definition: cfEzgcd.cc:93

◆ Variable() [6/18]

Variable::Variable ( const Variable v)
inline

Definition at line 127 of file factory.h.

127 : _level(v._level) {}
int _level
Definition: factory.h:120
const Variable & v
< [in] a sqrfree bivariate poly
Definition: facBivar.h:37

◆ ~Variable() [1/3]

Variable::~Variable ( )
inline

Definition at line 128 of file factory.h.

128 {};

◆ Variable() [7/18]

Variable::Variable ( int  l,
bool  flag 
)
private

◆ Variable() [8/18]

Variable::Variable ( )
inline

Definition at line 123 of file factory.h.

123 : _level(LEVELBASE) {}
int _level
Definition: factory.h:120
#define LEVELBASE
Definition: factory.h:80

◆ Variable() [9/18]

Variable::Variable ( int  l)

◆ Variable() [10/18]

Variable::Variable ( char  name)

◆ Variable() [11/18]

Variable::Variable ( int  l,
char  name 
)

◆ Variable() [12/18]

Variable::Variable ( const Variable v)
inline

Definition at line 127 of file factory.h.

127 : _level(v._level) {}
int _level
Definition: factory.h:120
const Variable & v
< [in] a sqrfree bivariate poly
Definition: facBivar.h:37

◆ ~Variable() [2/3]

Variable::~Variable ( )
inline

Definition at line 128 of file factory.h.

128 {};

◆ Variable() [13/18]

Variable::Variable ( int  l,
bool  flag 
)
private

◆ Variable() [14/18]

Variable::Variable ( )
inline

Definition at line 38 of file variable.h.

38 : _level(LEVELBASE) {}
#define LEVELBASE
Definition: cf_defs.h:16
int _level
Definition: factory.h:120

◆ Variable() [15/18]

Variable::Variable ( int  l)

◆ Variable() [16/18]

Variable::Variable ( char  name)

◆ Variable() [17/18]

Variable::Variable ( int  l,
char  name 
)

◆ Variable() [18/18]

Variable::Variable ( const Variable v)
inline

Definition at line 42 of file variable.h.

42 : _level(v._level) {}
int _level
Definition: factory.h:120
const Variable & v
< [in] a sqrfree bivariate poly
Definition: facBivar.h:37

◆ ~Variable() [3/3]

Variable::~Variable ( )
inline

Definition at line 43 of file variable.h.

43 {};

Member Function Documentation

◆ highest() [1/3]

static Variable Variable::highest ( )
inlinestatic

Definition at line 51 of file variable.h.

51 { return Variable( LEVELQUOT-1 ); }
#define LEVELQUOT
Definition: cf_defs.h:18
Variable()
Definition: factory.h:123

◆ highest() [2/3]

static Variable Variable::highest ( )
inlinestatic

Definition at line 136 of file factory.h.

136 { return Variable( LEVELQUOT-1 ); }
Variable()
Definition: factory.h:123
#define LEVELQUOT
Definition: factory.h:82

◆ highest() [3/3]

static Variable Variable::highest ( )
inlinestatic

Definition at line 136 of file factory.h.

136 { return Variable( LEVELQUOT-1 ); }
#define LEVELQUOT
Definition: factory.h:82
Variable()
Definition: factory.h:123

◆ level() [1/3]

int Variable::level ( ) const
inline

Definition at line 49 of file variable.h.

49 { return _level; }
int _level
Definition: factory.h:120

◆ level() [2/3]

int Variable::level ( ) const
inline

Definition at line 134 of file factory.h.

134 { return _level; }
int _level
Definition: factory.h:120

◆ level() [3/3]

int Variable::level ( ) const
inline

Definition at line 134 of file factory.h.

134 { return _level; }
int _level
Definition: factory.h:120

◆ name() [1/3]

char Variable::name ( ) const

◆ name() [2/3]

char Variable::name ( ) const

◆ name() [3/3]

char Variable::name ( ) const

Definition at line 122 of file variable.cc.

123 {
124  if ( _level > 0 && _level < (int)strlen( var_names ) )
125  return( var_names[_level] );
126  else if ( _level < 0 && -_level < (int)strlen( var_names_ext ) )
127  return( var_names_ext[-_level] );
128  else
129  return '@';
130 }
static char * var_names_ext
Definition: variable.cc:43
int _level
Definition: factory.h:120
static char * var_names
Definition: variable.cc:42

◆ next() [1/3]

Variable Variable::next ( ) const
inline

Definition at line 52 of file variable.h.

52 { return Variable( _level+1 ); }
int _level
Definition: factory.h:120
Variable()
Definition: factory.h:123

◆ next() [2/3]

Variable Variable::next ( ) const
inline

Definition at line 137 of file factory.h.

137 { return Variable( _level+1 ); }
int _level
Definition: factory.h:120
Variable()
Definition: factory.h:123

◆ next() [3/3]

Variable Variable::next ( ) const
inline

Definition at line 137 of file factory.h.

137 { return Variable( _level+1 ); }
int _level
Definition: factory.h:120
Variable()
Definition: factory.h:123

◆ operator=() [1/3]

Variable& Variable::operator= ( const Variable v)
inline

Definition at line 44 of file variable.h.

45  {
46  _level = v._level;
47  return *this;
48  }
int _level
Definition: factory.h:120
const Variable & v
< [in] a sqrfree bivariate poly
Definition: facBivar.h:37

◆ operator=() [2/3]

Variable& Variable::operator= ( const Variable v)
inline

Definition at line 129 of file factory.h.

130  {
131  _level = v._level;
132  return *this;
133  }
int _level
Definition: factory.h:120
const Variable & v
< [in] a sqrfree bivariate poly
Definition: facBivar.h:37

◆ operator=() [3/3]

Variable& Variable::operator= ( const Variable v)
inline

Definition at line 129 of file factory.h.

130  {
131  _level = v._level;
132  return *this;
133  }
int _level
Definition: factory.h:120
const Variable & v
< [in] a sqrfree bivariate poly
Definition: facBivar.h:37

Friends And Related Function Documentation

◆ operator!= [1/3]

bool operator!= ( const Variable lhs,
const Variable rhs 
)
friend

Definition at line 57 of file variable.h.

58  {
59  return lhs._level != rhs._level;
60  }
int _level
Definition: factory.h:120

◆ operator!= [2/3]

bool operator!= ( const Variable lhs,
const Variable rhs 
)
friend

Definition at line 142 of file factory.h.

143  {
144  return lhs._level != rhs._level;
145  }
int _level
Definition: factory.h:120

◆ operator!= [3/3]

bool operator!= ( const Variable lhs,
const Variable rhs 
)
friend

Definition at line 142 of file factory.h.

143  {
144  return lhs._level != rhs._level;
145  }
int _level
Definition: factory.h:120

◆ operator< [1/3]

bool operator< ( const Variable lhs,
const Variable rhs 
)
friend

Definition at line 65 of file variable.h.

66  {
67  return lhs._level < rhs._level;
68  }
int _level
Definition: factory.h:120

◆ operator< [2/3]

bool operator< ( const Variable lhs,
const Variable rhs 
)
friend

Definition at line 150 of file factory.h.

151  {
152  return lhs._level < rhs._level;
153  }
int _level
Definition: factory.h:120

◆ operator< [3/3]

bool operator< ( const Variable lhs,
const Variable rhs 
)
friend

Definition at line 150 of file factory.h.

151  {
152  return lhs._level < rhs._level;
153  }
int _level
Definition: factory.h:120

◆ operator<< [1/3]

OSTREAM& operator<< ( OSTREAM os,
const Variable v 
)
friend

Definition at line 133 of file variable.cc.

134 {
135  if ( v._level == LEVELBASE )
136  os << "1";
137  else {
138  char * vn = ( v._level > 0 ) ? var_names : var_names_ext;
139  char dn = ( v._level > 0 ) ? default_name : default_name_ext;
140  int l = v._level;
141 
142  if ( l < 0 ) l = -l;
143  if ( (vn == 0) || ((int)strlen( vn ) <= l) )
144  os << dn << "_" << l;
145  else if ( vn[l] == '@' )
146  os << dn << "_" << l;
147  else
148  os << vn[l];
149  }
150  return os;
151 }
static char * var_names_ext
Definition: variable.cc:43
#define LEVELBASE
Definition: cf_defs.h:16
static char default_name
Definition: variable.cc:44
static char default_name_ext
Definition: variable.cc:45
int _level
Definition: factory.h:120
const Variable & v
< [in] a sqrfree bivariate poly
Definition: facBivar.h:37
static char * var_names
Definition: variable.cc:42
int l
Definition: cfEzgcd.cc:93

◆ operator<< [2/3]

OSTREAM& operator<< ( OSTREAM os,
const Variable v 
)
friend

Definition at line 133 of file variable.cc.

134 {
135  if ( v._level == LEVELBASE )
136  os << "1";
137  else {
138  char * vn = ( v._level > 0 ) ? var_names : var_names_ext;
139  char dn = ( v._level > 0 ) ? default_name : default_name_ext;
140  int l = v._level;
141 
142  if ( l < 0 ) l = -l;
143  if ( (vn == 0) || ((int)strlen( vn ) <= l) )
144  os << dn << "_" << l;
145  else if ( vn[l] == '@' )
146  os << dn << "_" << l;
147  else
148  os << vn[l];
149  }
150  return os;
151 }
static char * var_names_ext
Definition: variable.cc:43
#define LEVELBASE
Definition: cf_defs.h:16
static char default_name
Definition: variable.cc:44
static char default_name_ext
Definition: variable.cc:45
int _level
Definition: factory.h:120
const Variable & v
< [in] a sqrfree bivariate poly
Definition: facBivar.h:37
static char * var_names
Definition: variable.cc:42
int l
Definition: cfEzgcd.cc:93

◆ operator<< [3/3]

OSTREAM& operator<< ( OSTREAM os,
const Variable v 
)
friend

Definition at line 133 of file variable.cc.

134 {
135  if ( v._level == LEVELBASE )
136  os << "1";
137  else {
138  char * vn = ( v._level > 0 ) ? var_names : var_names_ext;
139  char dn = ( v._level > 0 ) ? default_name : default_name_ext;
140  int l = v._level;
141 
142  if ( l < 0 ) l = -l;
143  if ( (vn == 0) || ((int)strlen( vn ) <= l) )
144  os << dn << "_" << l;
145  else if ( vn[l] == '@' )
146  os << dn << "_" << l;
147  else
148  os << vn[l];
149  }
150  return os;
151 }
static char * var_names_ext
Definition: variable.cc:43
#define LEVELBASE
Definition: cf_defs.h:16
static char default_name
Definition: variable.cc:44
static char default_name_ext
Definition: variable.cc:45
int _level
Definition: factory.h:120
const Variable & v
< [in] a sqrfree bivariate poly
Definition: facBivar.h:37
static char * var_names
Definition: variable.cc:42
int l
Definition: cfEzgcd.cc:93

◆ operator<= [1/3]

bool operator<= ( const Variable lhs,
const Variable rhs 
)
friend

Definition at line 73 of file variable.h.

74  {
75  return lhs._level <= rhs._level;
76  }
int _level
Definition: factory.h:120

◆ operator<= [2/3]

bool operator<= ( const Variable lhs,
const Variable rhs 
)
friend

Definition at line 158 of file factory.h.

159  {
160  return lhs._level <= rhs._level;
161  }
int _level
Definition: factory.h:120

◆ operator<= [3/3]

bool operator<= ( const Variable lhs,
const Variable rhs 
)
friend

Definition at line 158 of file factory.h.

159  {
160  return lhs._level <= rhs._level;
161  }
int _level
Definition: factory.h:120

◆ operator== [1/3]

bool operator== ( const Variable lhs,
const Variable rhs 
)
friend

Definition at line 53 of file variable.h.

54  {
55  return lhs._level == rhs._level;
56  }
int _level
Definition: factory.h:120

◆ operator== [2/3]

bool operator== ( const Variable lhs,
const Variable rhs 
)
friend

Definition at line 138 of file factory.h.

139  {
140  return lhs._level == rhs._level;
141  }
int _level
Definition: factory.h:120

◆ operator== [3/3]

bool operator== ( const Variable lhs,
const Variable rhs 
)
friend

Definition at line 138 of file factory.h.

139  {
140  return lhs._level == rhs._level;
141  }
int _level
Definition: factory.h:120

◆ operator> [1/3]

bool operator> ( const Variable lhs,
const Variable rhs 
)
friend

Definition at line 61 of file variable.h.

62  {
63  return lhs._level > rhs._level;
64  }
int _level
Definition: factory.h:120

◆ operator> [2/3]

bool operator> ( const Variable lhs,
const Variable rhs 
)
friend

Definition at line 146 of file factory.h.

147  {
148  return lhs._level > rhs._level;
149  }
int _level
Definition: factory.h:120

◆ operator> [3/3]

bool operator> ( const Variable lhs,
const Variable rhs 
)
friend

Definition at line 146 of file factory.h.

147  {
148  return lhs._level > rhs._level;
149  }
int _level
Definition: factory.h:120

◆ operator>= [1/3]

bool operator>= ( const Variable lhs,
const Variable rhs 
)
friend

Definition at line 69 of file variable.h.

70  {
71  return lhs._level >= rhs._level;
72  }
int _level
Definition: factory.h:120

◆ operator>= [2/3]

bool operator>= ( const Variable lhs,
const Variable rhs 
)
friend

Definition at line 154 of file factory.h.

155  {
156  return lhs._level >= rhs._level;
157  }
int _level
Definition: factory.h:120

◆ operator>= [3/3]

bool operator>= ( const Variable lhs,
const Variable rhs 
)
friend

Definition at line 154 of file factory.h.

155  {
156  return lhs._level >= rhs._level;
157  }
int _level
Definition: factory.h:120

◆ rootOf [1/3]

Variable rootOf ( const CanonicalForm ,
char  name 
)
friend

returns a symbolic root of polynomial with name name.

Use it to define algebraic variables

Note
: algebraic variables have a level < 0

returns a symbolic root of polynomial with name name.

Note
: algebraic variables have a level < 0

Use it to define algebraic variables

Note
: algebraic variables have a level < 0
: algebraic variables have a level < 0

Definition at line 162 of file variable.cc.

163 {
164  ASSERT (mipo.isUnivariate(), "not a legal extension");
165 
166  int l;
167  if ( var_names_ext == 0 ) {
168  var_names_ext = new char [3];
169  var_names_ext[0] = '@';
170  var_names_ext[1] = name;
171  var_names_ext[2] = '\0';
172  l = 1;
173  Variable result( -l, true );
174  algextensions = new ext_entry [2];
175  algextensions[1] = ext_entry( 0, false );
176  algextensions[1] = ext_entry( (InternalPoly*)(conv2mipo( mipo, result ).getval()), true );
177  return result;
178  }
179  else {
180  int i, n = strlen( var_names_ext );
181  char * newvarnames = new char [n+2];
182  for ( i = 0; i < n; i++ )
183  newvarnames[i] = var_names_ext[i];
184  newvarnames[n] = name;
185  newvarnames[n+1] = 0;
186  delete [] var_names_ext;
187  var_names_ext = newvarnames;
188  l = n;
189  Variable result( -l, true );
190  ext_entry * newalgext = new ext_entry [n+1];
191  for ( i = 0; i < n; i++ )
192  newalgext[i] = algextensions[i];
193  newalgext[n] = ext_entry( 0, false );
194  delete [] algextensions;
195  algextensions = newalgext;
196  algextensions[n] = ext_entry( (InternalPoly*)(conv2mipo( mipo, result ).getval()), true );
197  return result;
198  }
199 }
static char * var_names_ext
Definition: variable.cc:43
factory's class for variables
Definition: factory.h:117
Definition: variable.cc:18
bool isUnivariate() const
factory's class for polynomials
Definition: int_poly.h:71
int i
Definition: cfEzgcd.cc:125
static CanonicalForm conv2mipo(const CanonicalForm &mipo, const Variable &alpha)
Definition: variable.cc:154
char name() const
Definition: variable.cc:122
CanonicalForm mipo
Definition: facAlgExt.cc:57
static ext_entry * algextensions
Definition: variable.cc:41
#define ASSERT(expression, message)
Definition: cf_assert.h:99
return result
Definition: facAbsBiFact.cc:76
int l
Definition: cfEzgcd.cc:93

◆ rootOf [2/3]

Variable rootOf ( const CanonicalForm ,
char  name 
)
friend

returns a symbolic root of polynomial with name name.

Use it to define algebraic variables

Note
: algebraic variables have a level < 0
: algebraic variables have a level < 0

Definition at line 162 of file variable.cc.

163 {
164  ASSERT (mipo.isUnivariate(), "not a legal extension");
165 
166  int l;
167  if ( var_names_ext == 0 ) {
168  var_names_ext = new char [3];
169  var_names_ext[0] = '@';
170  var_names_ext[1] = name;
171  var_names_ext[2] = '\0';
172  l = 1;
173  Variable result( -l, true );
174  algextensions = new ext_entry [2];
175  algextensions[1] = ext_entry( 0, false );
176  algextensions[1] = ext_entry( (InternalPoly*)(conv2mipo( mipo, result ).getval()), true );
177  return result;
178  }
179  else {
180  int i, n = strlen( var_names_ext );
181  char * newvarnames = new char [n+2];
182  for ( i = 0; i < n; i++ )
183  newvarnames[i] = var_names_ext[i];
184  newvarnames[n] = name;
185  newvarnames[n+1] = 0;
186  delete [] var_names_ext;
187  var_names_ext = newvarnames;
188  l = n;
189  Variable result( -l, true );
190  ext_entry * newalgext = new ext_entry [n+1];
191  for ( i = 0; i < n; i++ )
192  newalgext[i] = algextensions[i];
193  newalgext[n] = ext_entry( 0, false );
194  delete [] algextensions;
195  algextensions = newalgext;
196  algextensions[n] = ext_entry( (InternalPoly*)(conv2mipo( mipo, result ).getval()), true );
197  return result;
198  }
199 }
static char * var_names_ext
Definition: variable.cc:43
factory's class for variables
Definition: factory.h:117
Definition: variable.cc:18
bool isUnivariate() const
factory's class for polynomials
Definition: int_poly.h:71
int i
Definition: cfEzgcd.cc:125
static CanonicalForm conv2mipo(const CanonicalForm &mipo, const Variable &alpha)
Definition: variable.cc:154
char name() const
Definition: variable.cc:122
CanonicalForm mipo
Definition: facAlgExt.cc:57
static ext_entry * algextensions
Definition: variable.cc:41
#define ASSERT(expression, message)
Definition: cf_assert.h:99
return result
Definition: facAbsBiFact.cc:76
int l
Definition: cfEzgcd.cc:93

◆ rootOf [3/3]

Variable rootOf ( const CanonicalForm ,
char  name 
)
friend

returns a symbolic root of polynomial with name name.

Use it to define algebraic variables

Note
: algebraic variables have a level < 0

returns a symbolic root of polynomial with name name.

Note
: algebraic variables have a level < 0

Use it to define algebraic variables

Note
: algebraic variables have a level < 0
: algebraic variables have a level < 0

Definition at line 162 of file variable.cc.

163 {
164  ASSERT (mipo.isUnivariate(), "not a legal extension");
165 
166  int l;
167  if ( var_names_ext == 0 ) {
168  var_names_ext = new char [3];
169  var_names_ext[0] = '@';
170  var_names_ext[1] = name;
171  var_names_ext[2] = '\0';
172  l = 1;
173  Variable result( -l, true );
174  algextensions = new ext_entry [2];
175  algextensions[1] = ext_entry( 0, false );
176  algextensions[1] = ext_entry( (InternalPoly*)(conv2mipo( mipo, result ).getval()), true );
177  return result;
178  }
179  else {
180  int i, n = strlen( var_names_ext );
181  char * newvarnames = new char [n+2];
182  for ( i = 0; i < n; i++ )
183  newvarnames[i] = var_names_ext[i];
184  newvarnames[n] = name;
185  newvarnames[n+1] = 0;
186  delete [] var_names_ext;
187  var_names_ext = newvarnames;
188  l = n;
189  Variable result( -l, true );
190  ext_entry * newalgext = new ext_entry [n+1];
191  for ( i = 0; i < n; i++ )
192  newalgext[i] = algextensions[i];
193  newalgext[n] = ext_entry( 0, false );
194  delete [] algextensions;
195  algextensions = newalgext;
196  algextensions[n] = ext_entry( (InternalPoly*)(conv2mipo( mipo, result ).getval()), true );
197  return result;
198  }
199 }
static char * var_names_ext
Definition: variable.cc:43
factory's class for variables
Definition: factory.h:117
Definition: variable.cc:18
bool isUnivariate() const
factory's class for polynomials
Definition: int_poly.h:71
int i
Definition: cfEzgcd.cc:125
static CanonicalForm conv2mipo(const CanonicalForm &mipo, const Variable &alpha)
Definition: variable.cc:154
char name() const
Definition: variable.cc:122
CanonicalForm mipo
Definition: facAlgExt.cc:57
static ext_entry * algextensions
Definition: variable.cc:41
#define ASSERT(expression, message)
Definition: cf_assert.h:99
return result
Definition: facAbsBiFact.cc:76
int l
Definition: cfEzgcd.cc:93

◆ swap_levels [1/3]

void swap_levels ( )
friend

◆ swap_levels [2/3]

void swap_levels ( )
friend

◆ swap_levels [3/3]

void swap_levels ( )
friend

Field Documentation

◆ _level

int Variable::_level
private

Definition at line 120 of file factory.h.


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