|
ZonoOpt v2.0.1
|
Box (i.e., interval vector) class. More...
#include <Intervals.hpp>
Public Member Functions | |
| Box ()=default | |
| Default constructor. | |
| Box (const size_t size) | |
| Default construct with size specified. | |
| Box (const std::vector< Interval > &vals) | |
| Constructor using vector of intervals. | |
| Box (const Eigen::Vector< zono_float, -1 > &x_lb, const Eigen::Vector< zono_float, -1 > &x_ub) | |
| Constructor from intervals of lower and upper bounds. | |
| virtual | ~Box ()=default |
| Virtual destructor. | |
| Box & | operator= (const Box &other) |
| Copy assignment. | |
| Box (const Box &other) | |
| Copy constructor. | |
| IntervalView | operator[] (size_t i) |
| Element-wise access, used for assignment. | |
| Interval | operator[] (size_t i) const |
| Element-wise access. | |
| size_t | size () const |
| get size of Box object | |
| virtual void | project (Eigen::Ref< Eigen::Vector< zono_float, -1 > > x) const |
| Projects vector onto the Box. | |
| virtual Box * | clone () const |
| Clone operation. | |
| const Eigen::Vector< zono_float, -1 > & | lower () const |
| Get lower bounds. | |
| const Eigen::Vector< zono_float, -1 > & | upper () const |
| Get upper bounds. | |
| zono_float | width () const |
| Get width of box. | |
| Eigen::Vector< zono_float, -1 > | center () const |
| get center of box | |
| Box | operator+ (const Box &other) const |
| elementwise addition | |
| Box | operator- (const Box &other) const |
| elementwise subtraction | |
| Box | operator* (const Box &other) const |
| elementwise multiplication | |
| Box | operator* (zono_float alpha) const |
| elementwise multiplication with scalar | |
| Box | operator/ (const Box &other) const |
| elementwise division | |
| bool | contract (const Eigen::SparseMatrix< zono_float, Eigen::RowMajor > &A, const Eigen::Vector< zono_float, -1 > &b, int iter) |
| Interval contractor. | |
| bool | contract_subset (const Eigen::SparseMatrix< zono_float, Eigen::RowMajor > &A_rm, const Eigen::Vector< zono_float, -1 > &b, int iter, const Eigen::SparseMatrix< zono_float > &A, const std::set< int > &inds, int tree_search_depth) |
| Interval contractor over a subset of the dimensions of the box. | |
| Box | linear_map (const Eigen::Matrix< zono_float, -1, -1 > &A) const |
| Linear map of box based on interval arithmetic. | |
| Box | linear_map (const Eigen::SparseMatrix< zono_float, Eigen::RowMajor > &A) const |
| Linear map of box based on interval arithmetic. | |
| Interval | dot (const Eigen::Vector< zono_float, -1 > &x) const |
| Linear map with vector. | |
| void | permute (const Eigen::PermutationMatrix< Eigen::Dynamic, Eigen::Dynamic > &P) |
| Permutes in place using permutation matrix, i.e., [x] <- P*[x]. | |
| std::string | print () const |
| Print method. | |
Protected Attributes | |
| Eigen::Vector< zono_float, -1 > | x_lb |
| vector of lower bounds | |
| Eigen::Vector< zono_float, -1 > | x_ub |
| vector of upper bounds | |
Friends | |
| std::ostream & | operator<< (std::ostream &os, const Box &box) |
| print to ostream | |
Box (i.e., interval vector) class.
|
default |
Default constructor.
|
explicit |
Default construct with size specified.
| size | dimension of box |
|
explicit |
Constructor using vector of intervals.
| vals | vector of intervals |
| ZonoOpt::Box::Box | ( | const Eigen::Vector< zono_float, -1 > & | x_lb, |
| const Eigen::Vector< zono_float, -1 > & | x_ub | ||
| ) |
Constructor from intervals of lower and upper bounds.
| x_lb | vector of lower bounds |
| x_ub | vector of upper bounds |
|
virtualdefault |
Virtual destructor.
| Eigen::Vector< zono_float, -1 > ZonoOpt::Box::center | ( | ) | const |
get center of box
|
virtual |
Clone operation.
| bool ZonoOpt::Box::contract | ( | const Eigen::SparseMatrix< zono_float, Eigen::RowMajor > & | A, |
| const Eigen::Vector< zono_float, -1 > & | b, | ||
| int | iter | ||
| ) |
Interval contractor.
| A | constraint matrix (row-major) |
| b | constraint vector |
| iter | number of contractor iterations |
Executes a forward-backward interval contractor for the equality constraint A*x=b. For points x in the box, this shrinks the box without removing any points x that satisfy A*x=b. If the contractor detects that the box does not intersect A*x=b, then this function will return false.
| bool ZonoOpt::Box::contract_subset | ( | const Eigen::SparseMatrix< zono_float, Eigen::RowMajor > & | A_rm, |
| const Eigen::Vector< zono_float, -1 > & | b, | ||
| int | iter, | ||
| const Eigen::SparseMatrix< zono_float > & | A, | ||
| const std::set< int > & | inds, | ||
| int | tree_search_depth | ||
| ) |
Interval contractor over a subset of the dimensions of the box.
| A_rm | constraint matrix, row major |
| b | constraint vector |
| iter | number of contractor iterations |
| A | constraint matrix, column major |
| inds | box dimension indices |
| tree_search_depth | how deep to search constraint tree |
This is a forward-backward contractor over a subset of the dimensions of the box. This detects what other dimensions are affected up to a specified search depth prior to executing the contractor.
| Interval ZonoOpt::Box::dot | ( | const Eigen::Vector< zono_float, -1 > & | x | ) | const |
| Box ZonoOpt::Box::linear_map | ( | const Eigen::Matrix< zono_float, -1, -1 > & | A | ) | const |
Linear map of box based on interval arithmetic.
| A | map matrix (dense) |
| Box ZonoOpt::Box::linear_map | ( | const Eigen::SparseMatrix< zono_float, Eigen::RowMajor > & | A | ) | const |
Linear map of box based on interval arithmetic.
| A | map matrix (sparse row major) |
|
inline |
Get lower bounds.
elementwise multiplication
| other | rhs box |
| Box ZonoOpt::Box::operator* | ( | zono_float | alpha | ) | const |
elementwise multiplication with scalar
| alpha | scalar multiplier |
elementwise addition
| other | rhs box |
elementwise subtraction
| other | rhs box |
elementwise division
| other | rhs box |
| IntervalView ZonoOpt::Box::operator[] | ( | size_t | i | ) |
Element-wise access, used for assignment.
| i | index |
| Interval ZonoOpt::Box::operator[] | ( | size_t | i | ) | const |
| void ZonoOpt::Box::permute | ( | const Eigen::PermutationMatrix< Eigen::Dynamic, Eigen::Dynamic > & | P | ) |
Permutes in place using permutation matrix, i.e., [x] <- P*[x].
| P | permutation matrix |
| std::string ZonoOpt::Box::print | ( | ) | const |
Print method.
|
virtual |
Projects vector onto the Box.
| x | vector reference |
| size_t ZonoOpt::Box::size | ( | ) | const |
get size of Box object
|
inline |
Get upper bounds.
| zono_float ZonoOpt::Box::width | ( | ) | const |
Get width of box.
Specifically, this returns the sum of the widths of each interval in the box
|
friend |
print to ostream
| os | ostream |
| box | reference to box |
|
protected |
vector of lower bounds
|
protected |
vector of upper bounds