source: git/factory/variable.h @ 1dc616

spielwiese
Last change on this file since 1dc616 was 1dc616, checked in by Hans Schönemann <hannes@…>, 18 years ago
*hannes: test for iostream and iostream.h git-svn-id: file:///usr/local/Singular/svn/trunk@9134 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 2.5 KB
Line 
1/* emacs edit mode for this file is -*- C++ -*- */
2/* $Id: variable.h,v 1.6 2006-05-15 08:17:55 Singular Exp $ */
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#elif defined(HAVE_IOSTREAM_H)
13#include <iostream.h>
14#endif
15#endif /* NOSTREAMIO */
16
17#include "cf_defs.h"
18
19/*BEGINPUBLIC*/
20
21class CanonicalForm;
22
23class Variable
24{
25private:
26    int _level;
27    Variable( int l, bool flag );
28public:
29    Variable() : _level(LEVELBASE) {}
30    Variable( int l );
31    Variable( char name );
32    Variable( int l, char name );
33    Variable( const Variable & v ) : _level(v._level) {}
34    ~Variable() {};
35    Variable& operator= ( const Variable & v )
36    {
37        _level = v._level;
38        return *this;
39    }
40    int level() const { return _level; }
41    char name() const;
42    static Variable highest() { return Variable( LEVELQUOT-1 ); }
43    Variable next() const { return Variable( _level+1 ); }
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    friend bool operator <= ( const Variable & lhs, const Variable & rhs )
65    {
66        return lhs._level <= rhs._level;
67    }
68#ifndef NOSTREAMIO
69    friend ostream & operator << ( ostream & os, const Variable & v );
70#endif /* NOSTREAMIO */
71    friend void swap_levels();
72    friend Variable rootOf( const CanonicalForm &, char name );
73};
74Variable rootOf( const CanonicalForm &, char name = '@' );
75
76inline int level( const Variable & v ) { return v.level(); }
77inline char name( const Variable & v ) { return v.name(); }
78
79CanonicalForm getMipo( const Variable & alpha, const Variable & x );
80
81char getDefaultVarName();
82char getDefaultExtName();
83
84int ExtensionLevel();
85
86/*ENDPUBLIC*/
87
88// the following functions do not need to be public available
89CanonicalForm getMipo( const Variable & alpha );
90class InternalPoly;
91InternalPoly * getInternalMipo ( const Variable & alpha );
92bool getReduce( const Variable & alpha );
93void setReduce( const Variable & alpha, bool reduce );
94
95#endif /* ! INCL_VARIABLE_H */
Note: See TracBrowser for help on using the repository browser.