ZonoOpt 2.4.0
Loading...
Searching...
No Matches
Classes | Typedefs | Functions
ZonoOpt Namespace Reference

Classes

class  Box
 Box (i.e., interval vector) class. More...
 
class  ConZono
 Constrained zonotope class. More...
 
class  EmptySet
 Empty Set class. More...
 
struct  ExternalSolverResults
 Abstract base for external-solver-specific solution metadata. More...
 
struct  GurobiSettings
 Settings for the dynamically-loaded Gurobi solver backend. More...
 
struct  GurobiSolverResults
 Solver-native solution metadata produced by the Gurobi backend. More...
 
class  HybZono
 Hybrid zonotope class. More...
 
class  Interval
 Interval class. More...
 
class  IntervalMatrix
 Class for interval matrices (i.e., every element of the matrix is an interval) More...
 
class  MI_Box
 Mixed-integer box. More...
 
struct  OptSettings
 Settings for the internal ZonoOpt ADMM / branch-and-bound solver. More...
 
struct  OptSolution
 Solution data structure for optimization routines in ZonoOpt library. More...
 
class  Point
 Point class. More...
 
struct  SCIPSettings
 Settings for the dynamically-loaded SCIP solver backend. More...
 
struct  SCIPSolverResults
 Solver-native solution metadata produced by the SCIP backend. More...
 
struct  SolverSettings
 Abstract base for all solver settings. More...
 
struct  WarmStartParams
 Warm start parameters for optimization routines in ZonoOpt library. More...
 
class  Zono
 Zonotope class. More...
 

Typedefs

using json = nlohmann::json
 
typedef std::unique_ptr< HybZonoZonoPtr
 Type alias for a unique pointer to a (polymorphic) HybZono object. <>
 

Functions

std::unique_ptr< HybZonoaffine_inclusion (const HybZono &Z, const IntervalMatrix &R, const Eigen::Vector< zono_float, -1 > &s=Eigen::Vector< zono_float, -1 >())
 Returns inclusion of zonotopic set for uncertain affine map R*Z + s.
 
std::unique_ptr< HybZonoaffine_map (const HybZono &Z, const Eigen::SparseMatrix< zono_float > &R, const Eigen::Vector< zono_float, -1 > &s=Eigen::Vector< zono_float, -1 >())
 Returns affine map R*Z + s of set Z.
 
std::unique_ptr< HybZonocartesian_product (const HybZono &Z1, HybZono &Z2)
 Computes the Cartesian product of two sets Z1 and Z2.
 
std::unique_ptr< HybZonoconstrain (HybZono &Z, const Eigen::SparseMatrix< zono_float > &H, const Eigen::Vector< zono_float, -1 > &f, char direction, const Eigen::SparseMatrix< zono_float > &R=Eigen::SparseMatrix< zono_float >())
 Computes the generalized intersection of set Z with H*x <= f, H*x >= f, or H*x = f over matrix R.
 
std::unique_ptr< ConZonoconvex_hull (const std::vector< std::shared_ptr< HybZono > > &Zs, bool exact=true)
 Computes convex hull of several sets.
 
std::unique_ptr< HybZonofrom_json (const std::string &filename)
 Read a HybZono object from a JSON file.
 
const SolverSettingsget_default_solver_settings ()
 Returns a reference to the current program-wide default solver settings.
 
std::unique_ptr< HybZonohalfspace_intersection (HybZono &Z, const Eigen::SparseMatrix< zono_float > &H, const Eigen::Vector< zono_float, -1 > &f, const Eigen::SparseMatrix< zono_float > &R=Eigen::SparseMatrix< zono_float >())
 Computes the intersection generalized intersection of set Z with halfspace H*x <= f over matrix R.
 
std::unique_ptr< HybZonointersection (const HybZono &Z1, HybZono &Z2, const Eigen::SparseMatrix< zono_float > &R=Eigen::SparseMatrix< zono_float >())
 Computes the generalized intersection of sets Z1 and Z2 over the matrix R.
 
