Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Loading...
Searching...
No Matches
vartype.h
Go to the documentation of this file.
1
30#pragma once
31
33
34#pragma GCC visibility push(default)
35namespace abacus {
36
37
39
44class VarType : public AbacusRoot {
45public:
46
53
55 VarType() { }
56
58
61 VarType(TYPE t) : type_(t) { }
62
64
73 friend std::ostream &operator<<(std::ostream &out, const VarType &rhs);
74
76 TYPE type() const { return type_; }
77
78
80
83 void type(TYPE t) { type_ = t; }
84
85
87 bool discrete() const { return (type_ != Continuous); }
88
89
91 bool binary() const { return (type_ == Binary); }
92
93
95 bool integer() const { return (type_ == Integer); }
96
97private:
98
100};
101
102}
103#pragma GCC visibility pop
Base class of all other classes of ABACUS.
Definition abacusroot.h:69
Variable types.
Definition vartype.h:44
void type(TYPE t)
Sets the variable type to t.
Definition vartype.h:83
bool discrete() const
Returns true if the type of the variable is Integer or Binary, false otherwise.
Definition vartype.h:87
friend std::ostream & operator<<(std::ostream &out, const VarType &rhs)
Output operator for variable types.
VarType(TYPE t)
Creates a variable type t.
Definition vartype.h:61
VarType()
The default constructor: Lets the type of the variable uninitialized.
Definition vartype.h:55
bool integer() const
Returns true if the type of the variable is Integer, false otherwise.
Definition vartype.h:95
TYPE
The enumeration with the different variable types.
Definition vartype.h:48
@ Integer
A general integer variable.
Definition vartype.h:50
@ Continuous
A continuous variable.
Definition vartype.h:49
@ Binary
A variable having value 0 or 1.
Definition vartype.h:51
TYPE type_
The type of the variable.
Definition vartype.h:99
bool binary() const
Returns true if the type of the variable is Binary, false otherwise.
Definition vartype.h:91
TYPE type() const
Returns the type of the variable.
Definition vartype.h:76