ZonoOpt 2.2.0
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | List of all members
ZonoOpt::MI_Box Class Referencefinal

Mixed-integer box. More...

#include <Box.hpp>

Inheritance diagram for ZonoOpt::MI_Box:
Inheritance graph
[legend]
Collaboration diagram for ZonoOpt::MI_Box:
Collaboration graph
[legend]

Public Member Functions

 MI_Box ()=default
 default constructor
 
 MI_Box (const Eigen::Vector< zono_float, -1 > &x_lb, const Eigen::Vector< zono_float, -1 > &x_ub, const std::pair< int, int > &idx_b, bool zero_one_form)
 Constructor for MI_Box.
 
Boxclone () const override
 Clone operation.
 
void project (Eigen::Ref< Eigen::Vector< zono_float, -1 > > x) const override
 Projects vector onto the Box.
 
const std::pair< int, int > & binary_indices () const
 Get binary indices.
 
- Public Member Functions inherited from ZonoOpt::Box
 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< Intervalto_array () const
 Convert to vector of intervals.
 
virtual ~Box ()=default
 Virtual destructor.
 
Boxoperator= (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.
 
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 Member Functions

bool contract_helper (const Eigen::SparseMatrix< zono_float, Eigen::RowMajor > &A, const Eigen::Vector< zono_float, -1 > &b, const int iter, const std::set< int > &constraints) override
 Back-end for contractor.
 

Additional Inherited Members

- Protected Attributes inherited from ZonoOpt::Box
Eigen::Vector< zono_float, -1 > x_lb
 vector of lower bounds
 
Eigen::Vector< zono_float, -1 > x_ub
 vector of upper bounds
 

Detailed Description

Mixed-integer box.

Extends Box class to include variables for which may only take their upper or lower bound (they may not take any value on the interior).

Constructor & Destructor Documentation

◆ MI_Box() [1/2]

ZonoOpt::MI_Box::MI_Box ( )
default

default constructor

◆ MI_Box() [2/2]

ZonoOpt::MI_Box::MI_Box ( const Eigen::Vector< zono_float, -1 > &  x_lb,
const Eigen::Vector< zono_float, -1 > &  x_ub,
const std::pair< int, int > &  idx_b,
bool  zero_one_form 
)

Constructor for MI_Box.

Parameters
x_lbvector of lower bounds
x_ubvector of upper bounds
idx_bindices of binary variables {start index, number of binaries}
zero_one_formflag indicating whether binary variables are in {0,1} form (true) or {-1,1} form (false)

Member Function Documentation

◆ binary_indices()

const std::pair< int, int > & ZonoOpt::MI_Box::binary_indices ( ) const
inline

Get binary indices.

Returns
reference to binary indices {start index, number of binaries}

◆ clone()

Box * ZonoOpt::MI_Box::clone ( ) const
overridevirtual

Clone operation.

Returns
pointer to newly created object

Reimplemented from ZonoOpt::Box.

◆ contract_helper()

bool ZonoOpt::MI_Box::contract_helper ( const Eigen::SparseMatrix< zono_float, Eigen::RowMajor > &  A,
const Eigen::Vector< zono_float, -1 > &  b,
const int  iter,
const std::set< int > &  constraints 
)
overrideprotectedvirtual

Back-end for contractor.

Parameters
Aconstraint matrix (row-major)
bconstraint vector
iternumber of contractor iterations
constraintsconstraints to consider
Returns
flag indicating that the contractor did not detect that A*x=b and the box do not intersect

Reimplemented from ZonoOpt::Box.

◆ project()

void ZonoOpt::MI_Box::project ( Eigen::Ref< Eigen::Vector< zono_float, -1 > >  x) const
overridevirtual

Projects vector onto the Box.

Parameters
xvector reference

Reimplemented from ZonoOpt::Box.


The documentation for this class was generated from the following files: