source: git/factory/variable.h @ a8af6a8

spielwiese
Last change on this file since a8af6a8 was e4fe2b, checked in by Oleksandr Motsak <motsak@…>, 13 years ago
FIX: Fixed huge BUG in cf_gmp.h CHG: starting to cleanup factory
  • Property mode set to 100644
File size: 2.5 KB
Line 
1/* emacs edit mode for this file is -*- C++ -*- */
2/* $Id$ */
3
4#ifndef INCL_VARIABLE_H
5#define INCL_VARIABLE_H
6
7// #include "config.h"
8
9#ifndef NOSTREAMIO
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
17#endif /* NOSTREAMIO */
18
19#include "cf_defs.h"
20
21/*BEGINPUBLIC*/
22
23class CanonicalForm;
24
25class Variable
26{
27private:
28    int _level;
29    Variable( int l, bool flag );
30public:
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    }
70#ifndef NOSTREAMIO
71   friend OSTREAM & operator << ( OSTREAM & os, const Variable & v );
72#endif /* NOSTREAMIO */
73    friend void swap_levels();
74    friend Variable rootOf( const CanonicalForm &, char name );
75};
76Variable rootOf( const CanonicalForm &, char name = '@' );
77
78inline int level( const Variable & v ) { return v.level(); }
79inline char name( const Variable & v ) { return v.name(); }
80
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.