|
ZonoOpt 2.4.1
|
Hybrid zonotope class. More...
#include <HybZono.hpp>

Public Member Functions | |
| Box | bounding_box (const SolverSettings &settings=get_default_solver_settings(), std::shared_ptr< OptSolution > *solution=nullptr, const WarmStartParams &warm_start_params=WarmStartParams()) |
| Computes a bounding box of the set object as a Box object. | |
| virtual HybZono * | clone () const |
| Clone method for polymorphic behavior. | |
| virtual std::unique_ptr< HybZono > | complement (const zono_float delta_m=100, const bool remove_redundancy=true, const SolverSettings &settings=get_default_solver_settings(), std::shared_ptr< OptSolution > *solution=nullptr, const int n_leaves=std::numeric_limits< int >::max(), const int contractor_iter=10) |
| Computes the complement of the set Z. | |
| bool | contains_point (const Eigen::Vector< zono_float, -1 > &x, const SolverSettings &settings=get_default_solver_settings(), std::shared_ptr< OptSolution > *solution=nullptr, const WarmStartParams &warm_start_params=WarmStartParams()) const |
| Checks whether the point x is contained in the set object. | |
| virtual void | convert_form () |
| Converts the set representation between -1-1 and 0-1 forms. | |
| virtual std::unique_ptr< ConZono > | convex_relaxation () const |
| Returns convex relaxation of the hybrid zonotope. | |
| virtual Eigen::SparseMatrix< zono_float > | get_A () const |
| Returns constraint matrix. | |
| virtual Eigen::SparseMatrix< zono_float > | get_Ab () const |
| Returns binary constraint matrix. | |
| virtual Eigen::SparseMatrix< zono_float > | get_Ac () const |
| Returns continuous constraint matrix. | |
| virtual Eigen::Vector< zono_float, -1 > | get_b () const |
| Returns constraint vector. | |
| virtual Eigen::Vector< zono_float, -1 > | get_c () const |
| Returns center vector. | |
| virtual Eigen::SparseMatrix< zono_float > | get_G () const |
| Returns generator matrix. | |
| virtual Eigen::SparseMatrix< zono_float > | get_Gb () const |
| Returns binary generator matrix. | |
| virtual Eigen::SparseMatrix< zono_float > | get_Gc () const |
| Returns continuous generator matrix. | |
| std::vector< std::unique_ptr< ConZono > > | get_leaves (bool remove_redundancy=false, 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) const |
| Computes individual constrained zonotopes whose union is the hybrid zonotope object. | |
| virtual int | get_n () const |
| Returns dimension of set. | |
| virtual int | get_nC () const |
| Returns number of constraints in set definition. | |
| virtual int | get_nG () const |
| Returns number of generators in set definition. | |
| virtual int | get_nGb () const |
| Returns number of binary generators in set definition. | |
| virtual int | get_nGc () const |
| Returns number of continuous generators in set definition. | |
| HybZono ()=default | |
| Default constructor for HybZono class. | |
| HybZono (const Eigen::SparseMatrix< zono_float > &Gc, const Eigen::SparseMatrix< zono_float > &Gb, const Eigen::Vector< zono_float, -1 > &c, const Eigen::SparseMatrix< zono_float > &Ac, const Eigen::SparseMatrix< zono_float > &Ab, const Eigen::Vector< zono_float, -1 > &b, const bool zero_one_form=false, const bool sharp=false) | |
| HybZono constructor. | |
| virtual bool | is_0_1_form () const |
| Returns true if factors are in range [0,1], false if they are in range [-1,1]. | |
| bool | is_conzono () const |
| Polymorphic type checking: true if set is a constrained zonotope. | |
| bool | is_empty (const SolverSettings &settings=get_default_solver_settings(), std::shared_ptr< OptSolution > *solution=nullptr, const WarmStartParams &warm_start_params=WarmStartParams()) const |
| Returns true if the set is provably empty, false otherwise. | |
| bool | is_empty_set () const |
| Polymorphic type checking: true if set is empty set object. | |
| bool | is_hybzono () const |
| Polymorphic type checking: true if set is a hybrid zonotope. | |
| bool | is_point () const |
| Polymorphic type checking: true if set is a point. | |
| bool | is_sharp () const |
| Returns true if set is known to be sharp. | |
| bool | is_zono () const |
| Polymorphic type checking: true if set is a zonotope. | |
| std::unique_ptr< HybZono > | operator& (HybZono &other) const |
| intersection | |
| std::unique_ptr< HybZono > | operator* (const Box &box) const |
| cartesian product with box | |
| std::unique_ptr< HybZono > | operator* (HybZono &other) const |
| cartesian product | |
| std::unique_ptr< HybZono > | operator* (zono_float f) const |
| scalar multiplication: returns f*Z | |
| void | operator*= (const Box &box) |
| in-place cartesian product with box | |
| void | operator*= (HybZono &other) |
| in-place cartesian product | |
| void | operator*= (zono_float f) |
| scalar multiplication in place | |
| std::unique_ptr< HybZono > | operator+ (const Box &box) const |
| minkowski sum with box | |
| std::unique_ptr< HybZono > | operator+ (const Eigen::Vector< zono_float, -1 > &v) const |
| minkowski sum with point | |
| std::unique_ptr< HybZono > | operator+ (HybZono &other) const |
| minkowski sum | |
| void | operator+= (const Box &box) |
| in-place minkowski sum with box | |
| void | operator+= (const Eigen::Vector< zono_float, -1 > &v) |
| in-place minkowski sum with point | |
| void | operator+= (HybZono &other) |
| in-place minkowski sum | |
| std::unique_ptr< HybZono > | operator- () const |
| unary minus: returns -I * this | |
| std::unique_ptr< HybZono > | operator- (const Box &box) |
| pontryagin difference with box | |
| std::unique_ptr< HybZono > | operator- (const Eigen::Vector< zono_float, -1 > &v) |
| pontryagin difference with point | |
| std::unique_ptr< HybZono > | operator- (Zono &other) |
| pontryagin difference | |
| void | operator-= (const Box &box) |
| in-place pontryagin difference with box | |
| void | operator-= (const Eigen::Vector< zono_float, -1 > &v) |
| in-place pontryagin difference with point | |
| void | operator-= (Zono &other) |
| in-place pontryagin difference | |
| std::unique_ptr< HybZono > | operator| (HybZono &other) const |
| union | |
| Eigen::Vector< zono_float, -1 > | optimize_over (const Eigen::SparseMatrix< zono_float > &P, const Eigen::Vector< zono_float, -1 > &q, zono_float c=0, const SolverSettings &settings=get_default_solver_settings(), std::shared_ptr< OptSolution > *solution=nullptr, const WarmStartParams &warm_start_params=WarmStartParams()) const |
| Solves optimization problem with quadratic objective over the current set. | |
| virtual std::string | print () const |
| Returns set information as a string. | |
| Eigen::Vector< zono_float, -1 > | project_point (const Eigen::Vector< zono_float, -1 > &x, const SolverSettings &settings=get_default_solver_settings(), std::shared_ptr< OptSolution > *solution=nullptr, const WarmStartParams &warm_start_params=WarmStartParams()) const |
| Returns the projection of the point x onto the set object. | |
| virtual std::unique_ptr< HybZono > | remove_redundancy (int contractor_iter=10) const |
| Removes redundant constraints and any unused generators. | |
| void | set (const Eigen::SparseMatrix< zono_float > &Gc, const Eigen::SparseMatrix< zono_float > &Gb, const Eigen::Vector< zono_float, -1 > &c, const Eigen::SparseMatrix< zono_float > &Ac, const Eigen::SparseMatrix< zono_float > &Ab, const Eigen::Vector< zono_float, -1 > &b, bool zero_one_form=false, bool sharp=false) |
| Reset hybrid zonotope object with the given parameters. | |
| zono_float | support (const Eigen::Vector< zono_float, -1 > &d, const SolverSettings &settings=get_default_solver_settings(), std::shared_ptr< OptSolution > *solution=nullptr, const WarmStartParams &warm_start_params=WarmStartParams()) |
| Computes support function of the set in the direction d. | |
| virtual | ~HybZono ()=default |
Static Protected Member Functions | |
| static std::set< int > | find_unused_generators (const Eigen::SparseMatrix< zono_float > &G, const Eigen::SparseMatrix< zono_float > &A) |
| static void | remove_cols (Eigen::SparseMatrix< zono_float > &M, const std::set< int > &idx_to_remove) |
Protected Attributes | |
| Eigen::SparseMatrix< zono_float > | A = Eigen::SparseMatrix<zono_float>(0, 0) |
| constraint matrix A = [Ac, Ab] | |
| Eigen::SparseMatrix< zono_float > | Ab = Eigen::SparseMatrix<zono_float>(0, 0) |
| binary constraint matrix | |
| Eigen::SparseMatrix< zono_float > | Ac = Eigen::SparseMatrix<zono_float>(0, 0) |
| continuous constraint matrix | |
| Eigen::Vector< zono_float, -1 > | b = Eigen::Vector<zono_float, -1>(0) |
| constraint vector | |
| Eigen::Vector< zono_float, -1 > | c = Eigen::Vector<zono_float, -1>(0) |
| center vector | |
| Eigen::SparseMatrix< zono_float > | G = Eigen::SparseMatrix<zono_float>(0, 0) |
| generator matrix G = [Gc, Gb] | |
| Eigen::SparseMatrix< zono_float > | Gb = Eigen::SparseMatrix<zono_float>(0, 0) |
| binary generator matrix | |
| Eigen::SparseMatrix< zono_float > | Gc = Eigen::SparseMatrix<zono_float>(0, 0) |
| continuous generator matrix | |
| int | n = 0 |
| set dimension | |
| int | nC = 0 |
| number of constraints | |
| int | nG = 0 |
| total number of factors. nG = nGc + nGb | |
| int | nGb = 0 |
| number of binary factors | |
| int | nGc = 0 |
| number of continuous factors | |
| bool | sharp = false |
| flag to indicate whether the set is known to be sharp (i.e., convex relaxation = convex hull) | |
| bool | zero_one_form = false |
| flag to indicate whether the set is in 0-1 or -1-1 form | |
Friends | |
| std::unique_ptr< HybZono > | affine_inclusion (const HybZono &Z, const IntervalMatrix &R, const Eigen::Vector< zono_float, -1 > &s) |
| Returns inclusion of zonotopic set for uncertain affine map R*Z + s. | |
| std::unique_ptr< HybZono > | affine_map (const HybZono &Z, const Eigen::SparseMatrix< zono_float > &R, const Eigen::Vector< zono_float, -1 > &s) |
| Returns affine map R*Z + s of set Z. | |
| std::unique_ptr< HybZono > | cartesian_product (const HybZono &Z1, HybZono &Z2) |
| Computes the Cartesian product of two sets Z1 and Z2. | |
| std::unique_ptr< HybZono > | constrain (HybZono &Z, const Eigen::SparseMatrix< zono_float > &H, const Eigen::Vector< zono_float, -1 > &f, char direction, const Eigen::SparseMatrix< zono_float > &R) |
| Computes the generalized intersection of set Z with H*x <= f, H*x >= f, or H*x = f over matrix R. | |
| std::unique_ptr< ConZono > | convex_hull (const std::vector< std::shared_ptr< HybZono > > &Zs, bool exact) |
| Computes convex hull of several sets. | |
| std::unique_ptr< HybZono > | halfspace_intersection (HybZono &Z, const Eigen::SparseMatrix< zono_float > &H, const Eigen::Vector< zono_float, -1 > &f, const Eigen::SparseMatrix< zono_float > &R) |
| Computes the intersection generalized intersection of set Z with halfspace H*x <= f over matrix R. | |
| std::unique_ptr< HybZono > | intersection (const HybZono &Z1, HybZono &Z2, const Eigen::SparseMatrix< zono_float > &R) |
| Computes the generalized intersection of sets Z1 and Z2 over the matrix R. | |
| std::unique_ptr< HybZono > | intersection_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< HybZono > | minkowski_sum (const HybZono &Z1, HybZono &Z2) |
| Computes Minkowski sum of two sets Z1 and Z2. | |
| std::unique_ptr< HybZono > | operator* (const Box &box, HybZono &Z) |
| cartesian product with box | |
| std::unique_ptr< HybZono > | operator* (const Eigen::Matrix< zono_float, -1, -1 > &R, const HybZono &Z) |
| affine map with dense matrix: returns R*Z | |
| std::unique_ptr< HybZono > | operator* (const Eigen::SparseMatrix< zono_float > &R, const HybZono &Z) |
| affine map with sparse matrix: returns R*Z | |
| std::unique_ptr< HybZono > | operator* (const IntervalMatrix &R, const HybZono &Z) |
| affine inclusion with interval matrix: returns R*Z | |
| std::unique_ptr< HybZono > | operator* (zono_float f, const HybZono &Z) |
| scalar multiplication: returns f*Z | |
| std::unique_ptr< HybZono > | operator+ (const Box &box, HybZono &Z) |
| minkowski sum with box | |
| std::unique_ptr< HybZono > | operator+ (const Eigen::Vector< zono_float, -1 > &v, HybZono &Z) |
| minkowski sum with point | |
| std::ostream & | operator<< (std::ostream &os, const HybZono &Z) |
| Displays set information to the given output stream. | |
| std::unique_ptr< HybZono > | pontry_diff (HybZono &Z1, Zono &Z2, bool exact) |
| Computes the Pontryagin difference Z1 - Z2. | |
| std::unique_ptr< HybZono > | project_onto_dims (const HybZono &Z, const std::vector< int > &dims) |
| Projects set Z onto the dimensions specified in dims. | |
| std::unique_ptr< HybZono > | set_diff (const HybZono &Z1, HybZono &Z2, zono_float delta_m, bool remove_redundancy, const SolverSettings &settings, std::shared_ptr< OptSolution > *solution, const WarmStartParams &warm_start_params, int n_leaves, int contractor_iter) |
| std::unique_ptr< HybZono > | union_of_many (const std::vector< std::shared_ptr< HybZono > > &Zs, bool preserve_sharpness, bool expose_indicators) |
| Computes union of several sets. | |
| std::unique_ptr< HybZono > | vrep_2_hybzono (const std::vector< Eigen::Matrix< zono_float, -1, -1 > > &Vpolys, bool expose_indicators) |
| Computes a hybrid zonotope from a union of vertex representation polytopes. | |
| std::unique_ptr< HybZono > | zono_union_2_hybzono (std::vector< std::shared_ptr< Zono > > &Zs, bool expose_indicators) |
| Computes a hybrid zonotope from a union of zonotopes. | |
Hybrid zonotope class.
A hybrid zonotope is defined as: Z = {Gc * xi_c + Gb * xi_b + c | Ac * xi_c + Ab * xi_b = b, xi_c in [-1, 1]^nGc, xi_b in {-1, 1}^nGb}. Equivalently, the following shorthand can be used: Z = <Gc, Gb, c, Ac, Ab, b>. Optionally, in 0-1 form, the factors are xi_c in [0, 1]^nGc, xi_b in {0, 1}^nGb. The set dimension is n, and the number of equality constraints is nC.
|
default |
Default constructor for HybZono class.
| ZonoOpt::HybZono::HybZono | ( | const Eigen::SparseMatrix< zono_float > & | Gc, |
| const Eigen::SparseMatrix< zono_float > & | Gb, | ||
| const Eigen::Vector< zono_float, -1 > & | c, | ||
| const Eigen::SparseMatrix< zono_float > & | Ac, | ||
| const Eigen::SparseMatrix< zono_float > & | Ab, | ||
| const Eigen::Vector< zono_float, -1 > & | b, | ||
| const bool | zero_one_form = false, |
||
| const bool | sharp = false |
||
| ) |
HybZono constructor.
| Gc | continuous generator matrix |
| Gb | binary generator matrix |
| c | center |
| Ac | continuous constraint matrix |
| Ab | binary constraint matrix |
| b | constraint vector |
| zero_one_form | true if set is in 0-1 form |
| sharp | true if set is known to be sharp, i.e., convex relaxation = convex hull |
| std::invalid_argument | if Gc, Gb, c, Ac, Ab, and b have inconsistent dimensions. |
|
virtualdefault |
|
inline |
Computes a bounding box of the set object as a Box object.
| settings | optimization settings structure |
| solution | optimization solution structure pointer, populated with result |
| warm_start_params | warm start parameters |
In general, solves 2*n support optimizations where n is the set dimension to compute a bounding box.
| std::invalid_argument | if the set is empty. |
|
virtual |
Clone method for polymorphic behavior.
Reimplemented in ZonoOpt::ConZono, ZonoOpt::EmptySet, ZonoOpt::Point, and ZonoOpt::Zono.
|
inlinevirtual |
Computes the complement of the set Z.
| delta_m | parameter defining range of complement |
| remove_redundancy | remove redundant constraints and unused generators in get_leaves function call |
| settings | optimization settings for get_leaves function call |
| solution | optimization solution for get_leaves function call |
| n_leaves | maximum number of leaves to return in get_leaves function call |
| contractor_iter | number of interval contractor iterations in remove_redundancy if using |
Computes the complement according to the method of Bird and Jain: "Unions and Complements of Hybrid Zonotopes" delta_m is a parameter that defines the set over which the complement is defined. For a constrained zonotope, the complement is restricted to the set X = {G \xi + c | A \xi = b, \xi \in [-1-delta_m, 1+delta+m]^{nG}}.
| std::runtime_error | if the set is empty. |
|
inline |
Checks whether the point x is contained in the set object.
| x | point to be checked for set containment |
| settings | optimization settings structure |
| solution | optimization solution structure pointer, populated with result |
| warm_start_params | warm start parameters |
False positives are possible; will return true if the optimization converges within the specified tolerances. Will return false only if an infeasibility certificate is found, i.e., false negatives are not possible.
| std::invalid_argument | if x does not have the same dimension as the set. |
|
virtual |
Converts the set representation between -1-1 and 0-1 forms.
This method converts the set representation between -1-1 and 0-1 forms. If the set is in -1-1 form, then xi_c in [-1,1] and xi_b in {-1,1}. If the set is in 0-1 form, then xi_c in [0,1] and xi_b in {0,1}.
Reimplemented in ZonoOpt::ConZono, ZonoOpt::Point, and ZonoOpt::Zono.
|
virtual |
Returns convex relaxation of the hybrid zonotope.
This method returns the convex relaxation of the hybrid zonotope. If the set is sharp, the convex relaxation is the convex hull.
|
protectedvirtual |
Reimplemented in ZonoOpt::EmptySet, ZonoOpt::Point, ZonoOpt::Zono, and ZonoOpt::ConZono.
|
protectedvirtual |
Reimplemented in ZonoOpt::ConZono, and ZonoOpt::EmptySet.
|
protectedvirtual |
Reimplemented in ZonoOpt::EmptySet, ZonoOpt::Point, and ZonoOpt::ConZono.
|
protectedvirtual |
Reimplemented in ZonoOpt::EmptySet, ZonoOpt::Zono, and ZonoOpt::ConZono.
|
protectedvirtual |
Reimplemented in ZonoOpt::Point, ZonoOpt::EmptySet, and ZonoOpt::ConZono.
|
protectedvirtual |
Reimplemented in ZonoOpt::EmptySet, ZonoOpt::Point, and ZonoOpt::ConZono.
|
protectedvirtual |
Reimplemented in ZonoOpt::EmptySet, ZonoOpt::Point, ZonoOpt::Zono, and ZonoOpt::ConZono.
|
staticprotected |
|
inlinevirtual |
Returns constraint matrix.
|
inlinevirtual |
Returns binary constraint matrix.
|
inlinevirtual |
Returns continuous constraint matrix.
|
inlinevirtual |
Returns constraint vector.
|
inlinevirtual |
Returns center vector.
|
inlinevirtual |
Returns generator matrix.
|
inlinevirtual |
Returns binary generator matrix.
|
inlinevirtual |
Returns continuous generator matrix.
| std::vector< std::unique_ptr< ConZono > > ZonoOpt::HybZono::get_leaves | ( | bool | remove_redundancy = false, |
| 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 |
||
| ) | const |
Computes individual constrained zonotopes whose union is the hybrid zonotope object.
| remove_redundancy | flag to make call to remove_redundancy for each identified leaf (default false) |
| settings | optimization settings structure |
| solution | optimization solution structure pointer, populated with result |
| n_leaves | max number of leaves to find |
| contractor_iter | number of interval contractor iterations to run if using remove_redundancy |
Searches for constrained zonotopes that correspond to feasible combinations of the hybrid zonotope binary variables. If the branch and bound converges (i.e., did not hit max time, max number of branch and bound iterations, or max nodes in queue) and the n_leaves argument does not stop the optimization before exhausting all possibilities, then the resulting vector of constrained zonotopes can be unioned to recover the original set. It is possible for a leaf to be the empty set if the optimization converges before detecting an infeasibility certificate. Branch and bound search is used to find all leaves of the hybrid zonotope tree. If any threads are allocated for ADMM-FP, these will instead be used for branch and bound search.
Returns number of constraints in set definition.
Returns number of generators in set definition.
Returns number of binary generators in set definition.
Returns number of continuous generators in set definition.
Returns true if factors are in range [0,1], false if they are in range [-1,1].
| bool ZonoOpt::HybZono::is_conzono | ( | ) | const |
Polymorphic type checking: true if set is a constrained zonotope.
|
inline |
Returns true if the set is provably empty, false otherwise.
| settings | optimization settings structure |
| solution | optimization solution structure pointer, populated with result @params warm_start_params warm start parameters |
| bool ZonoOpt::HybZono::is_empty_set | ( | ) | const |
Polymorphic type checking: true if set is empty set object.
| bool ZonoOpt::HybZono::is_hybzono | ( | ) | const |
Polymorphic type checking: true if set is a hybrid zonotope.
| bool ZonoOpt::HybZono::is_point | ( | ) | const |
Polymorphic type checking: true if set is a point.
|
inline |
Returns true if set is known to be sharp.
A set is sharp if its convex relaxation is equal to its convex hull.
| bool ZonoOpt::HybZono::is_zono | ( | ) | const |
Polymorphic type checking: true if set is a zonotope.
|
protected |
|
protected |
| std::unique_ptr< HybZono > ZonoOpt::HybZono::operator& | ( | HybZono & | other | ) | const |
intersection
| other |
| std::invalid_argument | if this and other have inconsistent dimensions. |
| std::unique_ptr< HybZono > ZonoOpt::HybZono::operator* | ( | const Box & | box | ) | const |
cartesian product with box
| box |
| std::unique_ptr< HybZono > ZonoOpt::HybZono::operator* | ( | HybZono & | other | ) | const |
cartesian product
| other |
| std::unique_ptr< HybZono > ZonoOpt::HybZono::operator* | ( | zono_float | f | ) | const |
scalar multiplication: returns f*Z
| f |
| void ZonoOpt::HybZono::operator*= | ( | const Box & | box | ) |
in-place cartesian product with box
| box |
| void ZonoOpt::HybZono::operator*= | ( | HybZono & | other | ) |
in-place cartesian product
| other |
scalar multiplication in place
| f |
| std::unique_ptr< HybZono > ZonoOpt::HybZono::operator+ | ( | const Box & | box | ) | const |
minkowski sum with box
| box |
| std::invalid_argument | if box does not have the same dimension as this set. |
| std::unique_ptr< HybZono > ZonoOpt::HybZono::operator+ | ( | const Eigen::Vector< zono_float, -1 > & | v | ) | const |
minkowski sum with point
| v |
| std::invalid_argument | if v does not have the same dimension as this set. |
| std::unique_ptr< HybZono > ZonoOpt::HybZono::operator+ | ( | HybZono & | other | ) | const |
minkowski sum
| other |
| std::invalid_argument | if this and other have different dimensions. |
| void ZonoOpt::HybZono::operator+= | ( | const Box & | box | ) |
in-place minkowski sum with box
| box |
| std::invalid_argument | if box does not have the same dimension as this set. |
| void ZonoOpt::HybZono::operator+= | ( | const Eigen::Vector< zono_float, -1 > & | v | ) |
in-place minkowski sum with point
| v |
| std::invalid_argument | if v does not have the same dimension as this set. |
| void ZonoOpt::HybZono::operator+= | ( | HybZono & | other | ) |
in-place minkowski sum
| other |
| std::invalid_argument | if this and other have different dimensions. |
| std::unique_ptr< HybZono > ZonoOpt::HybZono::operator- | ( | ) | const |
unary minus: returns -I * this
| std::unique_ptr< HybZono > ZonoOpt::HybZono::operator- | ( | const Box & | box | ) |
pontryagin difference with box
| box |
| std::invalid_argument | if box does not have the same dimension as this set. |
| std::unique_ptr< HybZono > ZonoOpt::HybZono::operator- | ( | const Eigen::Vector< zono_float, -1 > & | v | ) |
pontryagin difference with point
| v |
| std::invalid_argument | if v does not have the same dimension as this set. |
| std::unique_ptr< HybZono > ZonoOpt::HybZono::operator- | ( | Zono & | other | ) |
pontryagin difference
| other |
| std::invalid_argument | if this and other have different dimensions, or if the inexact difference is requested with a hybrid-zonotope minuend. |
| void ZonoOpt::HybZono::operator-= | ( | const Box & | box | ) |
in-place pontryagin difference with box
| box |
| std::invalid_argument | if box does not have the same dimension as this set. |
| void ZonoOpt::HybZono::operator-= | ( | const Eigen::Vector< zono_float, -1 > & | v | ) |
in-place pontryagin difference with point
| v |
| std::invalid_argument | if v does not have the same dimension as this set. |
| void ZonoOpt::HybZono::operator-= | ( | Zono & | other | ) |
in-place pontryagin difference
| other |
| std::invalid_argument | if this and other have different dimensions. |
| std::unique_ptr< HybZono > ZonoOpt::HybZono::operator| | ( | HybZono & | other | ) | const |
union
| other |
| std::invalid_argument | if this and other have different dimensions. |
|
inline |
Solves optimization problem with quadratic objective over the current set.
| P | quadratic objective matrix |
| q | linear objective vector |
| c | constant term in objective function |
| settings | optimization settings structure |
| solution | optimization solution structure pointer, populated with result |
| warm_start_params | warm start parameters |
Solves optimization problem of the form min 0.5*z^T*P*z + q^T*z + c where z is a vector in the current set
| std::invalid_argument | if P, q, or c have inconsistent dimensions with the set. |
|
virtual |
Returns set information as a string.
Reimplemented in ZonoOpt::ConZono, ZonoOpt::EmptySet, ZonoOpt::Point, and ZonoOpt::Zono.
|
inline |
Returns the projection of the point x onto the set object.
| x | point to be projected |
| settings | optimization settings structure |
| solution | optimization solution structure pointer, populated with result @params warm_start_params warm start parameters |
| std::invalid_argument | if x does not have the same dimension as the set. |
| std::runtime_error | if the projection problem is infeasible (e.g., the set is empty). |
|
staticprotected |
|
virtual |
Removes redundant constraints and any unused generators.
| contractor_iter | number of interval contractor iterations to run |
This method uses an interval contractor to detect generators that can be removed. Constrained zonotopes with separable constraints and generators in the form [g0 0 0 ...]^T * xi + c, a^T * xi = b are simplified. Additionally, any linearly dependent rows of the constraint matrix A are removed. If the linearly dependent constraints are not consistent (e.g., if A = [1, 0.1; 1, 0.1] and b = [1; 0.8]), the returned set is not equivalent to the original set. Unused factors are also removed.
| std::runtime_error | if redundancy removal fails internally (should not occur in normal use). |
Reimplemented in ZonoOpt::Point.
| void ZonoOpt::HybZono::set | ( | const Eigen::SparseMatrix< zono_float > & | Gc, |
| const Eigen::SparseMatrix< zono_float > & | Gb, | ||
| const Eigen::Vector< zono_float, -1 > & | c, | ||
| const Eigen::SparseMatrix< zono_float > & | Ac, | ||
| const Eigen::SparseMatrix< zono_float > & | Ab, | ||
| const Eigen::Vector< zono_float, -1 > & | b, | ||
| bool | zero_one_form = false, |
||
| bool | sharp = false |
||
| ) |
Reset hybrid zonotope object with the given parameters.
| Gc | continuous generator matrix |
| Gb | binary generator matrix |
| c | center |
| Ac | continuous constraint matrix |
| Ab | binary constraint matrix |
| b | constraint vector |
| zero_one_form | true if set is in 0-1 form |
| sharp | true if set is known to be sharp, i.e., convex relaxation = convex hull |
| std::invalid_argument | if Gc, Gb, c, Ac, Ab, and b have inconsistent dimensions. |
|
inline |
Computes support function of the set in the direction d.
| d | vector defining direction for support function |
| settings | optimization settings structure |
| solution | optimization solution structure pointer, populated with result |
| warm_start_params | warm start parameters |
Solves max_{z in Z} <z, d> where <., .> is the inner product
| std::invalid_argument | if d does not have the same dimension as the set, or if the support problem is infeasible. |
|
friend |
Returns inclusion of zonotopic set for uncertain affine map R*Z + s.
| Z | zonotopic set |
| R | interval matrix |
| s | vector offset |
This computes an over-approximation of the affine map using the method of Rego et. al. (2020) "Guaranteed methods based on constrained zonotopes for set-valued state estimation of nonlinear discrete-time systems" The SVD-based zonotope over-approximation method is used in this function when Z is a constrained zonotope. When Z is a hybrid zonotope, the convex relaxation is used to produce a constrained zonotope, and then the SVD-based method is applied.
| std::invalid_argument | if R, s, and Z have inconsistent dimensions. |
|
friend |
Returns affine map R*Z + s of set Z.
| Z | zonotopic set |
| R | affine map matrix |
| s | vector offset |
| std::invalid_argument | if R, s, and Z have inconsistent dimensions. |
Computes the Cartesian product of two sets Z1 and Z2.
| Z1 | zonotopic set |
| Z2 | zonotopic set |
|
friend |
Computes the generalized intersection of set Z with H*x <= f, H*x >= f, or H*x = f over matrix R.
| Z | zonotopic set |
| H | constraint matrix |
| f | constraint vector |
| direction | '<' for <=, '>' for >=, '=' for = |
| R | affine map matrix, defaults to identity |
| std::invalid_argument | if direction is not one of '<', '>', '=', or if Z, H, f, and R have inconsistent dimensions. |
|
friend |
Computes convex hull of several sets.
| Zs | Sets for which convex hull is to be computed. |
| exact | If false and all sets are zonotopes, a zonotope outer approximation is returned. |
Computes convex hull of sets {Z0, Z1, ..., Zn}. If Zi is a hybrid zonotope, it must be sharp or this function will throw an error. Zonotope outer approximations are computed using the method of Girard 2005, "Reachability of Uncertain Linear Systems Using Zonotopes".
| std::invalid_argument | if Zs is empty, if any member is a non-sharp hybrid zonotope, or if the outer-approximation path encounters a non-zonotope input. |
|
friend |
Computes the intersection generalized intersection of set Z with halfspace H*x <= f over matrix R.
| Z | zonotopic set |
| H | halfspace matrix |
| f | halfspace vector |
| R | affine map matrix |
Calls constrain with '<'
| std::invalid_argument | if Z, H, f, and R have inconsistent dimensions. |
|
friend |
Computes the generalized intersection of sets Z1 and Z2 over the matrix R.
| Z1 | zonotopic set |
| Z2 | zonotopic set |
| R | affine map matrix |
| std::invalid_argument | if Z1, Z2, and R have inconsistent dimensions. |
|
friend |
Computes the generalized intersection of sets Z1 and Z2 over the specified dimensions.
| Z1 | zonotopic set |
| Z2 | zonotopic set |
| dims | vector of dimensions |
| std::invalid_argument | if Z2.n does not match the number of dimensions, or if any entry in dims is not a valid dimension of Z1. |
Computes Minkowski sum of two sets Z1 and Z2.
| Z1 | zonotopic set |
| Z2 | zonotopic set |
| std::invalid_argument | if Z1 and Z2 have different dimensions. |
cartesian product with box
| box | |
| Z |
|
friend |
affine map with dense matrix: returns R*Z
| R | |
| Z |
| std::invalid_argument | if R's column count does not match Z's dimension. |
|
friend |
affine map with sparse matrix: returns R*Z
| R | |
| Z |
| std::invalid_argument | if R's column count does not match Z's dimension. |
affine inclusion with interval matrix: returns R*Z
| R | |
| Z |
| std::invalid_argument | if R's column count does not match Z's dimension. |
|
friend |
scalar multiplication: returns f*Z
| f | |
| Z |
minkowski sum with box
| box | |
| Z |
| std::invalid_argument | if box does not have the same dimension as Z. |
|
friend |
minkowski sum with point
| v | |
| Z |
| std::invalid_argument | if v does not have the same dimension as Z. |
Displays set information to the given output stream.
| os | |
| Z |
Computes the Pontryagin difference Z1 - Z2.
| Z1 | minuend |
| Z2 | subtrahend |
| exact | require output to be exact, otherwise inner approximation will be returned (default true) |
For inner approximations (exact = false), the algorithm from Vinod et. al. 2025 is used. Note that this algorithm is exact when the minuend is a constrained zonotope and the matrix [G;A] is invertible. Exact Pontryagin difference can only be computed when the subtrahend is a zonotope.
| std::invalid_argument | if Z1 and Z2 have different dimensions, or if the inexact difference is requested when the minuend is a hybrid zonotope. |
| std::runtime_error | if internal preconditions fail (e.g., redundancy-removal failure during the computation). |
|
friend |
Projects set Z onto the dimensions specified in dims.
| Z | zonotopic set |
| dims | vector of dimensions |
| std::invalid_argument | if any entry in dims is not a valid dimension of Z. |
|
friend |
|
friend |
Computes union of several sets.
| Zs | Sets to be unioned. |
| preserve_sharpness | Flag to preserve sharpness of the union at expense of complexity. |
| expose_indicators | Flag to append indicator set to the union. |
Computes union of sets {Z0, Z1, ..., Zn}. If expose_indicators is true, returns union({Z0, ..., Zn}) x I where I is the indicator set for the union. Specifically, each dimension of I corresponds to one of the Zi in the union. So for union_of_many({Z0, Z1, Z2}, true) with Z0, Z1, Z2 not intersecting, if a vector [z, i] is in union({Z0, Z1, Z2}) x I, then i = [1, 0, 0] if z is in Z0, etc.
| std::invalid_argument | if Zs is empty or if its members have inconsistent dimensions. |
|
friend |
Computes a hybrid zonotope from a union of vertex representation polytopes.
| Vpolys | V-rep polytopes to be unioned. |
| expose_indicators | Flag to append indicator set to the union. |
Vpolys is a vector of matrices, where each matrix represents a polytope in vertex representation. Each row in each polytope matrix is a vertex of the polytope, and each column corresponds to a dimension. The function constructs a hybrid zonotope in [0,1] form that represents the union of these polytopes. This function computes union of sets {V0, V1, ..., Vn}. If expose_indicators is true, returns union({V0, ..., Vn}) x I where I is the indicator set for the union. Specifically, each dimension of I corresponds to one of the Vi in the union. So for vrep_2_hybzono({V0, V1, V2}, true) with V0, V1, V2 not intersecting, if a vector [z, i] is in union({V0, V1, V2}) x I, then i = [1, 0, 0] if z is in V0, etc.
| std::invalid_argument | if Vpolys is empty or if its polytopes do not all share the same number of dimensions. |
|
friend |
Computes a hybrid zonotope from a union of zonotopes.
| Zs | A vector of zonotopes to be unioned. |
| expose_indicators | Flag to append indicator set to the union. |
This function computes union of sets {Z0, Z1, ..., Zn}. This can be more efficient than union_of_many if all sets are zonotopes because generators can be reused. If expose_indicators is true, returns union({Z0, ..., Zn}) x I where I is the indicator set for the union. Specifically, each dimension of I corresponds to one of the Zi in the union. So for zono_union_2_hybzono({Z0, Z1, Z2}, true) with Z0, Z1, VZ2 not intersecting, if a vector [z, i] is in union({Z0, Z1, Z2}) x I, then i = [1, 0, 0] if z is in Z0, etc.
| std::invalid_argument | if Zs is empty or if its zonotopes do not all share the same dimension. |
|
protected |
constraint matrix A = [Ac, Ab]
|
protected |
binary constraint matrix
|
protected |
continuous constraint matrix
|
protected |
constraint vector
|
protected |
center vector
|
protected |
generator matrix G = [Gc, Gb]
|
protected |
binary generator matrix
|
protected |
continuous generator matrix
|
protected |
set dimension
|
protected |
number of constraints
|
protected |
total number of factors. nG = nGc + nGb
|
protected |
number of binary factors
|
protected |
number of continuous factors
flag to indicate whether the set is known to be sharp (i.e., convex relaxation = convex hull)
flag to indicate whether the set is in 0-1 or -1-1 form