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
34namespace abacus {
35
36
38
43class VarType : public AbacusRoot {
44public:
45
52
54 VarType() { }
55
57
61
63
72 friend std::ostream &operator<<(std::ostream &out, const VarType &rhs);
73
75 TYPE type() const { return type_; }
76
77
79
82 void type(TYPE t) { type_ = t; }
83
84
86 bool discrete() const { return (type_ != Continuous); }
87
88
90 bool binary() const { return (type_ == Binary); }
91
92
94 bool integer() const { return (type_ == Integer); }
95
96private:
97
99};
100
101}
Base class of all other classes of ABACUS.
Definition abacusroot.h:68
Variable types.
Definition vartype.h:43
void type(TYPE t)
Sets the variable type to t.
Definition vartype.h:82
bool discrete() const
Returns true if the type of the variable is Integer or Binary, false otherwise.
Definition vartype.h:86
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:60
VarType()
The default constructor: Lets the type of the variable uninitialized.
Definition vartype.h:54
bool integer() const
Returns true if the type of the variable is Integer, false otherwise.
Definition vartype.h:94
TYPE
The enumeration with the different variable types.
Definition vartype.h:47
@ Integer
A general integer variable.
Definition vartype.h:49
@ Continuous
A continuous variable.
Definition vartype.h:48
@ Binary
A variable having value 0 or 1.
Definition vartype.h:50
TYPE type_
The type of the variable.
Definition vartype.h:98
bool binary() const
Returns true if the type of the variable is Binary, false otherwise.
Definition vartype.h:90
TYPE type() const
Returns the type of the variable.
Definition vartype.h:75
static MultilevelBuilder * getDoubleFactoredZeroAdjustedMerger()