source: git/factory/variable.h @ 6c5d86

spielwiese
Last change on this file since 6c5d86 was 493c477, checked in by Jens Schmidt <schmidt@…>, 27 years ago
o header fixed git-svn-id: file:///usr/local/Singular/svn/trunk@404 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 2.3 KB
Line 
1/* emacs edit mode for this file is -*- C++ -*- */
2/* $Id: variable.h,v 1.3 1997-06-19 12:21:49 schmidt Exp $ */
3
4#ifndef INCL_VARIABLE_H
5#define INCL_VARIABLE_H
6
7#include <config.h>
8
9#ifndef NOSTREAMIO
10#include <iostream.h>
11#endif /* NOSTREAMIO */
12
13#include "cf_defs.h"
14
15/*BEGINPUBLIC*/
16
17class CanonicalForm;
18
19class Variable
20{
21private:
22    int _level;
23    Variable( int l, bool flag );
24public:
25    Variable() : _level(LEVELBASE) {}
26    Variable( int l );
27    Variable( char name );
28    Variable( int l, char name );
29    Variable( const Variable & v ) : _level(v._level) {}
30    ~Variable() {};
31    Variable& operator= ( const Variable & v )
32    {
33        _level = v._level;
34        return *this;
35    }
36    int level() const { return _level; }
37    char name() const;
38    static Variable highest() { return Variable( LEVELQUOT-1 ); }
39    Variable next() const { return Variable( _level+1 ); }
40    friend bool operator == ( const Variable & lhs, const Variable & rhs )
41    {
42        return lhs._level == rhs._level;
43    }
44    friend bool operator != ( const Variable & lhs, const Variable & rhs )
45    {
46        return lhs._level != rhs._level;
47    }
48    friend bool operator > ( const Variable & lhs, const Variable & rhs )
49    {
50        return lhs._level > rhs._level;
51    }
52    friend bool operator < ( const Variable & lhs, const Variable & rhs )
53    {
54        return lhs._level < rhs._level;
55    }
56    friend bool operator >= ( const Variable & lhs, const Variable & rhs )
57    {
58        return lhs._level >= rhs._level;
59    }
60    friend bool operator <= ( const Variable & lhs, const Variable & rhs )
61    {
62        return lhs._level <= rhs._level;
63    }
64#ifndef NOSTREAMIO
65    friend ostream & operator << ( ostream & os, const Variable & v );
66#endif /* NOSTREAMIO */
67    friend Variable rootOf( const CanonicalForm &, char name = '@' );
68};
69
70inline int level( const Variable & v ) { return v.level(); }
71inline char name( const Variable & v ) { return v.name(); }
72
73CanonicalForm getMipo( const Variable & alpha, const Variable & x );
74
75char getDefaultVarName();
76char getDefaultExtName();
77
78/*ENDPUBLIC*/
79
80// the following functions do not need to be public available
81CanonicalForm getMipo( const Variable & alpha );
82class InternalPoly;
83InternalPoly * getInternalMipo ( const Variable & alpha );
84bool getReduce( const Variable & alpha );
85void setReduce( const Variable & alpha, bool reduce );
86
87#endif /* ! INCL_VARIABLE_H */
Note: See TracBrowser for help on using the repository browser.