My Project  UNKNOWN_GIT_VERSION
Functions | Variables
cf_ops.cc File Reference
#include "config.h"
#include "cf_assert.h"
#include "canonicalform.h"
#include "variable.h"
#include "cf_iter.h"

Go to the source code of this file.

Functions

static void swapvar_between (const CanonicalForm &f, CanonicalForm &result, const CanonicalForm &term, int expx2)
 static void swapvar_between ( const CanonicalForm & f, CanonicalForm & result, const CanonicalForm & term, int expx2 ) More...
 
static void swapvar_rec (const CanonicalForm &f, CanonicalForm &result, const CanonicalForm &term)
 swapvar_between() - swap occurences of sv_x1 and sv_x2 in f. More...
 
CanonicalForm swapvar (const CanonicalForm &f, const Variable &x1, const Variable &x2)
 swapvar() - swap variables x1 and x2 in f. More...
 
static CanonicalForm replacevar_between (const CanonicalForm &f)
 replacevar_between() - replace occurences of sv_x1 in f with sv_x2. More...
 
CanonicalForm replacevar (const CanonicalForm &f, const Variable &x1, const Variable &x2)
 CanonicalForm replacevar ( const CanonicalForm & f, const Variable & x1, const Variable & x2 ) More...
 
static void fillVarsRec (const CanonicalForm &f, int *vars)
 static void fillVarsRec ( const CanonicalForm & f, int * vars ) More...
 
int getNumVars (const CanonicalForm &f)
 int getNumVars ( const CanonicalForm & f ) More...
 
CanonicalForm getVars (const CanonicalForm &f)
 CanonicalForm getVars ( const CanonicalForm & f ) More...
 
CanonicalForm apply (const CanonicalForm &f, void(*mf)(CanonicalForm &, int &))
 CanonicalForm apply ( const CanonicalForm & f, void (*mf)( CanonicalForm &, int & ) ) More...
 
CanonicalForm mapdomain (const CanonicalForm &f, CanonicalForm(*mf)(const CanonicalForm &))
 CanonicalForm mapdomain ( const CanonicalForm & f, CanonicalForm (*mf)( const CanonicalForm & ) ) More...
 
static void degreesRec (const CanonicalForm &f, int *degs)
 static void degreesRec ( const CanonicalForm & f, int * degs ) More...
 
int * degrees (const CanonicalForm &f, int *degs)
 int * degrees ( const CanonicalForm & f, int * degs ) More...
 
int totaldegree (const CanonicalForm &f)
 int totaldegree ( const CanonicalForm & f ) More...
 
int totaldegree (const CanonicalForm &f, const Variable &v1, const Variable &v2)
 int totaldegree ( const CanonicalForm & f, const Variable & v1, const Variable & v2 ) More...
 
int size (const CanonicalForm &f, const Variable &v)
 int size ( const CanonicalForm & f, const Variable & v ) More...
 
int size (const CanonicalForm &f)
 int size ( const CanonicalForm & f ) More...
 
CanonicalForm reduce (const CanonicalForm &f, const CanonicalForm &M)
 polynomials in M.mvar() are considered coefficients M univariate monic polynomial the coefficients of f are reduced modulo M More...
 
bool hasFirstAlgVar (const CanonicalForm &f, Variable &a)
 check if poly f contains an algebraic variable a More...
 
CanonicalForm leftShift (const CanonicalForm &F, int n)
 left shift the main variable of F by n More...
 

Variables

static Variable sv_x1
 static Variable sv_x1, sv_x2; More...
 
static Variable sv_x2
 

Detailed Description

simple structural algorithms.

A 'structural' algorithm is an algorithm which gives structural information on polynomials in contrast to a 'mathematical' algorithm which calculates some mathematical function.

Compare these functions with the functions in cf_algorithm.cc, which are mathematical algorithms.

Header file: canonicalform.h

Definition in file cf_ops.cc.

Function Documentation

◆ apply()

CanonicalForm apply ( const CanonicalForm f,
void(*)(CanonicalForm &, int &)  mf 
)

CanonicalForm apply ( const CanonicalForm & f, void (*mf)( CanonicalForm &, int & ) )

apply() - apply mf to terms of f.

Calls mf( f[i], i ) for each term f[i]*x^i of f and builds a new term from the result. If f is in a coefficient domain, mf( f, i ) should result in an i == 0, since otherwise it is not clear which variable to use for the resulting term.

An example:

