Open
Graph Drawing
Framework

 v. 2022.02 (Dogwood)
 

abacus::VarType Class Reference

Variable types. More...

#include <ogdf/lib/abacus/vartype.h>

+ Inheritance diagram for abacus::VarType:

Public Types

enum  TYPE { Continuous, Integer, Binary }
 The enumeration with the different variable types. More...
 

Public Member Functions

 VarType ()
 The default constructor: Lets the type of the variable uninitialized. More...
 
 VarType (TYPE t)
 Creates a variable type t. More...
 
bool binary () const
 Returns true if the type of the variable is Binary, false otherwise. More...
 
bool discrete () const
 Returns true if the type of the variable is Integer or Binary, false otherwise. More...
 
bool integer () const
 Returns true if the type of the variable is Integer, false otherwise. More...
 
TYPE type () const
 Returns the type of the variable. More...
 
void type (TYPE t)
 Sets the variable type to t. More...
 
- Public Member Functions inherited from abacus::AbacusRoot
virtual ~AbacusRoot ()
 The destructor. More...
 

Private Attributes

TYPE type_
 The type of the variable. More...
 

Friends

std::ostream & operator<< (std::ostream &out, const VarType &rhs)
 Output operator for variable types. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from abacus::AbacusRoot
static bool ascii2bool (const string &str)
 Converts the string str to a boolean value. More...
 
static bool endsWith (const string &str, const string &end)
 Returns true if str ends with end, false otherwise. More...
 
static double fracPart (double x)
 Returns the absolute value of the fractional part of x. More...
 
static const char * onOff (bool value)
 Converts a boolean variable to the strings "on" and "off". More...
 

Detailed Description

Variable types.

Variables can be of three different types: Continuous, Integer or Binary. We distinguish Integer and Binary variables since some operations are performed differently (e.g., branching).

Definition at line 43 of file vartype.h.

Member Enumeration Documentation

◆ TYPE

The enumeration with the different variable types.

Enumerator
Continuous 

A continuous variable.

Integer 

A general integer variable.

Binary 

A variable having value 0 or 1.

Definition at line 47 of file vartype.h.

Constructor & Destructor Documentation

◆ VarType() [1/2]

abacus::VarType::VarType ( )
inline

The default constructor: Lets the type of the variable uninitialized.

Definition at line 54 of file vartype.h.

◆ VarType() [2/2]

abacus::VarType::VarType ( TYPE  t)
inline

Creates a variable type t.

Parameters
tThe variable type.

Definition at line 60 of file vartype.h.

Member Function Documentation

◆ binary()

bool abacus::VarType::binary ( ) const
inline

Returns true if the type of the variable is Binary, false otherwise.

Definition at line 90 of file vartype.h.

◆ discrete()

bool abacus::VarType::discrete ( ) const
inline

Returns true if the type of the variable is Integer or Binary, false otherwise.

Definition at line 86 of file vartype.h.

◆ integer()

bool abacus::VarType::integer ( ) const
inline

Returns true if the type of the variable is Integer, false otherwise.

Definition at line 94 of file vartype.h.

◆ type() [1/2]

TYPE abacus::VarType::type ( ) const
inline

Returns the type of the variable.

Definition at line 75 of file vartype.h.

◆ type() [2/2]

void abacus::VarType::type ( TYPE  t)
inline

Sets the variable type to t.

Parameters
tThe new type of the variable.

Definition at line 82 of file vartype.h.

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  out,
const VarType rhs 
)
friend

Output operator for variable types.

Writes the variable type to an output stream in the format Continuous, Integer, or Binary.

Parameters
outThe output stream.
rhsThe variable type being output.
Returns
A reference to the output stream.

Member Data Documentation

◆ type_

TYPE abacus::VarType::type_
private

The type of the variable.

Definition at line 98 of file vartype.h.


The documentation for this class was generated from the following file: