Loading...
Searching...
No Matches
variable.h File Reference

operations on variables More...

`#include <iostream>`
`#include "cf_defs.h"`

Go to the source code of this file.

## Data Structures

class | Variable
| factory's class for variables More...

## Macros

#define | OSTREAM std::ostream

## Functions

Variable FACTORY_PUBLIC | rootOf (const CanonicalForm &mipo, char name='@')
| returns a symbolic root of polynomial with name name Use it to define algebraic variables
int | level (const Variable &v)
char | name (const Variable &v)
void | setReduce (const Variable &alpha, bool reduce)
void | setMipo (const Variable &alpha, const CanonicalForm &mipo)
CanonicalForm | getMipo (const Variable &alpha, const Variable &x)
bool | hasMipo (const Variable &alpha)
char | getDefaultVarName ()
char | getDefaultExtName ()
void FACTORY_PUBLIC | prune (Variable &alpha)
void | prune1 (const Variable &alpha)
int | ExtensionLevel ()
CanonicalForm | getMipo (const Variable &alpha)
InternalPoly * | getInternalMipo (const Variable &alpha)
bool | getReduce (const Variable &alpha)

## Detailed Description

operations on variables

Definition in file variable.h.

## Macro Definition Documentation

## OSTREAM

#define OSTREAM std::ostream

Definition at line 16 of file variable.h.

## Function Documentation

## ExtensionLevel()

int ExtensionLevel | ( |  | ) |

Definition at line 254 of file variable.cc.

{
if( var_names_ext == 0)
return 0;
return strlen( var_names_ext )-1;
}
var_names_ext
STATIC_VAR char * var_names_ext
Definition variable.cc:43

## getDefaultExtName()

char getDefaultExtName | ( |  | ) |

Definition at line 249 of file variable.cc.

{
return default_name_ext;
}
default_name_ext
STATIC_VAR char default_name_ext
Definition variable.cc:45

## getDefaultVarName()

char getDefaultVarName | ( |  | ) |

Definition at line 244 of file variable.cc.

{
return default_name;
}
default_name
STATIC_VAR char default_name
Definition variable.cc:44

## getInternalMipo()

InternalPoly * getInternalMipo | ( | const Variable & | alpha | ) |

Definition at line 201 of file variable.cc.

{
ASSERT( alpha.level() < 0 && alpha.level() != LEVELBASE, "illegal extension" );
return algextensions[-alpha.level()].mipo();
}
ASSERT
#define ASSERT(expression, message)
Definition cf_assert.h:99
LEVELBASE
#define LEVELBASE
Definition cf_defs.h:25
alpha
Variable alpha
Definition facAbsBiFact.cc:52
algextensions
STATIC_VAR ext_entry * algextensions
Definition variable.cc:41

## getMipo() [1/2]

CanonicalForm getMipo | ( | const Variable & | alpha | ) |

Definition at line 213 of file variable.cc.

{
ASSERT( alpha.level() < 0 && alpha.level() != LEVELBASE, "illegal extension" );
return CanonicalForm( algextensions[-alpha.level()].mipo()->copyObject() );
}
CanonicalForm
factory's main class
Definition canonicalform.h:86

## getMipo() [2/2]

CanonicalForm getMipo | ( | const Variable & | alpha,
|  | const Variable & | x )

Definition at line 207 of file variable.cc.

{
ASSERT( alpha.level() < 0 && alpha.level() != LEVELBASE, "illegal extension" );
return CanonicalForm( algextensions[-alpha.level()].mipo()->copyObject() )(x,alpha);
}
x
Variable x
Definition cfModGcd.cc:4090

## getReduce()

bool getReduce | ( | const Variable & | alpha | ) |

Definition at line 232 of file variable.cc.

{
ASSERT( alpha.level() < 0 && alpha.level() != LEVELBASE, "illegal extension" );
return algextensions[-alpha.level()].reduce();
}

## hasMipo()

bool hasMipo | ( | const Variable & | alpha | ) |

Definition at line 226 of file variable.cc.

{
ASSERT( alpha.level() < 0, "illegal extension" );
return (alpha.level() != LEVELBASE && (algextensions!=NULL) && getReduce(alpha) );
}
NULL
#define NULL
Definition omList.c:12
getReduce
bool getReduce(const Variable &alpha)
Definition variable.cc:232

## level()

int level | ( | const Variable & | v | ) |

inline

Definition at line 94 of file variable.h.

{ return v.level(); }
v
const Variable & v
< [in] a sqrfree bivariate poly
Definition facBivar.h:39

## name()

char name | ( | const Variable & | v | ) |

inline

Definition at line 95 of file variable.h.

{ return v.name(); }

## prune()

void FACTORY_PUBLIC prune | ( | Variable & | alpha | ) |