std::unique_ptr< HybZonointersection_over_dims (const HybZono &Z1, HybZono &Z2, const std::vector< int > &dims)
 Computes the generalized intersection of sets Z1 and Z2 over the specified dimensions.
 
std::unique_ptr< Zonointerval_2_zono (const Box &box)
 Builds a zonotope from a Box object.
 
std::unique_ptr< Zonomake_regular_zono_2D (zono_float radius, int n_sides, bool outer_approx=false, const Eigen::Vector< zono_float, 2 > &c=Eigen::Vector< zono_float, 2 >::Zero())
 Builds a 2D regular zonotope with a given radius and number of sides.
 
std::unique_ptr< HybZonominkowski_sum (const HybZono &Z1, HybZono &Z2)
 Computes Minkowski sum of two sets Z1 and Z2.
 
std::unique_ptr< HybZonooperator* (const Box &box, HybZono &Z)
 
Box operator* (const Eigen::Matrix< zono_float, -1, -1 > &A, const Box &box)
 
IntervalMatrix operator* (const Eigen::Matrix< zono_float, -1, -1 > &A, const IntervalMatrix &B)
 
std::unique_ptr< HybZonooperator* (const Eigen::Matrix< zono_float, -1, -1 > &R, const HybZono &Z)
 
std::unique_ptr< HybZonooperator* (const Eigen::SparseMatrix< zono_float > &R, const HybZono &Z)
 
Box operator* (const Eigen::SparseMatrix< zono_float, Eigen::RowMajor > &A, const Box &box)
 
IntervalMatrix operator* (const Eigen::SparseMatrix< zono_float, Eigen::RowMajor > &A, const IntervalMatrix &B)
 
Box operator* (const Eigen::Vector< zono_float, -1 > &v, const Box &box)
 
Box operator* (const Interval &interval, const Box &box)
 
IntervalMatrix operator* (const Interval &interval, const IntervalMatrix &A)
 
std::unique_ptr< HybZonooperator* (const IntervalMatrix &R, const HybZono &Z)
 
Interval operator* (const zono_float alpha, const Interval &interval)
 
Box operator* (zono_float alpha, const Box &box)
 
IntervalMatrix operator* (zono_float alpha, const IntervalMatrix &A)
 
std::unique_ptr< HybZonooperator* (zono_float f, const HybZono &Z)
 
std::unique_ptr< HybZonooperator+ (const Box &box, HybZono &Z)
 
Box operator+ (const Eigen::Vector< zono_float, -1 > &v, const Box &box)
 
std::unique_ptr< HybZonooperator+ (const Eigen::Vector< zono_float, -1 > &v, HybZono &Z)
 
IntervalMatrix operator+ (const Interval &interval, const IntervalMatrix &mat)
 
Interval operator+ (const zono_float alpha, const Interval &interval)
 
IntervalMatrix operator+ (zono_float alpha, const IntervalMatrix &A)
 
Box operator- (const Eigen::Vector< zono_float, -1 > &v, const Box &box)
 
IntervalMatrix operator- (const Interval &interval, const IntervalMatrix &mat)
 
Interval operator- (const zono_float alpha, const Interval &interval)
 
IntervalMatrix operator- (zono_float alpha, const IntervalMatrix &A)
 
Box operator/ (const Interval &interval, const Box &box)
 
IntervalMatrix operator/ (const Interval &interval, const IntervalMatrix &A)
 
Interval operator/ (const zono_float alpha, const Interval &interval)
 
Box operator/ (zono_float alpha, const Box &box)
 
IntervalMatrix operator/ (zono_float alpha, const IntervalMatrix &A)
 
std::ostream & operator<< (std::ostream &os, const Box &box)
 
std::ostream & operator<< (std::ostream &os, const HybZono &Z)
 
std::ostream & operator<< (std::ostream &os, const Interval &interval)
 
std::ostream & operator<< (std::ostream &os, const IntervalMatrix &interval_matrix)
 
