My Project
Loading...
Searching...
No Matches
variable.h
Go to the documentation of this file.
1/* emacs edit mode for this file is -*- C++ -*- */
2
3/**
4 * @file variable.h
5 *
6 * operations on variables
7**/
8#ifndef INCL_VARIABLE_H
9#define INCL_VARIABLE_H
10
11// #include "config.h"
12
13#ifndef NOSTREAMIO
14# ifdef HAVE_IOSTREAM
15# include <iostream>
16# define OSTREAM std::ostream
17# elif defined(HAVE_IOSTREAM_H)
18# include <iostream.h>
19# define OSTREAM ostream
20# endif
21#endif /* NOSTREAMIO */
22
23#include "cf_defs.h"
24
25/*BEGINPUBLIC*/
26
27class CanonicalForm;
28
29/**
30 * factory's class for variables
31**/
33{
34private:
35 int _level;
36 Variable( int l, bool flag );
37public:
38 Variable() : _level(LEVELBASE) {}
39 Variable( int l );
40 Variable( char name );
41 Variable( int l, char name );
42 Variable( const Variable & v ) : _level(v._level) {}
44 Variable& operator= ( const Variable & v )
45 {
46 _level = v._level;
47 return *this;
48 }
49 int level() const { return _level; }
50 char name() const;
51 static Variable highest() { return Variable( LEVELQUOT-1 ); }
52 Variable next() const { return Variable( _level+1 ); }
53 friend bool operator == ( const Variable & lhs, const Variable & rhs )
54 {
55 return lhs._level == rhs._level;
56 }
57 friend bool operator != ( const Variable & lhs, const Variable & rhs )
58 {
59 return lhs._level != rhs._level;
60 }
61 friend bool operator > ( const Variable & lhs, const Variable & rhs )
62 {
63 return lhs._level > rhs._level;
64 }
65 friend bool operator < ( const Variable & lhs, const Variable & rhs )
66 {
67 return lhs._level < rhs._level;
68 }
69 friend bool operator >= ( const Variable & lhs, const Variable & rhs )
70 {
71 return lhs._level >= rhs._level;
72 }
73 friend bool operator <= ( const Variable & lhs, const Variable & rhs )
74 {
75 return lhs._level <= rhs._level;
76 }
77#ifndef NOSTREAMIO
78 friend OSTREAM & operator << ( OSTREAM & os, const Variable & v );
79#endif /* NOSTREAMIO */
80 friend void swap_levels();
81 /** returns a symbolic root of polynomial with name @a name.
82 * Use it to define algebraic variables
83 * @note: algebraic variables have a level < 0
84 **/
85 friend Variable rootOf( const CanonicalForm &, char name );
86};
87
88/** returns a symbolic root of polynomial with name @a name
89 * Use it to define algebraic variables
90 * @note: algebraic variables have a level < 0
91**/
92Variable FACTORY_PUBLIC rootOf( const CanonicalForm &, char name = '@' );
93
94inline int level( const Variable & v ) { return v.level(); }
95inline char name( const Variable & v ) { return v.name(); }
96
97void setReduce( const Variable & alpha, bool reduce );
98void setMipo ( const Variable & alpha, const CanonicalForm & mipo);
99CanonicalForm getMipo( const Variable & alpha, const Variable & x );
100bool hasMipo( const Variable & alpha );
101
102char getDefaultVarName();
103char getDefaultExtName();
104
106void prune1 (const Variable& alpha);
107int ExtensionLevel();
108
109/*ENDPUBLIC*/
110
111// the following functions do not need to be public available
113class InternalPoly;
115bool getReduce( const Variable & alpha );
116
117#endif /* ! INCL_VARIABLE_H */
bool operator!=(const Rational &a, const Rational &b)
Definition: GMPrat.cc:318
bool operator<(const Rational &a, const Rational &b)
Definition: GMPrat.cc:288
bool operator==(const Rational &a, const Rational &b)
Definition: GMPrat.cc:312
bool operator>(const Rational &a, const Rational &b)
Definition: GMPrat.cc:300
bool operator<=(const Rational &a, const Rational &b)
Definition: GMPrat.cc:294
bool operator>=(const Rational &a, const Rational &b)
Definition: GMPrat.cc:306
#define OSTREAM
Definition: canonicalform.h:16
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
int l
Definition: cfEzgcd.cc:100
Variable x
Definition: cfModGcd.cc:4082
factory switches.
#define LEVELBASE
Definition: cf_defs.h:25
#define LEVELQUOT
Definition: cf_defs.h:27
factory's main class
Definition: canonicalform.h:86
factory's class for polynomials
Definition: int_poly.h:71
factory's class for variables
Definition: variable.h:33
Variable(const Variable &v)
Definition: variable.h:42
friend void swap_levels()
Variable()
Definition: variable.h:38
char name() const
Definition: variable.cc:122
int level() const
Definition: variable.h:49
Variable next() const
Definition: variable.h:52
static Variable highest()
Definition: variable.h:51
~Variable()
Definition: variable.h:43
int _level
Definition: variable.h:35
Variable alpha
Definition: facAbsBiFact.cc:51
CanonicalForm mipo
Definition: facAlgExt.cc:57
const Variable & v
< [in] a sqrfree bivariate poly
Definition: facBivar.h:39
#define FACTORY_PUBLIC
Definition: globaldefs.h:25
ostream & operator<<(ostream &s, const spectrum &spec)
Definition: semic.cc:249
int name
New type name for int.
Definition: templateForC.h:21
Variable rootOf(const CanonicalForm &mipo, char name)
returns a symbolic root of polynomial with name name Use it to define algebraic variables
Definition: variable.cc:162
void setReduce(const Variable &alpha, bool reduce)
Definition: variable.cc:238
bool getReduce(const Variable &alpha)
Definition: variable.cc:232
int level(const Variable &v)
Definition: variable.h:94
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
char getDefaultVarName()
Definition: variable.cc:244
void prune1(const Variable &alpha)
Definition: variable.cc:291
InternalPoly * getInternalMipo(const Variable &alpha)
Definition: variable.cc:201
int ExtensionLevel()
Definition: variable.cc:254
CanonicalForm getMipo(const Variable &alpha, const Variable &x)
Definition: variable.cc:207
void FACTORY_PUBLIC prune(Variable &alpha)
Definition: variable.cc:261
void setMipo(const Variable &alpha, const CanonicalForm &mipo)
Definition: variable.cc:219
char getDefaultExtName()
Definition: variable.cc:249
bool hasMipo(const Variable &alpha)
Definition: variable.cc:226