|
ZonoOpt 2.2.0
|
Box (i.e., interval vector) class. More...
#include <Box.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< Interval, -1 > &vals) | |
| Constructor using Eigen 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. | |
| std::vector< Interval > | to_array () const |
| Convert to vector of intervals. | |
| virtual | ~Box ()=default |
| Virtual destructor. | |
| Box & | operator= (const Box &other) |
| Copy assignment. | |
| Box (const Box &other) | |
| Copy constructor. | |
| Interval | get_element (int i) const |
| Element-wise access. | |
| void | set_element (int i, const Interval &val) |
| Element-wise assignment. | |
| 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. | |
| Box | radius () const |
| Get radius of box. | |
| Eigen::Vector< zono_float, -1 > | center () const |
| Get center of box. | |
| Box | intersect (const Box &other) const |
| Box intersection. | |
| Box | interval_hull (const Box &other) const |
| Box interval hull. | |
| bool | contains (const Eigen::Vector< zono_float, -1 > &v) |
| Check vector continment. | |
| bool | contains_set (const Box &other) const |
| Check set containment. | |
| Box | operator+ (const Box &other) const |
| Elementwise addition. | |
| void | operator+= (const Box &other) |
| Elementwise addition in-place. | |
| Box | operator+ (const Eigen::Vector< zono_float, -1 > &v) const |
| Elementwise addition with vector. | |
| void | operator+= (const Eigen::Vector< zono_float, -1 > &v) |
| Elementwise addition with vector in-place. | |
| Box | operator- (const Box &other) const |
| Elementwise subtraction. | |
| void | operator-= (const Box &other) |
| Elementwise subtraction in-place. | |
| Box | operator- (const Eigen::Vector< zono_float, -1 > &v) const |
| Elementwise subtraction with vector. | |
| void | operator-= (const Eigen::Vector< zono_float, -1 > &v) |
| Elementwise subtraction with vector in-place. | |
| Box | operator* (const Box &other) const |
| Elementwise multiplication. | |
| void | operator*= (const Box &other) |
| Elementwise multiplication in-place. | |
| Box | operator* (zono_float alpha) const |
| Elementwise multiplication with scalar. | |
| void | operator*= (zono_float alpha) |
| Elementwise multiplication with scalar in-place. | |
| Box | operator* (const Eigen::Vector< zono_float, -1 > &v) const |
| Elementwise multiplication with vector. | |
| void | operator*= (const Eigen::Vector< zono_float, -1 > &v) |
| Elementwise multiplication with vector in-place. | |
| Box | operator* (const Interval &interval) const |
| Elementwise multiplication with interval. | |
| void | operator*= (const Interval &interval) |
| Elementwise multiplication with interval in-place. | |
| Box | operator/ (const Box &other) const |
| Elementwise division. | |
| void | operator/= (const Box &other) |
| Elementwise division in-place. | |
| Box | operator/ (zono_float alpha) const |
| Elementwise division with scalar. | |
| void | operator/= (zono_float alpha) |
| Elementwise division with scalar. | |
| Box | operator/ (const Interval &interval) const |
| Elementwise division with interval. | |
| void | operator/= (const Interval &interval) |
| Elementwise division with interval in-place. | |
| Box | operator- () const |
| Unary minus: returns -1 * this. | |
| Box | operator& (const Box &other) const |
| Box intersection. | |
| Box | operator| (const Box &other) const |
| Box interval hull. | |
| bool | operator<= (const Box &other) const |
| Set containment operator. | |
| bool | operator>= (const Box &other) const |
| Set containment operator. | |
| bool | operator== (const Box &other) const |
| Set equality operator. | |
| 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 | |
| class | MI_Box |
| Box | operator+ (const Eigen::Vector< zono_float, -1 > &v, const Box &box) |
| Elementwise addition with vector. | |
| Box | operator- (const Eigen::Vector< zono_float, -1 > &v, const Box &box) |
| Elementwise subtraction with vector. | |
| Box | operator* (zono_float alpha, const Box &box) |
| Elementwise multiplication with scalar. | |
| Box | operator* (const Eigen::Vector< zono_float, -1 > &v, const Box &box) |
| Elementwise multiplication with vector. | |
| Box | operator* (const Interval &interval, const Box &box) |
| Elementwise multiplication with interval. | |
| Box | operator* (const Eigen::SparseMatrix< zono_float, Eigen::RowMajor > &A, const Box &box) |
| Linear map. | |
| Box | operator* (const Eigen::Matrix< zono_float, -1, -1 > &A, const Box &box) |
| Linear map. | |
| Box | operator/ (zono_float alpha, const Box &box) |
| Elementwise division with scalar. | |
| Box | operator/ (const Interval &interval, const Box &box) |
| Elementwise division with interval. | |
| 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 |
|
explicit |
Constructor using Eigen vector of intervals.
| vals | Eigen 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 |
| bool ZonoOpt::Box::contains | ( | const Eigen::Vector< zono_float, -1 > & | v | ) |
Check vector continment.
| v | vector |
| bool ZonoOpt::Box::contains_set | ( | const Box & | other | ) | const |
Check set containment.
| other | box to check if subset |
| 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 |
| Interval ZonoOpt::Box::get_element | ( | int | i | ) | 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* | ( | const Eigen::Vector< zono_float, -1 > & | v | ) | const |
Elementwise multiplication with vector.
| v | vector to multiply |
Elementwise multiplication with interval.
| interval | interval to multiply |
| Box ZonoOpt::Box::operator* | ( | zono_float | alpha | ) | const |
Elementwise multiplication with scalar.
| alpha | scalar multiplier |
| void ZonoOpt::Box::operator*= | ( | const Box & | other | ) |
Elementwise multiplication in-place.
| other | other box |
| void ZonoOpt::Box::operator*= | ( | const Eigen::Vector< zono_float, -1 > & | v | ) |
Elementwise multiplication with vector in-place.
| v | vector to multiply |
| void ZonoOpt::Box::operator*= | ( | const Interval & | interval | ) |
Elementwise multiplication with interval in-place.
| interval | interval to multiply |
| void ZonoOpt::Box::operator*= | ( | zono_float | alpha | ) |
Elementwise multiplication with scalar in-place.
| alpha | scalar multiplier |
Elementwise addition.
| other | rhs box |
| Box ZonoOpt::Box::operator+ | ( | const Eigen::Vector< zono_float, -1 > & | v | ) | const |
Elementwise addition with vector.
| v | vector to add |
| box | box to add |
| void ZonoOpt::Box::operator+= | ( | const Box & | other | ) |
Elementwise addition in-place.
| other | other box |
| void ZonoOpt::Box::operator+= | ( | const Eigen::Vector< zono_float, -1 > & | v | ) |
Elementwise addition with vector in-place.
| v | vector |
| Box ZonoOpt::Box::operator- | ( | ) | const |
Unary minus: returns -1 * this.
Elementwise subtraction.
| other | rhs box |
| Box ZonoOpt::Box::operator- | ( | const Eigen::Vector< zono_float, -1 > & | v | ) | const |
Elementwise subtraction with vector.
| v | vector to subtract |
| void ZonoOpt::Box::operator-= | ( | const Box & | other | ) |
Elementwise subtraction in-place.
| other | other box |
| void ZonoOpt::Box::operator-= | ( | const Eigen::Vector< zono_float, -1 > & | v | ) |
Elementwise subtraction with vector in-place.
| v | vector to subtract |
Elementwise division.
| other | rhs box |
Elementwise division with interval.
| interval | interval to divide |
| Box ZonoOpt::Box::operator/ | ( | zono_float | alpha | ) | const |
Elementwise division with scalar.
| alpha | scalar divisor |
| void ZonoOpt::Box::operator/= | ( | const Box & | other | ) |
Elementwise division in-place.
| other | rhs box |
| void ZonoOpt::Box::operator/= | ( | const Interval & | interval | ) |
Elementwise division with interval in-place.
| interval | interval to divide |
| void ZonoOpt::Box::operator/= | ( | zono_float | alpha | ) |
Elementwise division with scalar.
| alpha | scalar divisor |
| bool ZonoOpt::Box::operator<= | ( | const Box & | other | ) | const |
Set containment operator.
| other |
| bool ZonoOpt::Box::operator== | ( | const Box & | other | ) | const |
Set equality operator.
| other |
| bool ZonoOpt::Box::operator>= | ( | const Box & | other | ) | const |
Set containment operator.
| other |
| 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 |
| Box ZonoOpt::Box::radius | ( | ) | const |
Get radius of box.
Returns box with intervals centered at zero with width equal to the width of the original box
| void ZonoOpt::Box::set_element | ( | int | i, |
| const Interval & | val | ||
| ) |
Element-wise assignment.
| i | index |
| val | interval to assign |
| size_t ZonoOpt::Box::size | ( | ) | const |
Get size of Box object.
| std::vector< Interval > ZonoOpt::Box::to_array | ( | ) | const |
Convert to vector of intervals.
|
inline |
Get upper bounds.
| zono_float ZonoOpt::Box::width | ( | ) | const |
Get width of box.
Specifically, this returns the max width for any interval in the box
|
friend |
|
friend |
Linear map.
| A | matrix to multiply |
|
friend |
Linear map.
| A | matrix to multiply |
|
friend |
Elementwise multiplication with vector.
| v | vector to multiply |
| box | box to multiply |
Elementwise multiplication with interval.
| interval | interval to multiply |
| box | box to multiply |
|
friend |
Elementwise multiplication with scalar.
| alpha | scalar multiplier |
| box | box to multiply |
|
friend |
Elementwise addition with vector.
| v | vector to add |
| box | box to add |
|
friend |
Elementwise subtraction with vector.
| v | vector |
| box | box to subtract |
Elementwise division with interval.
| interval | interval |
| box | box to divide |
|
friend |
Elementwise division with scalar.
| alpha | scalar divisor |
| box | box to divide |
|
friend |
print to ostream
| os | ostream |
| box | reference to box |
|
protected |
vector of lower bounds
|
protected |
vector of upper bounds