int perturb_binaries (const MI_Box &x_box, const Eigen::Ref< const Eigen::Vector< zono_float, -1 > > xk, Eigen::Ref< Eigen::Vector< zono_float, -1 > > zk, const bool restart, std::mt19937 &rand_gen)
 
std::unique_ptr< HybZonopontry_diff (HybZono &Z1, Zono &Z2, bool exact=true)
 Computes the Pontryagin difference Z1 - Z2.
 
std::unique_ptr< HybZonoproject_onto_dims (const HybZono &Z, const std::vector< int > &dims)
 Projects set Z onto the dimensions specified in dims.
 
void set_default_solver_settings (const SolverSettings &settings)
 Replaces the program-wide default solver settings with a polymorphic copy of settings.
 
std::unique_ptr< HybZonoset_diff (const HybZono &Z1, HybZono &Z2, zono_float delta_m=100, bool remove_redundancy=true, const SolverSettings &settings=get_default_solver_settings(), std::shared_ptr< OptSolution > *solution=nullptr, int n_leaves=std::numeric_limits< int >::max(), int contractor_iter=10)
 Set difference Z1 \ Z2.
 
void to_json (const HybZono &Z, const std::string &filename)
 Write a HybZono object to a JSON file.
 
std::unique_ptr< HybZonounion_of_many (const std::vector< std::shared_ptr< HybZono > > &Zs, bool preserve_sharpness=false, bool expose_indicators=false)
 Computes union of several sets.
 
std::unique_ptr< ConZonovrep_2_conzono (const Eigen::Matrix< zono_float, -1, -1 > &Vpoly)
 Builds a constrained zonotope from a vertex representation polytope.
 
std::unique_ptr< HybZonovrep_2_hybzono (const std::vector< Eigen::Matrix< zono_float, -1, -1 > > &Vpolys, bool expose_indicators=false)
 Computes a hybrid zonotope from a union of vertex representation polytopes.
 
std::unique_ptr< HybZonozono_union_2_hybzono (std::vector< std::shared_ptr< Zono > > &Zs, bool expose_indicators=false)
 Computes a hybrid zonotope from a union of zonotopes.
 

Typedef Documentation

◆ json

using ZonoOpt::json = typedef nlohmann::json

Function Documentation

◆ get_default_solver_settings()

const SolverSettings & ZonoOpt::get_default_solver_settings ( )
inline

Returns a reference to the current program-wide default solver settings.

The returned reference is valid until the next call to set_default_solver_settings().

◆ operator*() [1/15]

std::unique_ptr< HybZono > ZonoOpt::operator* ( const Box box,
HybZono Z 
)
Parameters
box
Z
Returns
std::unique_ptr<HybZono>

◆ operator*() [2/15]

Box ZonoOpt::operator* ( const Eigen::Matrix< zono_float, -1, -1 > &  A,
const Box box 
)
Parameters
Amatrix to multiply
Returns
enclosure of A * this

◆ operator*() [3/15]

IntervalMatrix ZonoOpt::operator* ( const Eigen::Matrix< zono_float, -1, -1 > &  A,
const IntervalMatrix B 
)
Parameters
Alhs matrix
Brhs interval matrix
Returns
resulting interval matrix
Exceptions
std::invalid_argumentif A's column count does not match B's row count.

◆ operator*() [4/15]

std::unique_ptr< HybZono > ZonoOpt::operator* ( const Eigen::Matrix< zono_float, -1, -1 > &  R,
const HybZono Z 
)
Parameters
R
Z
Returns
std::unique_ptr<HybZono>
Exceptions
std::invalid_argumentif R's column count does not match Z's dimension.

◆ operator*() [5/15]

std::unique_ptr< HybZono > ZonoOpt::operator* ( const Eigen::SparseMatrix< zono_float > &  R,
const HybZono Z 
)
Parameters
R
Z
Returns
std::unique_ptr<HybZono>
Exceptions
std::invalid_argumentif R's column count does not match Z's dimension.

◆ operator*() [6/15]

