source: git/factory/variable.h @ a37b34

spielwiese
Last change on this file since a37b34 was 183688, checked in by Martin Lee <martinlee84@…>, 12 years ago
chg: if variable has level LEVELBASE it has no minpoly
  • Property mode set to 100644
File size: 2.6 KB
Line 
1/* emacs edit mode for this file is -*- C++ -*- */
2
3#ifndef INCL_VARIABLE_H
4#define INCL_VARIABLE_H
5
6// #include "config.h"
7
8#ifndef NOSTREAMIO
9# ifdef HAVE_IOSTREAM
10#  include <iostream>
11#  define OSTREAM std::ostream
12# elif defined(HAVE_IOSTREAM_H)
13#  include <iostream.h>
14#  define OSTREAM ostream
15# endif
16#endif /* NOSTREAMIO */
17
18#include "cf_defs.h"
19
20/*BEGINPUBLIC*/
21
22class CanonicalForm;
23
24class Variable
25{
26private:
27    int _level;
28    Variable( int l, bool flag );
29public:
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 void swap_levels();
73    friend Variable rootOf( const CanonicalForm &, char name );
74};
75Variable rootOf( const CanonicalForm &, char name = '@' );
76
77inline int level( const Variable & v ) { return v.level(); }
78inline char name( const Variable & v ) { return v.name(); }
79
80void setReduce( const Variable & alpha, bool reduce );
81void setMipo ( const Variable & alpha, const CanonicalForm & mipo);
82CanonicalForm getMipo( const Variable & alpha, const Variable & x );
83bool hasMipo( const Variable & alpha );
84
85char getDefaultVarName();
86char getDefaultExtName();
87
88int ExtensionLevel();
89
90/*ENDPUBLIC*/
91
92// the following functions do not need to be public available
93CanonicalForm getMipo( const Variable & alpha );
94class InternalPoly;
95InternalPoly * getInternalMipo ( const Variable & alpha );
96bool getReduce( const Variable & alpha );
97
98#endif /* ! INCL_VARIABLE_H */
Note: See TracBrowser for help on using the repository browser.