source: git/factory/variable.h @ 173e86

fieker-DuValspielwiese
Last change on this file since 173e86 was 175e355, checked in by Jens Schmidt <schmidt@…>, 27 years ago
stream-io wrapped by NOSTREAMIO git-svn-id: file:///usr/local/Singular/svn/trunk@114 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 2.4 KB
Line 
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 $
9Revision 1.0  1996/05/17 10:59:42  stobbe
10Initial revision
11
12*/
13
14#ifndef NOSTREAMIO
15#include <iostream.h>
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 Variable rootOf( const CanonicalForm &, char name = '@' );
73};
74
75inline int level( const Variable & v ) { return v.level(); }
76inline char name( const Variable & v ) { return v.name(); }
77
78CanonicalForm getMipo( const Variable & alpha, const Variable & x );
79
80char getDefaultVarName();
81char getDefaultExtName();
82
83/*ENDPUBLIC*/
84
85// the following functions do not need to be public available
86CanonicalForm getMipo( const Variable & alpha );
87class InternalPoly;
88InternalPoly * getInternalMipo ( const Variable & alpha );
89bool getReduce( const Variable & alpha );
90void setReduce( const Variable & alpha, bool reduce );
91
92#endif /* INCL_VARIABLE_H */
Note: See TracBrowser for help on using the repository browser.