ZonoOpt 2.4.1
Loading...
Searching...
No Matches
Point.hpp
Go to the documentation of this file.
1#ifndef ZONOOPT_POINT_HPP_
2#define ZONOOPT_POINT_HPP_
3
15#include "Zono.hpp"
16
17namespace ZonoOpt
18{
19 using namespace detail;
20
26 class Point final : public Zono
27 {
28 public:
29 // constructor
34 Point() { sharp = true; }
35
41 explicit Point(const Eigen::Vector<zono_float, -1>& c);
42
43 // set method
49 void set(const Eigen::Vector<zono_float, -1>& c);
50
51 HybZono* clone() const override;
52
53 // display methods
54 std::string print() const override;
55
56 // in-place operators (type-preserving overrides)
57 using HybZono::operator+=; // restore vector overload hidden by declarations below
58 using HybZono::operator-=; // restore vector overload hidden by declarations below
59 using HybZono::operator*=; // restore scalar overload hidden by declarations below
60
65 void operator+=(Point& other);
66
68 void operator+=(HybZono& other) = delete;
69
71 void operator+=(const Box& box) = delete;
72
74 void operator-=(Zono& other) = delete;
75
77 void operator-=(const Box& box) = delete;
78
83 void operator*=(Point& other);
84
86 void operator*=(HybZono& other) = delete;
87
89 void operator*=(const Box& box) = delete;
90
91 // do nothing methods
92 std::unique_ptr<HybZono> remove_redundancy(int) const override { return std::unique_ptr<HybZono>(this->clone()); }
93
94 void convert_form() override
95 {
96 /* do nothing */
97 }
98
99 std::unique_ptr<ConZono> constraint_reduction() const override
100 {
101 return std::make_unique<Point>(*this);
102 }
103
104 protected:
105 Eigen::Vector<zono_float, -1> do_optimize_over(
106 const Eigen::SparseMatrix<zono_float>&, const Eigen::Vector<zono_float, -1>&, zono_float,
107 const SolverSettings&, std::shared_ptr<OptSolution>* sol,
108 const WarmStartParams&) const override;
109
110 Eigen::Vector<zono_float, -1> do_project_point(const Eigen::Vector<zono_float, -1>& x,
111 const SolverSettings&, std::shared_ptr<OptSolution>* sol,
112 const WarmStartParams&) const override;
113
114 zono_float do_support(const Eigen::Vector<zono_float, -1>& d, const SolverSettings&,
115 std::shared_ptr<OptSolution>* sol, const WarmStartParams&) override;
116
117 bool do_contains_point(const Eigen::Vector<zono_float, -1>& x, const SolverSettings&,
118 std::shared_ptr<OptSolution>* sol, const WarmStartParams&) const override;
119
120 Box do_bounding_box(const SolverSettings&, std::shared_ptr<OptSolution>* sol, const WarmStartParams&) override;
121
122 private:
123 void make_default_solution(std::shared_ptr<OptSolution>* sol) const;
124
125 };
126} // namespace ZonoOpt
127
128#endif
Zonotope class for ZonoOpt library.
Box (i.e., interval vector) class.
Definition Box.hpp:25
Hybrid zonotope class.
Definition HybZono.hpp:43
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.
Definition HybZono.cpp:23
bool sharp
flag to indicate whether the set is known to be sharp (i.e., convex relaxation = convex hull)
Definition HybZono.hpp:749
Eigen::Vector< zono_float, -1 > c
center vector
Definition HybZono.hpp:725
Point class.
Definition Point.hpp:27
void operator+=(Point &other)
In-place Minkowski sum with another Point (translation). Use operator+ for Zono/ConZono/HybZono/Box a...
Definition Point.cpp:118
zono_float do_support(const Eigen::Vector< zono_float, -1 > &d, const SolverSettings &, std::shared_ptr< OptSolution > *sol, const WarmStartParams &) override
Definition Point.cpp:72
void operator*=(Point &other)
In-place Cartesian product with another Point. Use operator* for Zono/ConZono/HybZono/Box arguments,...
Definition Point.cpp:123
void operator+=(const Box &box)=delete
Deleted: use operator+ instead — result type would be Zono.
std::unique_ptr< HybZono > remove_redundancy(int) const override
Removes redundant constraints and any unused generators.
Definition Point.hpp:92
void convert_form() override
Converts the set representation between -1-1 and 0-1 forms.
Definition Point.hpp:94
Eigen::Vector< zono_float, -1 > do_project_point(const Eigen::Vector< zono_float, -1 > &x, const SolverSettings &, std::shared_ptr< OptSolution > *sol, const WarmStartParams &) const override
Definition Point.cpp:57
std::unique_ptr< ConZono > constraint_reduction() const override
Execute constraint reduction algorithm from Scott et. al. 2016.
Definition Point.hpp:99
void operator*=(HybZono &other)=delete
Deleted: use operator* instead — result type would be Zono or wider.
void operator-=(const Box &box)=delete
Deleted: use operator- instead — Point ⊖ Box does not yield a Point.
void operator+=(HybZono &other)=delete
Deleted: use operator+ instead — result type would be Zono or wider.
void operator-=(Zono &other)=delete
Deleted: use operator- instead — Point ⊖ Zono does not yield a Point.
void set(const Eigen::Vector< zono_float, -1 > &c)
Reset point object with the given parameters.
Definition Point.cpp:18
Eigen::Vector< zono_float, -1 > do_optimize_over(const Eigen::SparseMatrix< zono_float > &, const Eigen::Vector< zono_float, -1 > &, zono_float, const SolverSettings &, std::shared_ptr< OptSolution > *sol, const WarmStartParams &) const override
Definition Point.cpp:48
bool do_contains_point(const Eigen::Vector< zono_float, -1 > &x, const SolverSettings &, std::shared_ptr< OptSolution > *sol, const WarmStartParams &) const override
Definition Point.cpp:86
Box do_bounding_box(const SolverSettings &, std::shared_ptr< OptSolution > *sol, const WarmStartParams &) override
Definition Point.cpp:99
std::string print() const override
Returns set information as a string.
Definition Point.cpp:39
Point()
Default constructor for Point class.
Definition Point.hpp:34
void operator*=(const Box &box)=delete
Deleted: use operator* instead — result type would be Zono.
HybZono * clone() const override
Clone method for polymorphic behavior.
Definition Point.cpp:13
Zonotope class.
Definition Zono.hpp:32
#define zono_float
Defines the floating-point type used in ZonoOpt.
Definition ZonoOpt.hpp:45
Definition ZonoOpt.hpp:58
Abstract base for all solver settings.
Definition SolverDataStructures.hpp:35
Warm start parameters for optimization routines in ZonoOpt library.
Definition ADMM.hpp:49