void
diff( CanonicalForm & f, int & i )
{
f = f * i;
if ( i > 0 ) i--;
}

Then apply( f, diff ) is differentation of f with respect to the main variable of f.

Definition at line 402 of file cf_ops.cc.

403 {
404  if ( f.inCoeffDomain() )
405  {
406  int exp = 0;
408  mf( result, exp );
409  ASSERT( exp == 0, "illegal result, do not know what variable to use" );
410  return result;
411  }
412  else
413  {
414  CanonicalForm result, coeff;
415  CFIterator i;
416  int exp;
417  Variable x = f.mvar();
418  for ( i = f; i.hasTerms(); i++ )
419  {
420  coeff = i.coeff();
421  exp = i.exp();
422  mf( coeff, exp );
423  if ( ! coeff.isZero() )
424  result += power( x, exp ) * coeff;
425  }
426  return result;
427  }
428 }

◆ degrees()

int* degrees ( const CanonicalForm f,
int *  degs 
)

int * degrees ( const CanonicalForm & f, int * degs )

degress() - return the degrees of all polynomial variables in f.

Returns 0 if f is in a coefficient domain, the degrees of f in all its polynomial variables in an array of int otherwise:

degrees( f, 0 )[i] = degree( f, Variable(i) )

If degs is not the zero pointer the degrees are stored in this array. In this case degs should be larger than the level of f. If degs is the zero pointer, an array of sufficient size is allocated automatically.

Definition at line 493 of file cf_ops.cc.

494 {
495  if ( f.inCoeffDomain() )
496  {
497  if (degs != 0)
498  return degs;
499  else
500  return 0;
501  }
502  else
503  {
504  int level = f.level();
505  if ( degs == NULL )
506  degs = NEW_ARRAY(int,level+1);
507  for ( int i = level; i >= 0; i-- )
508  degs[i] = 0;
509  degreesRec( f, degs );
510  return degs;
511  }
512 }

◆ degreesRec()

static void degreesRec ( const CanonicalForm f,
int *  degs 
)
static

static void degreesRec ( const CanonicalForm & f, int * degs )

degreesRec() - recursively get degrees of f.

Used by degrees().

Definition at line 463 of file cf_ops.cc.

464 {
465  if ( ! f.inCoeffDomain() )
466  {
467  int level = f.level();
468  int deg = f.degree();
469  // calculate the maximum degree of all coefficients which
470  // are in the same level
471  if ( degs[level] < deg )
472  degs[level] = f.degree();
473  for ( CFIterator i = f; i.hasTerms(); i++ )
474  degreesRec( i.coeff(), degs );
475  }
476 }

◆ fillVarsRec()

static void fillVarsRec ( const CanonicalForm f,
int *  vars 
)
static

static void fillVarsRec ( const CanonicalForm & f, int * vars )

fillVarsRec - fill array describing occurences of variables in f.

Only polynomial variables are looked up. The information is stored in the arrary vars. vars should be large enough to hold all information, i.e. larger than the level of f.

Used by getVars() and getNumVars().

Definition at line 296 of file cf_ops.cc.

297 {
298  int n;
299  if ( (n = f.level()) > 0 )
300  {
301  vars[n] = 1;
302  CFIterator i;
303  for ( i = f; i.hasTerms(); ++i )
304  fillVarsRec( i.coeff(), vars );
305  }
306 }

◆ getNumVars()

int getNumVars ( const CanonicalForm f)

int getNumVars ( const CanonicalForm & f )

getNumVars() - get number of polynomial variables in f.

Definition at line 314 of file cf_ops.cc.

315 {
316  int n;
317  if ( f.inCoeffDomain() )
318  return 0;
319  else if ( (n = f.level()) == 1 )
320  return 1;
321  else
322  {
323  int * vars = NEW_ARRAY(int, n+1);
324  int i;
325  for ( i = n-1; i >=0; i-- ) vars[i] = 0;
326 
327  // look for variables
328  for ( CFIterator I = f; I.hasTerms(); ++I )
329  fillVarsRec( I.coeff(), vars );
330 
331  // count them
332  int m = 0;
333  for ( i = 1; i < n; i++ )
334  if ( vars[i] != 0 ) m++;
335 
336  DELETE_ARRAY(vars);
337  // do not forget to count our own variable
338  return m+1;
339  }
340 }

◆ getVars()

CanonicalForm getVars ( const CanonicalForm f)

CanonicalForm getVars ( const CanonicalForm & f )

getVars() - get polynomial variables of f.