Box ZonoOpt::operator* ( const Eigen::SparseMatrix< zono_float, Eigen::RowMajor > &  A,
const Box box 
)
Parameters
Amatrix to multiply
Returns
enclosure of A * this

◆ operator*() [7/15]

IntervalMatrix ZonoOpt::operator* ( const Eigen::SparseMatrix< zono_float, Eigen::RowMajor > &  A,
const IntervalMatrix B 
)
Parameters
Alhs matrix
Brhs interval matrix
Returns
resulting interval matrix
Exceptions
std::invalid_argumentif A's column count does not match B's row count.

◆ operator*() [8/15]

Box ZonoOpt::operator* ( const Eigen::Vector< zono_float, -1 > &  v,
const Box box 
)
Parameters
vvector to multiply
boxbox to multiply
Returns
enclosure of v * box (elementwise)
Exceptions
std::invalid_argumentif v does not have the same size as the Box.

◆ operator*() [9/15]

Box ZonoOpt::operator* ( const Interval interval,
const Box box 
)
Parameters
intervalinterval to multiply
boxbox to multiply
Returns
enclosure of interval * box (elementwise)

◆ operator*() [10/15]

IntervalMatrix ZonoOpt::operator* ( const Interval interval,
const IntervalMatrix A 
)
Parameters
intervalinterval to multiply
Ainterval matrix
Returns
resulting interval matrix

◆ operator*() [11/15]

std::unique_ptr< HybZono > ZonoOpt::operator* ( const IntervalMatrix R,
const HybZono Z 
)
Parameters
R
Z
Returns
std::unique_ptr<HybZono>
Exceptions
std::invalid_argumentif R's column count does not match Z's dimension.

◆ operator*() [12/15]

Interval ZonoOpt::operator* ( const zono_float  alpha,
const Interval interval 
)
Parameters
alphascalar
intervalinterval
Returns
enclosure of alpha * interval

◆ operator*() [13/15]

Box ZonoOpt::operator* ( zono_float  alpha,
const Box box 
)
Parameters
alphascalar multiplier
boxbox to multiply
Returns
enclosure of alpha * box (elementwise)

◆ operator*() [14/15]

IntervalMatrix ZonoOpt::operator* ( zono_float  alpha,
const IntervalMatrix A 
)
Parameters
alphascalar multiplier
Ainterval matrix
Returns
resulting interval matrix

◆ operator*() [15/15]

std::unique_ptr< HybZono > ZonoOpt::operator* ( zono_float  f,
const HybZono Z 
)
Parameters
f
Z
Returns
std::unique_ptr<HybZono>

◆ operator+() [1/6]

std::unique_ptr< HybZono > ZonoOpt::operator+ ( const Box box,
HybZono Z 
)
Parameters
box
Z
Returns
std::unique_ptr<HybZono>
Exceptions
std::invalid_argumentif box does not have the same dimension as Z.

◆ operator+() [2/6]

Box ZonoOpt::operator+ ( const Eigen::Vector< zono_float, -1 > &  v,
const Box box 
)
Parameters
vvector to add
boxbox to add
Returns
enclosure of v + box (elementwise)
Exceptions
std::invalid_argumentif v does not have the same size as the Box.

◆ operator+() [3/6]

std::unique_ptr< HybZono > ZonoOpt::operator+ ( const Eigen::Vector< zono_float, -1 > &  v,
HybZono Z 
)
Parameters
v
Z
Returns
std::unique_ptr<HybZono>
Exceptions
std::invalid_argumentif v does not have the same dimension as Z.

◆ operator+() [4/6]

IntervalMatrix ZonoOpt::operator+ ( const Interval interval,
const IntervalMatrix mat 
)
Parameters
intervalinterval to add
matinterval matrix
Returns
resulting interval matrix

◆ operator+() [5/6]

Interval ZonoOpt::operator+ ( const zono_float  alpha,
const Interval interval 
)
Parameters
alphascalar
intervalinterval
Returns
enclosure of alpha + interval

◆ operator+() [6/6]

