ZonoOpt 2.2.0
Loading...
Searching...
No Matches
ConZono.hpp
Go to the documentation of this file.
1#ifndef ZONOOPT_CONZONO_HPP_
2#define ZONOOPT_CONZONO_HPP_
3
15#include "HybZono.hpp"
16
17namespace ZonoOpt
18{
19 using namespace detail;
20
31 class ConZono : public HybZono
32 {
33 public:
34 // constructors
35
40 ConZono() { sharp = true; }
41
51 ConZono(const Eigen::SparseMatrix<zono_float>& G, const Eigen::Vector<zono_float, -1>& c,
52 const Eigen::SparseMatrix<zono_float>& A, const Eigen::Vector<zono_float, -1>& b,
53 const bool zero_one_form = false);
54
55 // virtual destructor
56 ~ConZono() override = default;
57
61 HybZono* clone() const override;
62
63 // set method
73 void set(const Eigen::SparseMatrix<zono_float>& G, const Eigen::Vector<zono_float, -1>& c,
74 const Eigen::SparseMatrix<zono_float>& A, const Eigen::Vector<zono_float, -1>& b,
75 bool zero_one_form = false);
76
83 virtual void constraint_reduction();
84
85 // generator conversion between [-1,1] and [0,1]
86 void convert_form() override;
87
88 // over-approximate as zonotope
89
94 virtual std::unique_ptr<Zono> to_zono_approx() const;
95
96 // display methods
97 std::string print() const override;
98
99 protected:
100 OptSolution qp_opt(const Eigen::SparseMatrix<zono_float>& P, const Eigen::Vector<zono_float, -1>& q,
101 zono_float c, const Eigen::SparseMatrix<zono_float>& A,
102 const Eigen::Vector<zono_float, -1>& b,
103 const OptSettings& settings = OptSettings(),
104 std::shared_ptr<OptSolution>* solution = nullptr,
106
107 Eigen::Vector<zono_float, -1> do_optimize_over(
108 const Eigen::SparseMatrix<zono_float>& P, const Eigen::Vector<zono_float, -1>& q, const zono_float c,
109 const OptSettings& settings, std::shared_ptr<OptSolution>* solution,
110 const WarmStartParams&) const override;
111
112 Eigen::Vector<zono_float, -1> do_project_point(const Eigen::Vector<zono_float, -1>& x,
113 const OptSettings& settings,
114 std::shared_ptr<OptSolution>* solution,
115 const WarmStartParams& warm_start_params) const override;
116
117 bool do_is_empty(const OptSettings& settings, std::shared_ptr<OptSolution>* solution,
118 const WarmStartParams& warm_start_params) const override;
119
120 zono_float do_support(const Eigen::Vector<zono_float, -1>& d, const OptSettings& settings,
121 std::shared_ptr<OptSolution>* solution,
122 const WarmStartParams& warm_start_params) override;
123
124 bool do_contains_point(const Eigen::Vector<zono_float, -1>& x, const OptSettings& settings,
125 std::shared_ptr<OptSolution>* solution,
126 const WarmStartParams& warm_start_params) const override;
127
128 Box do_bounding_box(const OptSettings& settings, std::shared_ptr<OptSolution>*,
129 const WarmStartParams& warm_start_params) override;
130
131 std::unique_ptr<HybZono> do_complement(zono_float delta_m, bool, const OptSettings&,
132 std::shared_ptr<OptSolution>*, int, int) override;
133 };
134
135 // forward declarations
136
146 std::unique_ptr<ConZono> vrep_2_conzono(const Eigen::Matrix<zono_float, -1, -1>& Vpoly);
147} // namespace ZonoOpt
148
149
150#endif
Hybrid zonotope class for ZonoOpt library.
Box (i.e., interval vector) class.
Definition Box.hpp:25
Constrained zonotope class.
Definition ConZono.hpp:32
zono_float do_support(const Eigen::Vector< zono_float, -1 > &d, const OptSettings &settings, std::shared_ptr< OptSolution > *solution, const WarmStartParams &warm_start_params) override
Definition ConZono.cpp:160
void set(const Eigen::SparseMatrix< zono_float > &G, const Eigen::Vector< zono_float, -1 > &c, const Eigen::SparseMatrix< zono_float > &A, const Eigen::Vector< zono_float, -1 > &b, bool zero_one_form=false)
Reset constrained zonotope object with the given parameters.
Definition ConZono.cpp:20
bool do_is_empty(const OptSettings &settings, std::shared_ptr< OptSolution > *solution, const WarmStartParams &warm_start_params) const override
Definition ConZono.cpp:141
virtual void constraint_reduction()
Execute constraint reduction algorithm from Scott et. al. 2016.
Definition ConZono.cpp:367
HybZono * clone() const override
Clone method for polymorphic behavior.
Definition ConZono.cpp:15
ConZono()
Default constructor for ConZono class.
Definition ConZono.hpp:40
bool do_contains_point(const Eigen::Vector< zono_float, -1 > &x, const OptSettings &settings, std::shared_ptr< OptSolution > *solution, const WarmStartParams &warm_start_params) const override
Definition ConZono.cpp:184
std::unique_ptr< HybZono > do_complement(zono_float delta_m, bool, const OptSettings &, std::shared_ptr< OptSolution > *, int, int) override
Definition ConZono.cpp:614
Eigen::Vector< zono_float, -1 > do_optimize_over(const Eigen::SparseMatrix< zono_float > &P, const Eigen::Vector< zono_float, -1 > &q, const zono_float c, const OptSettings &settings, std::shared_ptr< OptSolution > *solution, const WarmStartParams &) const override
Definition ConZono.cpp:89
void convert_form() override
Converts the set representation between -1-1 and 0-1 forms.
Definition ConZono.cpp:49
~ConZono() override=default
OptSolution qp_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(), std::shared_ptr< OptSolution > *solution=nullptr, const WarmStartParams &warm_start_params=WarmStartParams()) const
Definition ConZono.cpp:210
std::string print() const override
Returns set information as a string.
Definition ConZono.cpp:74
virtual std::unique_ptr< Zono > to_zono_approx() const
Compute outer approximation of constrained zonotope as zonotope using SVD.
Definition ConZono.cpp:328
Box do_bounding_box(const OptSettings &settings, std::shared_ptr< OptSolution > *, const WarmStartParams &warm_start_params) override
Definition ConZono.cpp:244
Eigen::Vector< zono_float, -1 > do_project_point(const Eigen::Vector< zono_float, -1 > &x, const OptSettings &settings, std::shared_ptr< OptSolution > *solution, const WarmStartParams &warm_start_params) const override
Definition ConZono.cpp:116
Hybrid zonotope class.
Definition HybZono.hpp:43
bool zero_one_form
flag to indicate whether the set is in 0-1 or -1-1 form
Definition HybZono.hpp:710
bool sharp
flag to indicate whether the set is known to be sharp (i.e., convex relaxation = convex hull)
Definition HybZono.hpp:713
Eigen::Vector< zono_float, -1 > c
center vector
Definition HybZono.hpp:689
Eigen::SparseMatrix< zono_float > A
constraint matrix A = [Ac, Ab]
Definition HybZono.hpp:680
Eigen::Vector< zono_float, -1 > b
constraint vector
Definition HybZono.hpp:692
Eigen::SparseMatrix< zono_float > G
generator matrix G = [Gc, Gb]
Definition HybZono.hpp:671
#define zono_float
Defines the floating-point type used in ZonoOpt.
Definition ZonoOpt.hpp:45
std::unique_ptr< ConZono > vrep_2_conzono(const Eigen::Matrix< zono_float, -1, -1 > &Vpoly)
Builds a constrained zonotope from a vertex representation polytope.
Definition ConZono.cpp:587
Definition ZonoOpt.hpp:58
Settings for optimization routines in ZonoOpt library.
Definition SolverDataStructures.hpp:25
Solution data structure for optimization routines in ZonoOpt library.
Definition SolverDataStructures.hpp:199
Warm start parameters for optimization routines in ZonoOpt library.
Definition ADMM.hpp:49