|
| | 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, bool zero_one_form=false, bool sharp=false) |
| | HybZono constructor.
|
| |
| virtual | ~HybZono ()=default |
| |
| 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.
|
| |
| virtual HybZono * | clone () const |
| | Clone method for polymorphic behavior.
|
| |
| 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_nGc () const |
| | Returns number of continuous generators in set definition.
|
| |
| virtual int | get_nGb () const |
| | Returns number of binary generators in set definition.
|
| |
| virtual Eigen::SparseMatrix< zono_float > | get_Gc () const |
| | Returns continuous generator matrix.
|
| |
| virtual Eigen::SparseMatrix< zono_float > | get_Gb () const |
| | Returns binary generator matrix.
|
| |
| virtual Eigen::SparseMatrix< zono_float > | get_G () const |
| | Returns generator matrix.
|
| |
| virtual Eigen::SparseMatrix< zono_float > | get_Ac () const |
| | Returns continuous constraint matrix.
|
| |
| virtual Eigen::SparseMatrix< zono_float > | get_Ab () const |
| | Returns binary constraint matrix.
|
| |
| virtual Eigen::SparseMatrix< zono_float > | get_A () const |
| | Returns constraint matrix.
|
| |
| virtual Eigen::Vector< zono_float, -1 > | get_c () const |
| | Returns center vector.
|
| |
| virtual Eigen::Vector< zono_float, -1 > | get_b () const |
| | Returns constraint vector.
|
| |
| 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_sharp () const |
| | Returns true if set is known to be sharp.
|
| |
| virtual void | convert_form () |
| | Converts the set representation between -1-1 and 0-1 forms.
|
| |
| virtual void | remove_redundancy (int contractor_iter=100) |
| | Removes redundant constraints and any unused generators.
|
| |
| virtual std::unique_ptr< ConZono > | convex_relaxation () const |
| | Returns convex relaxation of the hybrid zonotope.
|
| |
| virtual std::unique_ptr< HybZono > | complement (const zono_float delta_m=100, const bool remove_redundancy=true, const OptSettings &settings=OptSettings(), OptSolution *solution=nullptr, const int n_leaves=std::numeric_limits< int >::max(), const int contractor_iter=100) |
| | Computes the complement of the set Z.
|
| |
| bool | is_point () const |
| | Polymorphic type checking: true if set is a point.
|
| |
| bool | is_zono () const |
| | Polymorphic type checking: true if set is a zonotope.
|
| |
| bool | is_conzono () const |
| | Polymorphic type checking: true if set is a constrained zonotope.
|
| |
| bool | is_hybzono () const |
| | Polymorphic type checking: true if set is a hybrid zonotope.
|
| |
| bool | is_empty_set () const |
| | Polymorphic type checking: true if set is empty set object.
|
| |
| virtual std::string | print () const |
| | Returns set information as a string.
|
| |
| 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 OptSettings &settings=OptSettings(), OptSolution *solution=nullptr) const |
| | Solves optimization problem with quadratic objective over the current set.
|
| |
| Eigen::Vector< zono_float, -1 > | project_point (const Eigen::Vector< zono_float, -1 > &x, const OptSettings &settings=OptSettings(), OptSolution *solution=nullptr) const |
| | Returns the projection of the point x onto the set object.
|
| |
| bool | is_empty (const OptSettings &settings=OptSettings(), OptSolution *solution=nullptr) const |
| | Returns true if the set is provably empty, false otherwise.
|
| |
| zono_float | support (const Eigen::Vector< zono_float, -1 > &d, const OptSettings &settings=OptSettings(), OptSolution *solution=nullptr) |
| | Computes support function of the set in the direction d.
|
| |
| bool | contains_point (const Eigen::Vector< zono_float, -1 > &x, const OptSettings &settings=OptSettings(), OptSolution *solution=nullptr) const |
| | Checks whether the point x is contained in the set object.
|
| |
| Box | bounding_box (const OptSettings &settings=OptSettings(), OptSolution *solution=nullptr) |
| | Computes a bounding box of the set object as a Box object.
|
| |
| std::vector< ConZono > | get_leaves (bool remove_redundancy=true, const OptSettings &settings=OptSettings(), 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 Eigen::Vector< zono_float, -1 > | do_optimize_over (const Eigen::SparseMatrix< zono_float > &P, const Eigen::Vector< zono_float, -1 > &q, zono_float c, const OptSettings &settings, OptSolution *solution) const |
| |
| virtual Eigen::Vector< zono_float, -1 > | do_project_point (const Eigen::Vector< zono_float, -1 > &x, const OptSettings &settings, OptSolution *solution) const |
| |
| virtual bool | do_is_empty (const OptSettings &settings, OptSolution *solution) const |
| |
| virtual zono_float | do_support (const Eigen::Vector< zono_float, -1 > &d, const OptSettings &settings, OptSolution *solution) |
| |
| virtual bool | do_contains_point (const Eigen::Vector< zono_float, -1 > &x, const OptSettings &settings, OptSolution *solution) const |
| |
| virtual Box | do_bounding_box (const OptSettings &settings, OptSolution *solution) |
| |
| virtual std::unique_ptr< HybZono > | do_complement (zono_float, bool remove_redundancy, const OptSettings &settings, OptSolution *solution, int n_leaves, int contractor_iter) |
| |
| OptSolution | mi_opt (const Eigen::SparseMatrix< zono_float > &P, const Eigen::Vector< zono_float, -1 > &q, zono_float c, const Eigen::SparseMatrix< zono_float > &A, const Eigen::Vector< zono_float, -1 > &b, const OptSettings &settings=OptSettings(), OptSolution *solution=nullptr) const |
| |
| std::vector< OptSolution > | mi_opt_multisol (const Eigen::SparseMatrix< zono_float > &P, const Eigen::Vector< zono_float, -1 > &q, zono_float c, const Eigen::SparseMatrix< zono_float > &A, const Eigen::Vector< zono_float, -1 > &b, int n_sols, const OptSettings &settings=OptSettings(), OptSolution *solution=nullptr) const |
| |
|
| Eigen::SparseMatrix< zono_float > | G = Eigen::SparseMatrix<zono_float>(0, 0) |
| | generator matrix G = [Gc, Gb]
|
| |
| Eigen::SparseMatrix< zono_float > | Gc = Eigen::SparseMatrix<zono_float>(0, 0) |
| | continuous generator matrix
|
| |
| Eigen::SparseMatrix< zono_float > | Gb = Eigen::SparseMatrix<zono_float>(0, 0) |
| | binary generator matrix
|
| |
| Eigen::SparseMatrix< zono_float > | A = Eigen::SparseMatrix<zono_float>(0, 0) |
| | constraint matrix A = [Ac, Ab]
|
| |
| Eigen::SparseMatrix< zono_float > | Ac = Eigen::SparseMatrix<zono_float>(0, 0) |
| | continuous constraint matrix
|
| |
| Eigen::SparseMatrix< zono_float > | Ab = Eigen::SparseMatrix<zono_float>(0, 0) |
| | binary constraint matrix
|
| |
| Eigen::Vector< zono_float, -1 > | c = Eigen::Vector<zono_float, -1>(0) |
| | center vector
|
| |
| Eigen::Vector< zono_float, -1 > | b = Eigen::Vector<zono_float, -1>(0) |
| | constraint vector
|
| |
| int | n = 0 |
| | set dimension
|
| |
| int | nG = 0 |
| | total number of factors. nG = nGc + nGb
|
| |
| int | nGc = 0 |
| | number of continuous factors
|
| |
| int | nGb = 0 |
| | number of binary factors
|
| |
| int | nC = 0 |
| | number of constraints
|
| |
| bool | zero_one_form = false |
| | flag to indicate whether the set is in 0-1 or -1-1 form
|
| |
| bool | sharp = false |
| | flag to indicate whether the set is known to be sharp (i.e., convex relaxation = convex hull)
|
| |
|
| std::ostream & | operator<< (std::ostream &os, const HybZono &Z) |
| | Displays set information to the given output stream.
|
| |
| 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 > | project_onto_dims (const HybZono &Z, const std::vector< int > &dims) |
| | Projects set Z onto the dimensions specified in dims.
|
| |
| std::unique_ptr< HybZono > | minkowski_sum (const HybZono &Z1, HybZono &Z2) |
| | Computes Minkowski sum of two sets Z1 and Z2.
|
| |
| std::unique_ptr< HybZono > | pontry_diff (HybZono &Z1, HybZono &Z2, bool exact) |
| | Computes the Pontryagin difference Z1 - Z2.
|
| |
| 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 > | 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 > | 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 > | 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 std::vector< Inequality > &ineqs, const Eigen::SparseMatrix< zono_float > &R) |
| | Applies inequalities to set.
|
| |
| std::unique_ptr< HybZono > | set_diff (const HybZono &Z1, HybZono &Z2, zono_float delta_m, bool remove_redundancy, const OptSettings &settings, OptSolution *solution, int n_leaves, int contractor_iter) |
| | Set difference Z1 \ Z2.
|
| |
| 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< 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.
Computes union of several sets.
- Parameters
-
| 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. |
- Returns
- zonotopic set
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.
Computes a hybrid zonotope from a union of vertex representation polytopes.
- Parameters
-
| Vpolys | V-rep polytopes to be unioned. |
| expose_indicators | Flag to append indicator set to the union. |
- Returns
- zonotopic set
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::unique_ptr< HybZono > zono_union_2_hybzono |
( |
std::vector< Zono > & |
Zs, |
|
|
bool |
expose_indicators = false |
|
) |
| |
|
friend |
Computes a hybrid zonotope from a union of zonotopes.
- Parameters
-
| Zs | A vector of zonotopes to be unioned. |
| expose_indicators | Flag to append indicator set to the union. |
- Returns
- zonotopic set
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.