Return the product of all of them, 1 if there are not any.

Definition at line 350 of file cf_ops.cc.

351 {
352  int n;
353  if ( f.inCoeffDomain() )
354  return 1;
355  else if ( (n = f.level()) == 1 )
356  return Variable( 1 );
357  else
358  {
359  int * vars = NEW_ARRAY(int, n+1);
360  int i;
361  for ( i = n; i >= 0; i-- ) vars[i] = 0;
362 
363  // look for variables
364  for ( CFIterator I = f; I.hasTerms(); ++I )
365  fillVarsRec( I.coeff(), vars );
366 
367  // multiply them all
368  CanonicalForm result = 1;
369  for ( i = n; i > 0; i-- )
370  if ( vars[i] != 0 ) result *= Variable( i );
371 
372  DELETE_ARRAY(vars);
373  // do not forget our own variable
374  return f.mvar() * result;
375  }
376 }

◆ hasFirstAlgVar()

bool hasFirstAlgVar ( const CanonicalForm f,
Variable a 
)

check if poly f contains an algebraic variable a

Definition at line 665 of file cf_ops.cc.

666 {
667  if( f.inBaseDomain() ) // f has NO alg. variable
668  return false;
669  if( f.level()<0 ) // f has only alg. vars, so take the first one
670  {
671  a = f.mvar();
672  return true;
673  }
674  for(CFIterator i=f; i.hasTerms(); i++)
675  if( hasFirstAlgVar( i.coeff(), a ))
676  return true; // 'a' is already set
677  return false;
678 }

◆ leftShift()

CanonicalForm leftShift ( const CanonicalForm F,
int  n 
)

left shift the main variable of F by n

Returns
if x is the main variable of F the result is F(x^n)

Definition at line 683 of file cf_ops.cc.

684 {
685  ASSERT (n >= 0, "cannot left shift by negative number");
686  if (F.inBaseDomain())
687  return F;
688  if (n == 0)
689  return F;
690  Variable x=F.mvar();
692  for (CFIterator i= F; i.hasTerms(); i++)
693  result += i.coeff()*power (x, i.exp()*n);
694  return result;
695 }

◆ mapdomain()

CanonicalForm mapdomain ( const CanonicalForm & f, CanonicalForm (*mf)( const CanonicalForm & ) )

mapdomain() - map all coefficients of f through mf.

Recursively descends down through f to the coefficients which are in a coefficient domain mapping each such coefficient through mf and returns the result.

Definition at line 440 of file cf_ops.cc.

441 {
442  if ( f.inBaseDomain() )
443  return mf( f );
444  else
445  {
446  CanonicalForm result = 0;
447  CFIterator i;
448  Variable x = f.mvar();
449  for ( i = f; i.hasTerms(); i++ )
450  result += power( x, i.exp() ) * mapdomain( i.coeff(), mf );
451  return result;
452  }
453 }

◆ reduce()

polynomials in M.mvar() are considered coefficients M univariate monic polynomial the coefficients of f are reduced modulo M

Definition at line 646 of file cf_ops.cc.

647 {
648  if(f.inBaseDomain() || f.level() < M.level())
649  return f;
650  if(f.level() == M.level())
651  {
652  if(f.degree() < M.degree())
653  return f;
654  CanonicalForm tmp = mod (f, M);
655  return tmp;
656  }
657  // here: f.level() > M.level()
658  CanonicalForm result = 0;
659  for(CFIterator i=f; i.hasTerms(); i++)
660  result += reduce(i.coeff(),M) * power(f.mvar(),i.exp());
661  return result;
662 }

◆ replacevar()

CanonicalForm replacevar ( const CanonicalForm f,
const Variable x1,
const Variable x2 
)

CanonicalForm replacevar ( const CanonicalForm & f, const Variable & x1, const Variable & x2 )

replacevar() - replace all occurences of x1 in f by x2.

In contrast to swapvar(), x1 may be an algebraic variable, but x2 must be a polynomial variable.

Definition at line 271 of file cf_ops.cc.

272 {
273  //ASSERT( x2.level() > 0, "cannot replace with algebraic variable" );
274  if ( f.inBaseDomain() || x1 == x2 || ( x1 > f.mvar() ) )
275  return f;
276  else
277  {
278  sv_x1 = x1;
279  sv_x2 = x2;
280  return replacevar_between( f );
281  }
282 }

◆ replacevar_between()

static CanonicalForm replacevar_between ( const CanonicalForm f)
static

