1#ifndef ZONOOPT_POINT_HPP_
2#define ZONOOPT_POINT_HPP_
20using namespace detail;
43 explicit Point(
const Eigen::Vector<zono_float, -1>&
c)
55 void set(
const Eigen::Vector<zono_float, -1>&
c);
59 return new Point(*
this);
63 std::string
print()
const override;
72 const Eigen::SparseMatrix<zono_float>&,
const Eigen::Vector<zono_float, -1>&,
zono_float,
88inline void Point::set(
const Eigen::Vector<zono_float, -1>& c)
92 this->
n =
static_cast<int>(this->c.size());
95 this->
G.resize(this->
n,0);
101 this->
Gb.resize(this->
n, 0);
102 this->
A.resize(0, this->
nG);
104 this->
Ab.resize(0, 0);
111 std::stringstream
ss;
112 ss <<
"Point: " << std::endl;
113 ss <<
"n: " << this->
n << std::endl;
114 ss <<
"c: " << this->
c;
119 const Eigen::SparseMatrix<zono_float>&,
const Eigen::Vector<zono_float, -1>&,
zono_float,
129 if (this->
n != x.size())
131 throw std::invalid_argument(
"Point projection: inconsistent dimensions.");
141 if (this->
n != d.size())
143 throw std::invalid_argument(
"Support: inconsistent dimensions.");
146 return this->
c.dot(d);
152 if (this->
n != x.size())
153 throw std::invalid_argument(
"Contains point: inconsistent dimensions");
161 return {this->
c, this->
c};
Zonotope class for ZonoOpt library.
Box (i.e., interval vector) class.
Definition Intervals.hpp:718
Hybrid zonotope class.
Definition HybZono.hpp:44
int nC
number of constraints
Definition HybZono.hpp:482
int n
set dimension
Definition HybZono.hpp:470
bool zero_one_form
flag to indicate whether the set is in 0-1 or -1-1 form
Definition HybZono.hpp:485
Eigen::SparseMatrix< zono_float > Gc
continuous generator matrix
Definition HybZono.hpp:449
Eigen::SparseMatrix< zono_float > Gb
binary generator matrix
Definition HybZono.hpp:452
int nG
total number of factors. nG = nGc + nGb
Definition HybZono.hpp:473
bool sharp
flag to indicate whether the set is known to be sharp (i.e., convex relaxation = convex hull)
Definition HybZono.hpp:488
Eigen::Vector< zono_float, -1 > c
center vector
Definition HybZono.hpp:464
int nGb
number of binary factors
Definition HybZono.hpp:479
Eigen::SparseMatrix< zono_float > A
constraint matrix A = [Ac, Ab]
Definition HybZono.hpp:455
Eigen::Vector< zono_float, -1 > b
constraint vector
Definition HybZono.hpp:467
Eigen::SparseMatrix< zono_float > Ab
binary constraint matrix
Definition HybZono.hpp:461
Eigen::SparseMatrix< zono_float > Ac
continuous constraint matrix
Definition HybZono.hpp:458
Eigen::SparseMatrix< zono_float > G
generator matrix G = [Gc, Gb]
Definition HybZono.hpp:446
int nGc
number of continuous factors
Definition HybZono.hpp:476
Point class.
Definition Point.hpp:28
Box do_bounding_box(const OptSettings &, OptSolution *) override
Definition Point.hpp:159
bool do_contains_point(const Eigen::Vector< zono_float, -1 > &x, const OptSettings &, OptSolution *) const override
Definition Point.hpp:149
void convert_form() override
Converts the set representation between -1-1 and 0-1 forms.
Definition Point.hpp:67
Eigen::Vector< zono_float, -1 > do_project_point(const Eigen::Vector< zono_float, -1 > &x, const OptSettings &, OptSolution *) const override
Definition Point.hpp:125
Point(const Eigen::Vector< zono_float, -1 > &c)
Point constructor.
Definition Point.hpp:43
void set(const Eigen::Vector< zono_float, -1 > &c)
Reset point object with the given parameters.
Definition Point.hpp:88
void remove_redundancy(int) override
Removes redundant constraints and any unused generators.
Definition Point.hpp:66
std::string print() const override
Returns set information as a string.
Definition Point.hpp:109
Point()
Default constructor for Point class.
Definition Point.hpp:36
zono_float do_support(const Eigen::Vector< zono_float, -1 > &d, const OptSettings &, OptSolution *) override
Definition Point.hpp:137
HybZono * clone() const override
Clone method for polymorphic behavior.
Definition Point.hpp:57
Eigen::Vector< zono_float, -1 > do_optimize_over(const Eigen::SparseMatrix< zono_float > &, const Eigen::Vector< zono_float, -1 > &, zono_float, const OptSettings &, OptSolution *) const override
Definition Point.hpp:118
Zonotope class.
Definition Zono.hpp:33
#define zono_float
Defines the floating-point type used in ZonoOpt.
Definition ZonoOpt.hpp:43
#define zono_eps
Defines the precision used for floating point comparisons in ZonoOpt.
Definition ZonoOpt.hpp:51
Settings for optimization routines in ZonoOpt library.
Definition SolverDataStructures.hpp:26
Solution data structure for optimization routines in ZonoOpt library.
Definition SolverDataStructures.hpp:153