Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

vartype.h
Go to the documentation of this file.
1 
30 #pragma once
31 
33 
34 #pragma GCC visibility push(default)
35 namespace abacus {
36 
37 
39 
44 class VarType : public AbacusRoot {
45 public:
46 
48  enum TYPE {
52  };
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 
97 private:
98 
100 };
101 
102 }
103 #pragma GCC visibility pop
abacus::VarType
Variable types.
Definition: vartype.h:44
abacus::VarType::Integer
@ Integer
A general integer variable.
Definition: vartype.h:50
abacusroot.h
abacus
Definition: ILPClusterPlanarity.h:50
abacus::VarType::type
void type(TYPE t)
Sets the variable type to t.
Definition: vartype.h:83
abacus::VarType::binary
bool binary() const
Returns true if the type of the variable is Binary, false otherwise.
Definition: vartype.h:91
abacus::VarType::VarType
VarType(TYPE t)
Creates a variable type t.
Definition: vartype.h:61
abacus::VarType::type_
TYPE type_
The type of the variable.
Definition: vartype.h:99
abacus::AbacusRoot
Base class of all other classes of ABACUS.
Definition: abacusroot.h:69
abacus::VarType::type
TYPE type() const
Returns the type of the variable.
Definition: vartype.h:76
abacus::VarType::integer
bool integer() const
Returns true if the type of the variable is Integer, false otherwise.
Definition: vartype.h:95
abacus::VarType::Binary
@ Binary
A variable having value 0 or 1.
Definition: vartype.h:51
abacus::VarType::VarType
VarType()
The default constructor: Lets the type of the variable uninitialized.
Definition: vartype.h:55
abacus::VarType::TYPE
TYPE
The enumeration with the different variable types.
Definition: vartype.h:48
abacus::VarType::operator<<
friend std::ostream & operator<<(std::ostream &out, const VarType &rhs)
Output operator for variable types.
abacus::VarType::Continuous
@ Continuous
A continuous variable.
Definition: vartype.h:49
abacus::VarType::discrete
bool discrete() const
Returns true if the type of the variable is Integer or Binary, false otherwise.
Definition: vartype.h:87