9 #include "dreal/symbolic/hash.h" 43 Variable() : name_{std::make_shared<std::string>()} {}
54 [[deprecated(
"This is only for backward-compatibility.")]]
Variable(
55 std::string name,
Type type,
bool model_variable);
59 bool is_dummy()
const {
return get_id() == 0; }
61 Type get_type()
const;
62 size_t get_hash()
const {
return std::hash<Id>{}(id_); }
63 std::string get_name()
const;
64 std::string to_string()
const;
70 bool less(
const Variable& v)
const {
return get_id() < v.get_id(); }
72 friend std::ostream& operator<<(std::ostream& os,
const Variable& var);
76 static Id get_next_id();
84 std::shared_ptr<std::string> name_;
106 return lhs.
less(rhs);
120 struct hash<
dreal::drake::symbolic::Variable> {
A BINARY variable takes an integer value from {0, 1}.
Variable()
Default constructor.
Definition: symbolic_variable.h:43
Sum type of symbolic::Expression and symbolic::Formula.
Definition: api.cc:9
~Variable()=default
Default destructor.
Type
Supported types of symbolic variables.
Definition: symbolic_variable.h:22
Represents a symbolic variable.
Definition: symbolic_variable.h:16
Computes the hash value of v using std::hash.
Definition: hash.h:35
bool is_dummy() const
Checks if this is a dummy variable (ID = 0) which is created by the default constructor.
Definition: symbolic_variable.h:59
An INTEGER variable takes an int value.
bool less(const Variable &v) const
Compares two variables based on their ID values.
Definition: symbolic_variable.h:70
A CONTINUOUS variable takes a double value.
A BOOLEAN variable takes a bool value.
bool equal_to(const Variable &v) const
Checks the equality of two variables based on their ID values.
Definition: symbolic_variable.h:67