replacevar_between() - replace occurences of sv_x1 in f with sv_x2.

This is allmost the same as swapvar_between() except that sv_x1 may be an algebraic variable, so we have to test on 'f.inBaseDomain()' instead of 'f.inCoeffDomain()' in the beginning.

Used by: replacevar()

Definition at line 233 of file cf_ops.cc.

234 {
235  if ( f.inBaseDomain() )
236  return f;
237 
238  Variable x = f.mvar();
239 
240  if ( x < sv_x1 )
241  // in this case, we do not have to replace anything
242  return f;
243  else if ( x == sv_x1 )
244  {
245  // this is where the real work is done: this iterator
246  // replaces sv_x1 with sv_x2
248  for ( CFIterator i = f; i.hasTerms(); i++ )
249  result += power( sv_x2, i.exp() ) * i.coeff();
250  return result;
251  }
252  else
253  {
254  // f's level is larger than sv_x1: descend down
256  for ( CFIterator i = f; i.hasTerms(); i++ )
257  result += replacevar_between( i.coeff() ) * power( x, i.exp() );
258  return result;
259  }
260 }

◆ size() [1/2]

int size ( const CanonicalForm f)

int size ( const CanonicalForm & f )

size() - return number of monomials in f which are in an coefficient domain.

Returns one if f is in an coefficient domain.

Definition at line 628 of file cf_ops.cc.

629 {
630  if ( f.inCoeffDomain() )
631  return 1;
632  else
633  {
634  int result = 0;
635  CFIterator i;
636  for ( i = f; i.hasTerms(); i++ )
637  result += size( i.coeff() );
638  return result;
639  }
640 }

◆ size() [2/2]

int size ( const CanonicalForm f,
const Variable v 
)

int size ( const CanonicalForm & f, const Variable & v )

size() - count number of monomials of f with level higher or equal than level of v.

Returns one if f is in an base domain.

Definition at line 600 of file cf_ops.cc.

601 {
602  if ( f.inBaseDomain() )
603  return 1;
604 
605  if ( f.mvar() < v )
606  // polynomials with level < v1 are counted as coefficients
607  return 1;
608  else
609  {
610  CFIterator i;
611  int result = 0;
612  // polynomials with level > v2 are not counted al all
613  for ( i = f; i.hasTerms(); i++ )
614  result += size( i.coeff(), v );
615  return result;
616  }
617 }

◆ swapvar()

CanonicalForm swapvar ( const CanonicalForm f,
const Variable x1,
const Variable x2 
)

swapvar() - swap variables x1 and x2 in f.

Returns the image of f under the map which maps x1 to x2 and x2 to x1. This is done quite efficiently because it is used really often. x1 and x2 should be polynomial variables.

Definition at line 168 of file cf_ops.cc.

169 {
170  ASSERT( x1.level() > 0 && x2.level() > 0, "cannot swap algebraic Variables" );
171  if ( f.inCoeffDomain() || x1 == x2 || ( x1 > f.mvar() && x2 > f.mvar() ) )
172  return f;
173  else
174  {
175  CanonicalForm result = 0;
176  if ( x1 > x2 )
177  {
178  sv_x1 = x2; sv_x2 = x1;
179  }
180  else
181  {
182  sv_x1 = x1; sv_x2 = x2;
183  }
184  if ( f.mvar() < sv_x2 )
185  // we only have to replace sv_x1 by sv_x2
186  swapvar_between( f, result, 1, 0 );
187  else
188  // we really have to swap variables
189  swapvar_rec( f, result, 1 );
190  return result;
191  }
192 }

◆ swapvar_between()

static void swapvar_between ( const CanonicalForm f,
CanonicalForm result,
const CanonicalForm term,
int  expx2 
)
static

static void swapvar_between ( const CanonicalForm & f, CanonicalForm & result, const CanonicalForm & term, int expx2 )

swapvar_between() - replace occurences of sv_x1 in f with sv_x2.

If Psi denotes the map which maps sv_x1 to sv_x2, this function returns

result + Psi(f) * term * sv_x1^expx2

Used by: swapvar()

Definition at line 58 of file cf_ops.cc.

59 {
60  if ( f.inCoeffDomain() || f.mvar() < sv_x1 )
61  // in this case, we do not have to replace anything
62  result += term * power( sv_x1, expx2 ) * f;
63  else if ( f.mvar() == sv_x1 )
64  // this is where the real work is done: this iterator
65  // replaces sv_x1 with sv_x2
66  for ( CFIterator i = f; i.hasTerms(); i++ )
67  result += power( sv_x2, i.exp() ) * term * power( sv_x1, expx2 ) * i.coeff();
68  else
69  // f's level is larger than sv_x1: descend down
70  for ( CFIterator i = f; i.hasTerms(); i++ )
71  swapvar_between( i.coeff(), result, term * power( f.mvar(), i.exp() ), expx2 );
72 }

◆ swapvar_rec()

static void swapvar_rec ( const CanonicalForm f,
CanonicalForm result,
const CanonicalForm term 
)
static

swapvar_between() - swap occurences of sv_x1 and sv_x2 in f.

If Psi denotes the map which swaps sv_x1 and sv_x2, this function returns

result + Psi(f) * term

Used by: swapvar()

Definition at line 113 of file cf_ops.cc.

114 {
115  if ( f.inCoeffDomain() || f.mvar() < sv_x1 )
116  // in this case, we do not have to swap anything
117  result += term * f;
118  else if ( f.mvar() == sv_x2 )
119  // this is where the real work is done: this iterator
120  // replaces sv_x1 with sv_x2 in the coefficients of f and
121  // remembers the exponents of sv_x2 in the last argument
122  // of the call to swapvar_between()
123  for ( CFIterator i = f; i.hasTerms(); i++ )
124  swapvar_between( i.coeff(), result, term, i.exp() );
125  else if ( f.mvar() < sv_x2 )
126  // sv_x2 does not occur in f, but sv_x1 does. Replace it.
127  swapvar_between( f, result, term, 0 );
128  else
129  // f's level is larger than sv_x2: descend down
130  for ( CFIterator i = f; i.hasTerms(); i++ )
131  swapvar_rec( i.coeff(), result, term * power( f.mvar(), i.exp() ) );
132 }

◆ totaldegree() [1/2]

int totaldegree ( const CanonicalForm f)

int totaldegree ( const CanonicalForm & f )

totaldegree() - return the total degree of f.

If f is zero, return -1. If f is in a coefficient domain, return 0. Otherwise return the total degree of f in all polynomial variables.

Definition at line 523 of file cf_ops.cc.

524 {
525  if ( f.isZero() )
526  return -1;
527  else if ( f.inCoeffDomain() )
528  return 0;
529  else
530  {
531  CFIterator i;
532  int cdeg = 0, dummy;
533  // calculate maximum over all coefficients of f, taking
534  // in account our own exponent
535  for ( i = f; i.hasTerms(); i++ )
536  if ( (dummy = totaldegree( i.coeff() ) + i.exp()) > cdeg )
537  cdeg = dummy;
538  return cdeg;
539  }
540 }

◆ totaldegree() [2/2]

int totaldegree ( const CanonicalForm f,
const Variable v1,
const Variable v2 
)

int totaldegree ( const CanonicalForm & f, const Variable & v1, const Variable & v2 )

totaldegree() - return the total degree of f as a polynomial in the polynomial variables between v1 and v2 (inclusively).

If f is zero, return -1. If f is in a coefficient domain, return 0. Also, return 0 if v1 > v2. Otherwise, take f to be a polynomial in the polynomial variables between v1 and v2 and return its total degree.

Definition at line 554 of file cf_ops.cc.

555 {
556  if ( f.isZero() )
557  return -1;
558  else if ( v1 > v2 )
559  return 0;
560  else if ( f.inCoeffDomain() )
561  return 0;
562  else if ( f.mvar() < v1 )
563  return 0;
564  else if ( f.mvar() == v1 )
565  return f.degree();
566  else if ( f.mvar() > v2 )
567  {
568  // v2's level is larger than f's level, descend down
569  CFIterator i;
570  int cdeg = 0, dummy;
571  // calculate maximum over all coefficients of f
572  for ( i = f; i.hasTerms(); i++ )
573  if ( (dummy = totaldegree( i.coeff(), v1, v2 )) > cdeg )
574  cdeg = dummy;
575  return cdeg;
576  }
577  else
578  {
579  // v1 < f.mvar() <= v2
580  CFIterator i;
581  int cdeg = 0, dummy;
582  // calculate maximum over all coefficients of f, taking
583  // in account our own exponent
584  for ( i = f; i.hasTerms(); i++ )
585  if ( (dummy = totaldegree( i.coeff(), v1, v2 ) + i.exp()) > cdeg )
586  cdeg = dummy;
587  return cdeg;
588  }
589 }

Variable Documentation

◆ sv_x1

Variable sv_x1
static

static Variable sv_x1, sv_x2;

sv_x1, sv_x2 - variables to swap by swapvar() and replacevar.

These variables are initialized by swapvar() such that sv_x1 < sv_x2. They are used by swapvar_between() and swapvar_rec() to swap variables efficiently. Furthermore, sv_x1 and sv_x2 are used by replacevar() and replacevar_between().

Definition at line 43 of file cf_ops.cc.

◆ sv_x2

Variable sv_x2
static

Definition at line 43 of file cf_ops.cc.

f
FILE * f
Definition: checklibs.c:9
CFIterator
class to iterate through CanonicalForm's
Definition: cf_iter.h:44
x
Variable x
Definition: cfModGcd.cc:4023
hasFirstAlgVar
bool hasFirstAlgVar(const CanonicalForm &f, Variable &a)
check if poly f contains an algebraic variable a
Definition: cf_ops.cc:665
diff
static gmp_float * diff
Definition: mpr_complex.cc:45
result
return result
Definition: facAbsBiFact.cc:76
CanonicalForm::inBaseDomain
bool inBaseDomain() const
Definition: canonicalform.cc:101
swapvar_rec
static void swapvar_rec(const CanonicalForm &f, CanonicalForm &result, const CanonicalForm &term)
swapvar_between() - swap occurences of sv_x1 and sv_x2 in f.
Definition: cf_ops.cc:113
DELETE_ARRAY
#define DELETE_ARRAY(P)
Definition: cf_defs.h:49
power
CanonicalForm power(const CanonicalForm &f, int n)
exponentiation
Definition: canonicalform.cc:1837
level
int level(const CanonicalForm &f)
Definition: canonicalform.h:324
mod
CF_NO_INLINE CanonicalForm mod(const CanonicalForm &, const CanonicalForm &)
Definition: cf_inline.cc:564
CanonicalForm
factory's main class
Definition: canonicalform.h:77
term
Definition: int_poly.h:33
fillVarsRec
static void fillVarsRec(const CanonicalForm &f, int *vars)
static void fillVarsRec ( const CanonicalForm & f, int * vars )
Definition: cf_ops.cc:296
i
int i
Definition: cfEzgcd.cc:125
ASSERT
#define ASSERT(expression, message)
Definition: cf_assert.h:99
M
#define M
Definition: sirandom.c:24
degreesRec
static void degreesRec(const CanonicalForm &f, int *degs)
static void degreesRec ( const CanonicalForm & f, int * degs )
Definition: cf_ops.cc:463
Variable::level
int level() const
Definition: factory.h:134
sv_x2
static Variable sv_x2
Definition: cf_ops.cc:43
exp
gmp_float exp(const gmp_float &a)
Definition: mpr_complex.cc:357
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
m
int m
Definition: cfEzgcd.cc:121
NULL
#define NULL
Definition: omList.c:9
v
const Variable & v
< [in] a sqrfree bivariate poly
Definition: facBivar.h:37
swapvar_between
static void swapvar_between(const CanonicalForm &f, CanonicalForm &result, const CanonicalForm &term, int expx2)
static void swapvar_between ( const CanonicalForm & f, CanonicalForm & result, const CanonicalForm & ...
Definition: cf_ops.cc:58
totaldegree
int totaldegree(const CanonicalForm &f)
int totaldegree ( const CanonicalForm & f )
Definition: cf_ops.cc:523
CanonicalForm::isZero
CF_NO_INLINE bool isZero() const
Definition: cf_inline.cc:372
mapdomain
CanonicalForm mapdomain(const CanonicalForm &f, CanonicalForm(*mf)(const CanonicalForm &))
CanonicalForm mapdomain ( const CanonicalForm & f, CanonicalForm (*mf)( const CanonicalForm & ) )
Definition: cf_ops.cc:440
size
int size(const CanonicalForm &f, const Variable &v)
int size ( const CanonicalForm & f, const Variable & v )
Definition: cf_ops.cc:600
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:646
replacevar_between
static CanonicalForm replacevar_between(const CanonicalForm &f)
replacevar_between() - replace occurences of sv_x1 in f with sv_x2.
Definition: cf_ops.cc:233
NEW_ARRAY
#define NEW_ARRAY(T, N)
Definition: cf_defs.h:48
sv_x1
static Variable sv_x1
static Variable sv_x1, sv_x2;
Definition: cf_ops.cc:43