dReal4
Variable Class Reference

Represents a symbolic variable. More...

#include </home/soonhokong/work/dreal4/third_party/com_github_robotlocomotion_drake/dreal/symbolic/symbolic_variable.h>

Public Types

enum  Type { CONTINUOUS, INTEGER, BINARY, BOOLEAN }
 Supported types of symbolic variables. More...
 
typedef size_t Id
 

Public Member Functions

 Variable (const Variable &)=default
 
Variableoperator= (const Variable &)=default
 
 Variable (Variable &&)=default
 
Variableoperator= (Variable &&)=default
 
 Variable ()
 Default constructor. More...
 
 ~Variable ()=default
 Default destructor. More...
 
 Variable (std::string name, Type type=Type::CONTINUOUS)
 Constructs a variable with a string. More...
 
 Variable (std::string name, Type type, bool model_variable)
 Constructs a variable with name and type. More...
 
bool is_dummy () const
 Checks if this is a dummy variable (ID = 0) which is created by the default constructor. More...
 
Id get_id () const
 
Type get_type () const
 
size_t get_hash () const
 
std::string get_name () const
 
std::string to_string () const
 
bool equal_to (const Variable &v) const
 Checks the equality of two variables based on their ID values.
 
bool less (const Variable &v) const
 Compares two variables based on their ID values.
 

Friends

std::ostream & operator<< (std::ostream &os, const Variable &var)
 

Detailed Description

Represents a symbolic variable.

Member Enumeration Documentation

◆ Type

enum Type
strong

Supported types of symbolic variables.

Enumerator
CONTINUOUS 

A CONTINUOUS variable takes a double value.

INTEGER 

An INTEGER variable takes an int value.

BINARY 

A BINARY variable takes an integer value from {0, 1}.

BOOLEAN 

A BOOLEAN variable takes a bool value.

Constructor & Destructor Documentation

◆ Variable() [1/3]

Variable ( )
inline

Default constructor.

Constructs a dummy variable of CONTINUOUS type. This is needed to have Eigen::Matrix<Variable>. The objects created by the default constructor share the same ID, zero. As a result, they all are identified as a single variable by equality operator (==). They all have the same hash value as well.

It is allowed to construct a dummy variable but it should not be used to construct a symbolic expression.

◆ ~Variable()

~Variable ( )
default

Default destructor.

◆ Variable() [2/3]

Variable ( std::string  name,
Type  type = Type::CONTINUOUS 
)
explicit

Constructs a variable with a string.

If not specified, it has CONTINUOUS type by default.

◆ Variable() [3/3]

Variable ( std::string  name,
Type  type,
bool  model_variable 
)

Constructs a variable with name and type.

model_variable is ignored.

Member Function Documentation

◆ is_dummy()

bool is_dummy ( ) const
inline

Checks if this is a dummy variable (ID = 0) which is created by the default constructor.


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