[493c477] | 1 | /* emacs edit mode for this file is -*- C++ -*- */ |
---|
[341696] | 2 | /* $Id$ */ |
---|
[2dd068] | 3 | |
---|
| 4 | #ifndef INCL_VARIABLE_H |
---|
| 5 | #define INCL_VARIABLE_H |
---|
| 6 | |
---|
[e4fe2b] | 7 | // #include "config.h" |
---|
[037633] | 8 | |
---|
[175e355] | 9 | #ifndef NOSTREAMIO |
---|
[e4fe2b] | 10 | # ifdef HAVE_IOSTREAM |
---|
| 11 | # include <iostream> |
---|
| 12 | # define OSTREAM std::ostream |
---|
| 13 | # elif defined(HAVE_IOSTREAM_H) |
---|
| 14 | # include <iostream.h> |
---|
| 15 | # define OSTREAM ostream |
---|
| 16 | # endif |
---|
[175e355] | 17 | #endif /* NOSTREAMIO */ |
---|
[2dd068] | 18 | |
---|
| 19 | #include "cf_defs.h" |
---|
| 20 | |
---|
| 21 | /*BEGINPUBLIC*/ |
---|
| 22 | |
---|
| 23 | class CanonicalForm; |
---|
| 24 | |
---|
| 25 | class Variable |
---|
| 26 | { |
---|
| 27 | private: |
---|
| 28 | int _level; |
---|
| 29 | Variable( int l, bool flag ); |
---|
| 30 | public: |
---|
| 31 | Variable() : _level(LEVELBASE) {} |
---|
| 32 | Variable( int l ); |
---|
| 33 | Variable( char name ); |
---|
| 34 | Variable( int l, char name ); |
---|
| 35 | Variable( const Variable & v ) : _level(v._level) {} |
---|
| 36 | ~Variable() {}; |
---|
| 37 | Variable& operator= ( const Variable & v ) |
---|
| 38 | { |
---|
| 39 | _level = v._level; |
---|
| 40 | return *this; |
---|
| 41 | } |
---|
| 42 | int level() const { return _level; } |
---|
| 43 | char name() const; |
---|
| 44 | static Variable highest() { return Variable( LEVELQUOT-1 ); } |
---|
| 45 | Variable next() const { return Variable( _level+1 ); } |
---|
| 46 | friend bool operator == ( const Variable & lhs, const Variable & rhs ) |
---|
| 47 | { |
---|
| 48 | return lhs._level == rhs._level; |
---|
| 49 | } |
---|
| 50 | friend bool operator != ( const Variable & lhs, const Variable & rhs ) |
---|
| 51 | { |
---|
| 52 | return lhs._level != rhs._level; |
---|
| 53 | } |
---|
| 54 | friend bool operator > ( const Variable & lhs, const Variable & rhs ) |
---|
| 55 | { |
---|
| 56 | return lhs._level > rhs._level; |
---|
| 57 | } |
---|
| 58 | friend bool operator < ( const Variable & lhs, const Variable & rhs ) |
---|
| 59 | { |
---|
| 60 | return lhs._level < rhs._level; |
---|
| 61 | } |
---|
| 62 | friend bool operator >= ( const Variable & lhs, const Variable & rhs ) |
---|
| 63 | { |
---|
| 64 | return lhs._level >= rhs._level; |
---|
| 65 | } |
---|
| 66 | friend bool operator <= ( const Variable & lhs, const Variable & rhs ) |
---|
| 67 | { |
---|
| 68 | return lhs._level <= rhs._level; |
---|
| 69 | } |
---|
[175e355] | 70 | #ifndef NOSTREAMIO |
---|
[e4fe2b] | 71 | friend OSTREAM & operator << ( OSTREAM & os, const Variable & v ); |
---|
[175e355] | 72 | #endif /* NOSTREAMIO */ |
---|
[c3aa45] | 73 | friend void swap_levels(); |
---|
[6b503c] | 74 | friend Variable rootOf( const CanonicalForm &, char name ); |
---|
[2dd068] | 75 | }; |
---|
[6b503c] | 76 | Variable rootOf( const CanonicalForm &, char name = '@' ); |
---|
[2dd068] | 77 | |
---|
| 78 | inline int level( const Variable & v ) { return v.level(); } |
---|
| 79 | inline char name( const Variable & v ) { return v.name(); } |
---|
| 80 | |
---|
| 81 | CanonicalForm getMipo( const Variable & alpha, const Variable & x ); |
---|
[6981f1] | 82 | bool hasMipo( const Variable & alpha ); |
---|
[2dd068] | 83 | |
---|
| 84 | char getDefaultVarName(); |
---|
| 85 | char getDefaultExtName(); |
---|
| 86 | |
---|
[c3aa45] | 87 | int ExtensionLevel(); |
---|
| 88 | |
---|
[2dd068] | 89 | /*ENDPUBLIC*/ |
---|
| 90 | |
---|
| 91 | // the following functions do not need to be public available |
---|
| 92 | CanonicalForm getMipo( const Variable & alpha ); |
---|
| 93 | class InternalPoly; |
---|
| 94 | InternalPoly * getInternalMipo ( const Variable & alpha ); |
---|
| 95 | bool getReduce( const Variable & alpha ); |
---|
| 96 | void setReduce( const Variable & alpha, bool reduce ); |
---|
| 97 | |
---|
[493c477] | 98 | #endif /* ! INCL_VARIABLE_H */ |
---|