source: git/factory/variable.h @ 5ab7d6

jengelh-datetimespielwiese
Last change on this file since 5ab7d6 was 5ab7d6, checked in by Martin Lee <martinlee84@…>, 11 years ago
chg: made var_names_ext static and setMipo available again
  • 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 setMipo ( const Variable & alpha, const CanonicalForm & mipo);
81CanonicalForm getMipo( const Variable & alpha, const Variable & x );
82bool hasMipo( const Variable & alpha );
83
84char getDefaultVarName();
85char getDefaultExtName();
86
87int ExtensionLevel();
88
89/*ENDPUBLIC*/
90
91// the following functions do not need to be public available
92CanonicalForm getMipo( const Variable & alpha );
93class InternalPoly;
94InternalPoly * getInternalMipo ( const Variable & alpha );
95bool getReduce( const Variable & alpha );
96void setReduce( const Variable & alpha, bool reduce );
97
98#endif /* ! INCL_VARIABLE_H */
Note: See TracBrowser for help on using the repository browser.