Loading...
Searching...
No Matches
variable.h
Go to the documentation of this file.
/* emacs edit mode for this file is -*- C++ -*- */
/**
* @file variable.h
*
* operations on variables
**/
#ifndef INCL_VARIABLE_H
#define INCL_VARIABLE_H
// #include "config.h"
#ifndef NOSTREAMIO
# ifdef HAVE_IOSTREAM
# include <iostream>
# define OSTREAM std::ostream
# elif defined(HAVE_IOSTREAM_H)
# include <iostream.h>
# define OSTREAM ostream
# endif
#endif /* NOSTREAMIO */
#include "cf_defs.h"
/*BEGINPUBLIC*/
class CanonicalForm;
/**
* factory's class for variables
**/
class FACTORY_PUBLIC Variable
{
private:
int _level;
Variable( int l, bool flag );
public:
Variable() : _level(LEVELBASE) {}
Variable( int l );
Variable( char name );
Variable( int l, char name );
Variable( const Variable & v ) : _level(v._level) {}
~Variable() {};
Variable& operator= ( const Variable & v )
{
_level = v._level;
return *this;
}
int level() const { return _level; }
char name() const;
static Variable highest() { return Variable( LEVELQUOT-1 ); }
Variable next() const { return Variable( _level+1 ); }
friend bool operator == ( const Variable & lhs, const Variable & rhs )
{
return lhs._level == rhs._level;
}
friend bool operator != ( const Variable & lhs, const Variable & rhs )
{
return lhs._level != rhs._level;
}
friend bool operator > ( const Variable & lhs, const Variable & rhs )
{
return lhs._level > rhs._level;
}
friend bool operator < ( const Variable & lhs, const Variable & rhs )
{
return lhs._level < rhs._level;
}
friend bool operator >= ( const Variable & lhs, const Variable & rhs )
{
return lhs._level >= rhs._level;
}
friend bool operator <= ( const Variable & lhs, const Variable & rhs )
{
return lhs._level <= rhs._level;
}
#ifndef NOSTREAMIO
friend OSTREAM & operator << ( OSTREAM & os, const Variable & v );
#endif /* NOSTREAMIO */
friend void swap_levels();
/** returns a symbolic root of polynomial with name @a name.
* Use it to define algebraic variables
* @note: algebraic variables have a level < 0
**/
friend Variable FACTORY_PUBLIC rootOf( const CanonicalForm &, char name );
};
/** returns a symbolic root of polynomial with name @a name
* Use it to define algebraic variables
* @note: algebraic variables have a level < 0
**/
Variable FACTORY_PUBLIC rootOf( const CanonicalForm &, char name = '@' );
inline int level( const Variable & v ) { return v.level(); }
inline char name( const Variable & v ) { return v.name(); }
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();
/*ENDPUBLIC*/
// the following functions do not need to be public available
CanonicalForm getMipo( const Variable & alpha );
class InternalPoly;
InternalPoly * getInternalMipo ( const Variable & alpha );
bool getReduce( const Variable & alpha );
#endif /* ! INCL_VARIABLE_H */
operator!=
bool operator!=(const Rational &a, const Rational &b)
Definition GMPrat.cc:318
operator<
bool operator<(const Rational &a, const Rational &b)
Definition GMPrat.cc:288
operator==
bool operator==(const Rational &a, const Rational &b)
Definition GMPrat.cc:312
operator>
bool operator>(const Rational &a, const Rational &b)
Definition GMPrat.cc:300
operator<=
bool operator<=(const Rational &a, const Rational &b)
Definition GMPrat.cc:294
operator>=
bool operator>=(const Rational &a, const Rational &b)
Definition GMPrat.cc:306
OSTREAM
#define OSTREAM
Definition canonicalform.h:16
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
l
int l
Definition cfEzgcd.cc:100
x
Variable x
Definition cfModGcd.cc:4090
cf_defs.h
factory switches.
LEVELBASE
#define LEVELBASE
Definition cf_defs.h:25
LEVELQUOT
#define LEVELQUOT
Definition cf_defs.h:27
CanonicalForm
factory's main class
Definition canonicalform.h:86
InternalPoly
factory's class for polynomials
Definition int_poly.h:71
Variable
factory's class for variables
Definition factory.h:127
Variable::Variable
Variable(char name)
Variable::Variable
Variable(const Variable &v)
Definition variable.h:42
Variable::Variable
Variable(int l, bool flag)
Variable::Variable
Variable(int l)
Variable::swap_levels
friend void swap_levels()
Variable::Variable
Variable()
Definition variable.h:38
Variable::name
char name() const
Definition variable.cc:122
Variable::level
int level() const
Definition variable.h:49
Variable::next
Variable next() const
Definition variable.h:52
Variable::highest
static Variable highest()
Definition variable.h:51
Variable::~Variable
~Variable()
Definition variable.h:43
Variable::_level
int _level
Definition factory.h:129
Variable::Variable
Variable(int l, char name)
alpha
Variable alpha
Definition facAbsBiFact.cc:52
mipo
CanonicalForm mipo
Definition facAlgExt.cc:57
v
const Variable & v
< [in] a sqrfree bivariate poly
Definition facBivar.h:39
name
char name(const Variable &v)
Definition factory.h:189
rootOf
Variable FACTORY_PUBLIC rootOf(const CanonicalForm &, char name='@')
returns a symbolic root of polynomial with name name Use it to define algebraic variables
Definition variable.cc:162
FACTORY_PUBLIC
#define FACTORY_PUBLIC
Definition globaldefs.h:25
operator<<
ostream & operator<<(ostream &s, const spectrum &spec)
Definition semic.cc:249
setReduce
void setReduce(const Variable &alpha, bool reduce)
Definition variable.cc:238
getReduce
bool getReduce(const Variable &alpha)
Definition variable.cc:232
level
int level(const Variable &v)
Definition variable.h:94
name
char name(const Variable &v)
Definition variable.h:95
getDefaultVarName
char getDefaultVarName()
Definition variable.cc:244
prune1
void prune1(const Variable &alpha)
Definition variable.cc:291
getInternalMipo
InternalPoly * getInternalMipo(const Variable &alpha)
Definition variable.cc:201
ExtensionLevel
int ExtensionLevel()
Definition variable.cc:254
getMipo
CanonicalForm getMipo(const Variable &alpha, const Variable &x)
Definition variable.cc:207
rootOf
Variable FACTORY_PUBLIC rootOf(const CanonicalForm &, char name='@')
returns a symbolic root of polynomial with name name Use it to define algebraic variables
Definition variable.cc:162
prune
void FACTORY_PUBLIC prune(Variable &alpha)
Definition variable.cc:261
setMipo
void setMipo(const Variable &alpha, const CanonicalForm &mipo)
Definition variable.cc:219
getDefaultExtName
char getDefaultExtName()
Definition variable.cc:249
hasMipo
bool hasMipo(const Variable &alpha)
Definition variable.cc:226