-
Notifications
You must be signed in to change notification settings - Fork 0
/
Variable.h
62 lines (50 loc) · 1.2 KB
/
Variable.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#ifndef VARIABLE_H
#define VARIABLE_H
#include "Utility.h"
using namespace std;
class Variable
{
private:
vector <int> tuple;
public:
//static const char EliminationVariable = '@';
static const vector <int> EliminationVariable;
// Begin constructors
Variable() {}
Variable(const vector<int> x) {
tuple = x;
}
/*Variable(char x) {
c = x;
}*/
Variable(string s) {
stringstream Sstream(s);
readStream(Sstream);
}
// End constructors
// Begin operators
bool const operator < (Variable X) const{
return tuple < X.tuple;
}
bool const operator > (Variable X) const{
return tuple > X.tuple;
}
bool const operator == (Variable X) const{
return tuple == X.tuple;
}
bool const operator != (Variable X) const{
return tuple != X.tuple;
}
// End operators
// Begin input output
bool readStream(istream &in);
void writeStream(ostream &out) const{
out << char(tuple[0]);
if(tuple.size()>1)
out<<"_"<<tuple[1];
if(tuple.size()>2)
out<<"_"<<tuple[2];
}
// End input output
};
#endif // VARIABLE_H