ZonoOpt 2.3.0
Loading...
Searching...
No Matches
Zono.hpp
Go to the documentation of this file.
1#ifndef ZONOOPT_ZONO_HPP_
2#define ZONOOPT_ZONO_HPP_
3
15#include "ConZono.hpp"
16
17namespace ZonoOpt
18{
19 using namespace detail;
20
31 class Zono : public ConZono
32 {
33 public:
34 // constructors
39 Zono() { sharp = true; }
40
48 Zono(const Eigen::SparseMatrix<zono_float>& G, const Eigen::Vector<zono_float, -1>& c,
49 const bool zero_one_form = false);
50
51 // virtual destructor
52 ~Zono() override = default;
53
54 // set method
62 void set(const Eigen::SparseMatrix<zono_float>& G, const Eigen::Vector<zono_float, -1>& c,
63 bool zero_one_form = false);
64
68 HybZono* clone() const override;
69
76 std::unique_ptr<Zono> reduce_order(int n_o);
77
86
91 Eigen::Vector<zono_float, -1> get_center();
92
93 // generator conversion between [-1,1] and [0,1]
94 void convert_form() override;
95
96 // display methods
97 std::string print() const override;
98
99 std::unique_ptr<ConZono> constraint_reduction() const override
100 {
101 return std::make_unique<Zono>(*this);
102 }
103
104 protected:
105 bool do_is_empty(const OptSettings&, std::shared_ptr<OptSolution>*, const WarmStartParams&) const override;
106
107 Box do_bounding_box(const OptSettings&, std::shared_ptr<OptSolution>*, const WarmStartParams&) override;
108
109 zono_float do_support(const Eigen::Vector<zono_float, -1>& d, const OptSettings&,
110 std::shared_ptr<OptSolution>*, const WarmStartParams&) override;
111 };
112
113 // forward declarations
121 std::unique_ptr<Zono> interval_2_zono(const Box& box);
122
133 std::unique_ptr<Zono> make_regular_zono_2D(zono_float radius, int n_sides, bool outer_approx = false,
134 const Eigen::Vector<zono_float, 2>& c = Eigen::Vector<
135 zono_float, 2>::Zero());
136} // namespace ZonoOpt
137
138#endif
Constrained zonotope class for ZonoOpt library.
Box (i.e., interval vector) class.
Definition Box.hpp:25
Constrained zonotope class.
Definition ConZono.hpp:32
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:711
bool sharp
flag to indicate whether the set is known to be sharp (i.e., convex relaxation = convex hull)
Definition HybZono.hpp:714
Eigen::Vector< zono_float, -1 > c
center vector
Definition HybZono.hpp:690
Eigen::SparseMatrix< zono_float > G
generator matrix G = [Gc, Gb]
Definition HybZono.hpp:672
Zonotope class.
Definition Zono.hpp:32
std::unique_ptr< ConZono > constraint_reduction() const override
Execute constraint reduction algorithm from Scott et. al. 2016.
Definition Zono.hpp:99
std::string print() const override
Returns set information as a string.
Definition Zono.cpp:68
Eigen::Vector< zono_float, -1 > get_center()
get center of zonotope
Definition Zono.cpp:244
HybZono * clone() const override
Clone method for polymorphic behavior.
Definition Zono.cpp:14
zono_float do_support(const Eigen::Vector< zono_float, -1 > &d, const OptSettings &, std::shared_ptr< OptSolution > *, const WarmStartParams &) override
Definition Zono.cpp:188
~Zono() override=default
bool do_is_empty(const OptSettings &, std::shared_ptr< OptSolution > *, const WarmStartParams &) const override
Definition Zono.cpp:80
std::unique_ptr< Zono > reduce_order(int n_o)
Perform zonotope order reduction.
Definition Zono.cpp:108
void set(const Eigen::SparseMatrix< zono_float > &G, const Eigen::Vector< zono_float, -1 > &c, bool zero_one_form=false)
Reset zonotope object with the given parameters.
Definition Zono.cpp:19
zono_float get_volume()
Get volume of zonotope.
Definition Zono.cpp:204
Box do_bounding_box(const OptSettings &, std::shared_ptr< OptSolution > *, const WarmStartParams &) override
Definition Zono.cpp:88
Zono()
Default constructor for Zono class.
Definition Zono.hpp:39
void convert_form() override
Converts the set representation between -1-1 and 0-1 forms.
Definition Zono.cpp:47
#define zono_float
Defines the floating-point type used in ZonoOpt.
Definition ZonoOpt.hpp:45
std::unique_ptr< Zono > interval_2_zono(const Box &box)
Builds a zonotope from a Box object.
Definition Zono.cpp:289
std::unique_ptr< Zono > make_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.
Definition Zono.cpp:253
Definition ZonoOpt.hpp:58
Settings for optimization routines in ZonoOpt library.
Definition SolverDataStructures.hpp:25
Warm start parameters for optimization routines in ZonoOpt library.
Definition ADMM.hpp:49