IntervalMatrix ZonoOpt::operator+ ( zono_float  alpha,
const IntervalMatrix A 
)
Parameters
alphascalar to add
Ainterval matrix
Returns
resulting interval matrix

◆ operator-() [1/4]

Box ZonoOpt::operator- ( const Eigen::Vector< zono_float, -1 > &  v,
const Box box 
)
Parameters
vvector
boxbox to subtract
Returns
enclosure of v - box (elementwise)
Exceptions
std::invalid_argumentif v does not have the same size as the Box.

◆ operator-() [2/4]

IntervalMatrix ZonoOpt::operator- ( const Interval interval,
const IntervalMatrix mat 
)
Parameters
intervalinterval
matinterval matrix to subtract
Returns
resulting interval matrix

◆ operator-() [3/4]

Interval ZonoOpt::operator- ( const zono_float  alpha,
const Interval interval 
)
Parameters
alphascalar
intervalinterval
Returns
enclosure of alpha - interval

◆ operator-() [4/4]

IntervalMatrix ZonoOpt::operator- ( zono_float  alpha,
const IntervalMatrix A 
)
Parameters
alphascalar
Ainterval matrix to subtract
Returns
resulting interval matrix

◆ operator/() [1/5]

Box ZonoOpt::operator/ ( const Interval interval,
const Box box 
)
Parameters
intervalinterval
boxbox to divide
Returns
enclosure of interval / box (elementwise)

◆ operator/() [2/5]

IntervalMatrix ZonoOpt::operator/ ( const Interval interval,
const IntervalMatrix A 
)
Parameters
intervalinterval
Amatrix to divide
Returns
resulting interval matrix (interval / this)

◆ operator/() [3/5]

Interval ZonoOpt::operator/ ( const zono_float  alpha,
const Interval interval 
)
Parameters
alphascalar
intervalinterval
Returns
enclosure of alpha / interval

◆ operator/() [4/5]

Box ZonoOpt::operator/ ( zono_float  alpha,
const Box box 
)
Parameters
alphascalar divisor
boxbox to divide
Returns
enclosure of alpha / box (elementwise)

◆ operator/() [5/5]

IntervalMatrix ZonoOpt::operator/ ( zono_float  alpha,
const IntervalMatrix A 
)
Parameters
alphascalar
Amatrix to divide
Returns
resulting interval matrix (alpha / this)

◆ operator<<() [1/4]

std::ostream & ZonoOpt::operator<< ( std::ostream &  os,
const Box box 
)
Parameters
osostream
boxreference to box
Returns
ostream

◆ operator<<() [2/4]

std::ostream & ZonoOpt::operator<< ( std::ostream &  os,
const HybZono Z 
)
Parameters
os
Z

◆ operator<<() [3/4]

std::ostream & ZonoOpt::operator<< ( std::ostream &  os,
const Interval interval 
)
Parameters
os
interval
Returns
ostream reference

◆ operator<<() [4/4]

std::ostream & ZonoOpt::operator<< ( std::ostream &  os,
const IntervalMatrix interval_matrix 
)
Parameters
osostream
interval_matrixreference to interval matrix
Returns
ostream

◆ perturb_binaries()

int ZonoOpt::perturb_binaries ( const MI_Box x_box,
const Eigen::Ref< const Eigen::Vector< zono_float, -1 > >  xk,
Eigen::Ref< Eigen::Vector< zono_float, -1 > >  zk,
const bool  restart,
std::mt19937 &  rand_gen 
)

◆ set_default_solver_settings()

void ZonoOpt::set_default_solver_settings ( const SolverSettings settings)
inline

Replaces the program-wide default solver settings with a polymorphic copy of settings.

After this call, any ZonoOpt optimization method invoked without an explicit settings argument will use a freshly resolved reference to the new default.

Exceptions
std::runtime_errorif the backend selected by settings cannot be initialized (e.g., a GurobiSettings whose Gurobi library cannot be dynamically loaded). The existing default is left unchanged on throw.