|
|
dlinear
0.0.1
Delta-complete SMT solver for linear programming
|
Collection of variables with associated intervals. More...
#include <Box.h>
Public Member Functions | |
| Box (Config::LPSolver lp_solver) | |
Construct a new Box object associated with the given lp_solver. | |
| Box (const std::vector< Variable > &variables, Config::LPSolver lp_solver) | |
Construct a box from variables associated with the given lp_solver. | |
| void | Add (const Variable &v) |
Add the variable v to the box. | |
| void | Add (const Variable &v, const mpq_class &lb, const mpq_class &ub) |
Add the variable v to the box and sets its domain using lb and ub. | |
| bool | empty () const |
| Check whether the box is empty. | |
| void | set_empty () |
| Clear the box, making it empty. | |
| int | size () const |
| Get read-only access to the number of variables of the box. | |
| Interval & | operator[] (int i) |
Return the interval at index i. | |
| Interval & | operator[] (const Variable &var) |
Return the interval associated with var. | |
| const Interval & | operator[] (int i) const |
Return the interval at index i. | |
| const Interval & | operator[] (const Variable &var) const |
Return the interval associated with var. | |
| Config::LPSolver | lp_solver () const |
| Get read-only access to the lp_solver of the box. | |
| const std::vector< Variable > & | variables () const |
| Get read-only access to the variables of the box. | |
| const Variable & | variable (int i) const |
Return the i -th variable in the box. | |
| bool | has_variable (const Variable &var) const |
Checks if this box contains var. | |
| const std::vector< Interval > & | interval_vector () const |
| Return the interval vector of the box. | |
| std::vector< Interval > & | m_interval_vector () |
| Return the interval vector of the box. | |
| int | index (const Variable &var) const |
Return the index associated with var. | |
| std::pair< mpq_class, int > | MaxDiam () const |
| Return the max diameter of the box and the associated index. | |
| std::pair< Box, Box > | Bisect (int i) const |
Bisect the box at i -th dimension. | |
| std::pair< Box, Box > | Bisect (const Variable &var) const |
Bisect the box at var. | |
Private Member Functions | |
| std::pair< Box, Box > | BisectInt (int i) const |
Bisects the box at i -th dimension. | |
| std::pair< Box, Box > | BisectContinuous (int i) const |
Bisects the box at i -th dimension. | |
Private Attributes | |
| Config::LPSolver | lp_solver_ |
| LP solver. | |
| std::vector< Interval > | values_ |
| Interval vector of the box. | |
| std::shared_ptr< std::vector< Variable > > | variables_ |
| Variables in the box. | |
| std::shared_ptr< std::unordered_map< Variable, int > > | var_to_idx_ |
| Variable to index map. | |
| std::shared_ptr< std::unordered_map< int, Variable > > | idx_to_var_ |
| Index to variable map. | |
Collection of variables with associated intervals.
The Box class is used throughout the tool to keep track of the variables that will eventually populate the model. When a model is produced, the bounds on each variable will match a single value.
|
explicit |
|
explicit |
| void dlinear::Box::Add | ( | const Variable & | v | ) |
| void dlinear::Box::Add | ( | const Variable & | v, |
| const mpq_class & | lb, | ||
| const mpq_class & | ub ) |
|
nodiscard |
|
nodiscard |
|
nodiscard |
|
nodiscard |
|
inlinenodiscard |
| std::vector< Interval > & dlinear::Box::m_interval_vector | ( | ) |
|
nodiscard |
| Interval & dlinear::Box::operator[] | ( | int | i | ) |
| const Interval & dlinear::Box::operator[] | ( | int | i | ) | const |
| void dlinear::Box::set_empty | ( | ) |
|
nodiscard |
|
nodiscard |
|
nodiscard |