Definition at line 261 of file variable.cc.

{
if (alpha.level()==LEVELBASE) return;
int last_var=-alpha.level();
if ((last_var <= 0)||(var_names_ext==NULL)) return;
int i, n = strlen( var_names_ext );
ASSERT (n+1 >= last_var, "wrong variable");
if (last_var == 1)
{
delete [] var_names_ext;
delete [] algextensions;
var_names_ext= 0;
algextensions= 0;
alpha= Variable();
return;
}
char * newvarnames = new char [last_var+1];
for ( i = 0; i < last_var; i++ )
newvarnames[i] = var_names_ext[i];
newvarnames[last_var] = 0;
delete [] var_names_ext;
var_names_ext = newvarnames;
ext_entry * newalgext = new ext_entry [last_var];
for ( i = 0; i < last_var; i++ )
newalgext[i] = algextensions[i];
delete [] algextensions;
algextensions = newalgext;
alpha= Variable();
}
i
int i
Definition cfEzgcd.cc:132
Variable
factory's class for variables
Definition factory.h:127
ext_entry
Definition variable.cc:19

## prune1()

void prune1 | ( | const Variable & | alpha | ) |

Definition at line 291 of file variable.cc.

{
int i, n = strlen( var_names_ext );
ASSERT (n+1 >= -alpha.level(), "wrong variable");
char * newvarnames = new char [-alpha.level() + 2];
for ( i = 0; i <= -alpha.level(); i++ )
newvarnames[i] = var_names_ext[i];
newvarnames[-alpha.level()+1] = 0;
delete [] var_names_ext;
var_names_ext = newvarnames;
ext_entry * newalgext = new ext_entry [-alpha.level()+1];
for ( i = 0; i <= -alpha.level(); i++ )
newalgext[i] = algextensions[i];
delete [] algextensions;
algextensions = newalgext;
}

## rootOf()

Variable FACTORY_PUBLIC rootOf | ( | const CanonicalForm & | mipo,
|  | char | name = '@' )

returns a symbolic root of polynomial with name name Use it to define algebraic variables

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 179 of file variable.cc.

{
ASSERT (mipo.isUnivariate(), "not a legal extension");
int l;
if ( var_names_ext == 0 ) {
var_names_ext = new char [3];
var_names_ext[0] = '@';
var_names_ext[1] = name;
var_names_ext[2] = '\0';
l = 1;
Variable result( -l, true );
algextensions = new ext_entry [2];
algextensions[1] = ext_entry( 0, false );
algextensions[1] = ext_entry( (InternalPoly*)(conv2mipo( mipo, result ).getval()), true );
return result;
}
else {
int i, n = strlen( var_names_ext );
char * newvarnames = new char [n+2];
for ( i = 0; i < n; i++ )
newvarnames[i] = var_names_ext[i];
newvarnames[n] = name;
newvarnames[n+1] = 0;
delete [] var_names_ext;
var_names_ext = newvarnames;
l = n;
Variable result( -l, true );
ext_entry * newalgext = new ext_entry [n+1];
for ( i = 0; i < n; i++ )
newalgext[i] = algextensions[i];
newalgext[n] = ext_entry( 0, false );
delete [] algextensions;
algextensions = newalgext;
algextensions[n] = ext_entry( (InternalPoly*)(conv2mipo( mipo, result ).getval()), true );
return result;
}
}
l
int l
Definition cfEzgcd.cc:100
InternalPoly
factory's class for polynomials
Definition int_poly.h:71
result
return result
Definition facAbsBiFact.cc:76
mipo
CanonicalForm mipo
Definition facAlgExt.cc:57
name
char name(const Variable &v)
Definition factory.h:189
conv2mipo
static CanonicalForm conv2mipo(const CanonicalForm &mipo, const Variable &alpha)
Definition variable.cc:154

## setMipo()

void setMipo | ( | const Variable & | alpha,
|  | const CanonicalForm & | mipo )

Definition at line 219 of file variable.cc.

{
ASSERT( alpha.level() < 0 && alpha.level() != LEVELBASE, "illegal extension" );
algextensions[-alpha.level()]= ext_entry( 0, false );
algextensions[-alpha.level()]= ext_entry((InternalPoly*)(conv2mipo( mipo, alpha ).getval()), true );
}

## setReduce()

void setReduce | ( | const Variable & | alpha,
|  | bool | reduce )

Definition at line 238 of file variable.cc.

{
ASSERT( alpha.level() < 0 && alpha.level() != LEVELBASE, "illegal extension" );
algextensions[-alpha.level()].reduce() = reduce;
}
reduce
CanonicalForm reduce(const CanonicalForm &f, const CanonicalForm &M)
polynomials in M.mvar() are considered coefficients M univariate monic polynomial the coefficients of...
Definition cf_ops.cc:660