Open
Graph Drawing
Framework

 v. 2020.02 (Catalpa)
 

vartype.h
Go to the documentation of this file.
1 
30 #pragma once
31 
33 
34 namespace abacus {
35 
36 
38 
43 class VarType : public AbacusRoot {
44 public:
45 
47  enum TYPE {
51  };
52 
54  VarType() { }
55 
57 
60  VarType(TYPE t) : type_(t) { }
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 
96 private:
97 
99 };
100 
101 }
bool binary() const
Returns true if the type of the variable is Binary, false otherwise.
Definition: vartype.h:90
bool discrete() const
Returns true if the type of the variable is Integer or Binary, false otherwise.
Definition: vartype.h:86
Base class of all other classes of ABACUS.
Definition: abacusroot.h:68
void type(TYPE t)
Sets the variable type to t.
Definition: vartype.h:82
Variable types.
Definition: vartype.h:43
A variable having value 0 or 1.
Definition: vartype.h:50
A continuous variable.
Definition: vartype.h:48
VarType(TYPE t)
Creates a variable type t.
Definition: vartype.h:60
TYPE type_
The type of the variable.
Definition: vartype.h:98
VarType()
The default constructor: Lets the type of the variable uninitialized.
Definition: vartype.h:54
A general integer variable.
Definition: vartype.h:49
TYPE type() const
Returns the type of the variable.
Definition: vartype.h:75
TYPE
The enumeration with the different variable types.
Definition: vartype.h:47
bool integer() const
Returns true if the type of the variable is Integer, false otherwise.
Definition: vartype.h:94
friend std::ostream & operator<<(std::ostream &out, const VarType &rhs)
Output operator for variable types.