5 #include <unordered_map> 19 using Interval = ibex::Interval;
20 using IntervalVector = ibex::IntervalVector;
71 const std::vector<Variable>&
variables()
const;
89 std::pair<double, int>
MaxDiam()
const;
93 std::pair<Box, Box>
bisect(
int i)
const;
108 std::pair<Box, Box> bisect_int(
int i)
const;
113 std::pair<Box, Box> bisect_continuous(
int i)
const;
115 std::shared_ptr<std::vector<Variable>> variables_;
117 ibex::IntervalVector values_;
119 std::shared_ptr<std::unordered_map<Variable, int, hash_value<Variable>>>
122 std::shared_ptr<std::unordered_map<int, Variable>> idx_to_var_;
124 friend std::ostream& operator<<(std::ostream& os,
const Box& box);
127 std::ostream& operator<<(std::ostream& os,
const Box& box);
129 bool operator==(
const Box& b1,
const Box& b2);
131 bool operator!=(
const Box& b1,
const Box& b2);
133 std::ostream& DisplayDiff(std::ostream& os,
135 const Box::IntervalVector& old_iv,
136 const Box::IntervalVector& new_iv);
Sum type of symbolic::Expression and symbolic::Formula.
Definition: api.cc:9
int index(const Variable &var) const
Returns the index associated with var.
Definition: box.cc:129
Box & InplaceUnion(const Box &b)
Updates the current box by taking union with b.
Definition: box.cc:208
const IntervalVector & interval_vector() const
Returns the interval vector of the box.
Definition: box.cc:131
Box()
Constructs a zero-dimensional box.
Definition: box.cc:29
Box & operator=(const Box &)=default
Default copy assign operator.
Represents a symbolic variable.
Definition: symbolic_variable.h:16
Interval & operator[](int i)
Returns i -th interval in the box.
Definition: box.cc:106
std::pair< Box, Box > bisect(int i) const
Bisects the box at i -th dimension.
Definition: box.cc:147
const Variable & variable(int i) const
Returns i-th variable in the box.
Definition: box.cc:123
bool empty() const
Checks if this box is empty.
Definition: box.cc:100
std::pair< double, int > MaxDiam() const
Returns the max diameter of the box and the associated index .
Definition: box.cc:134
void set_empty()
Make this box empty.
Definition: box.cc:102
void Add(const Variable &v)
Adds v to the box.
Definition: box.cc:51
Represents a n-dimensional interval vector.
Definition: box.h:17
bool has_variable(const Variable &var) const
Checks if this box has var.
Definition: box.cc:125
int size() const
Returns the size of the box.
Definition: box.cc:104
~Box()=default
Default destructor.
This is the header file that we consolidate Drake's symbolic classes and expose them inside of dreal ...
IntervalVector & mutable_interval_vector()
Returns the interval vector of the box.
Definition: box.cc:132
const std::vector< Variable > & variables() const
Returns the variables in the box.
Definition: box.cc:121