1 | // emacs edit mode for this file is -*- C++ -*- |
---|
2 | // $Id: variable.h,v 1.1 1997-03-27 10:25:06 schmidt Exp $ |
---|
3 | |
---|
4 | #ifndef INCL_VARIABLE_H |
---|
5 | #define INCL_VARIABLE_H |
---|
6 | |
---|
7 | /* |
---|
8 | $Log: not supported by cvs2svn $ |
---|
9 | Revision 1.0 1996/05/17 10:59:42 stobbe |
---|
10 | Initial revision |
---|
11 | |
---|
12 | */ |
---|
13 | |
---|
14 | #ifndef NOSTREAMIO |
---|
15 | #include <iostream.h> |
---|
16 | #endif /* NOSTREAMIO */ |
---|
17 | |
---|
18 | #include "cf_defs.h" |
---|
19 | |
---|
20 | /*BEGINPUBLIC*/ |
---|
21 | |
---|
22 | class CanonicalForm; |
---|
23 | |
---|
24 | class Variable |
---|
25 | { |
---|
26 | private: |
---|
27 | int _level; |
---|
28 | Variable( int l, bool flag ); |
---|
29 | public: |
---|
30 | Variable() : _level(LEVELBASE) {} |
---|
31 | Variable( int l ); |
---|
32 | Variable( char name ); |
---|
33 | Variable( int l, char name ); |
---|
34 | Variable( const Variable & v ) : _level(v._level) {} |
---|
35 | ~Variable() {}; |
---|
36 | Variable& operator= ( const Variable & v ) |
---|
37 | { |
---|
38 | _level = v._level; |
---|
39 | return *this; |
---|
40 | } |
---|
41 | int level() const { return _level; } |
---|
42 | char name() const; |
---|
43 | static Variable highest() { return Variable( LEVELQUOT-1 ); } |
---|
44 | Variable next() const { return Variable( _level+1 ); } |
---|
45 | friend bool operator == ( const Variable & lhs, const Variable & rhs ) |
---|
46 | { |
---|
47 | return lhs._level == rhs._level; |
---|
48 | } |
---|
49 | friend bool operator != ( const Variable & lhs, const Variable & rhs ) |
---|
50 | { |
---|
51 | return lhs._level != rhs._level; |
---|
52 | } |
---|
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 | #ifndef NOSTREAMIO |
---|
70 | friend ostream & operator << ( ostream & os, const Variable & v ); |
---|
71 | #endif /* NOSTREAMIO */ |
---|
72 | friend Variable rootOf( const CanonicalForm &, char name = '@' ); |
---|
73 | }; |
---|
74 | |
---|
75 | inline int level( const Variable & v ) { return v.level(); } |
---|
76 | inline char name( const Variable & v ) { return v.name(); } |
---|
77 | |
---|
78 | CanonicalForm getMipo( const Variable & alpha, const Variable & x ); |
---|
79 | |
---|
80 | char getDefaultVarName(); |
---|
81 | char getDefaultExtName(); |
---|
82 | |
---|
83 | /*ENDPUBLIC*/ |
---|
84 | |
---|
85 | // the following functions do not need to be public available |
---|
86 | CanonicalForm getMipo( const Variable & alpha ); |
---|
87 | class InternalPoly; |
---|
88 | InternalPoly * getInternalMipo ( const Variable & alpha ); |
---|
89 | bool getReduce( const Variable & alpha ); |
---|
90 | void setReduce( const Variable & alpha, bool reduce ); |
---|
91 | |
---|
92 | #endif /* INCL_VARIABLE_H */ |
---|