source: git/factory/variable.h @ 0fc536

spielwiese
Last change on this file since 0fc536 was c3aa45, checked in by Hans Schönemann <hannes@…>, 19 years ago
*hannes: bivar stuff git-svn-id: file:///usr/local/Singular/svn/trunk@7814 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.4 2005-04-13 15:01:53 Singular 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 void swap_levels();
68    friend Variable rootOf( const CanonicalForm &, char name = '@' );
69};
70
71inline int level( const Variable & v ) { return v.level(); }
72inline char name( const Variable & v ) { return v.name(); }
73
74CanonicalForm getMipo( const Variable & alpha, const Variable & x );
75
76char getDefaultVarName();
77char getDefaultExtName();
78
79int ExtensionLevel();
80
81/*ENDPUBLIC*/
82
83// the following functions do not need to be public available
84CanonicalForm getMipo( const Variable & alpha );
85class InternalPoly;
86InternalPoly * getInternalMipo ( const Variable & alpha );
87bool getReduce( const Variable & alpha );
88void setReduce( const Variable & alpha, bool reduce );
89
90#endif /* ! INCL_VARIABLE_H */
Note: See TracBrowser for help on using the repository browser.