Skip to content

Commit

Permalink
added is_normalized function to all types of bodies
Browse files Browse the repository at this point in the history
  • Loading branch information
lucaperju committed Jul 17, 2024
1 parent 87c9af1 commit 92a5132
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 0 deletions.
6 changes: 6 additions & 0 deletions include/convex_bodies/ballintersectconvex.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@ class BallIntersectPolytope {
return P.get_vec();
}

bool is_normalized () {
return true;
}

void normalize() {}

int is_in(PointType const& p) const
{
if (B.is_in(p)==-1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,12 @@ class CorrelationSpectrahedron : public Spectrahedron<Point>{
MT get_mat() const {
return MT::Identity(this->d, this->d);
}

bool is_normalized () {
return true;
}

void normalize() {}
};

#endif //VOLESTI_CONVEX_BODIES_CORRELATION_MATRICES_VOLESTI_CORRELATION_SPECTRAHEDRON_HPP
4 changes: 4 additions & 0 deletions include/convex_bodies/orderpolytope.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ class OrderPolytope {
return b;
}

bool is_normalized ()
{
return _normalized;
}

// print polytope in Ax <= b format
void print() const
Expand Down
7 changes: 7 additions & 0 deletions include/convex_bodies/spectrahedra/spectrahedron.h
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,13 @@ class Spectrahedron {
{
return MT::Identity(lmi.dimension(), lmi.dimension());
}

bool is_normalized ()
{
return true;
}

void normalize() {}

void resetFlags()
{
Expand Down
4 changes: 4 additions & 0 deletions include/convex_bodies/vpolyintersectvpoly.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@ class IntersectionOfVpoly {
return P1.get_vec();
}

bool is_normalized () {
return true;
}

MT get_T() const {
return P1.get_mat();
}
Expand Down
4 changes: 4 additions & 0 deletions include/convex_bodies/vpolytope.h
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,10 @@ class VPolytope {
return b;
}

bool is_normalized () {
return true;
}

// change the matrix V
void set_mat(const MT &V2) {
V = V2;
Expand Down
6 changes: 6 additions & 0 deletions include/convex_bodies/zonoIntersecthpoly.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,12 @@ class ZonoIntersectHPoly {
return HP.get_vec();
}

bool is_normalized () {
return true;
}

void normalize() {}

std::pair<PointType,NT> InnerBall() const
{
return Z.InnerBall();
Expand Down
5 changes: 5 additions & 0 deletions include/convex_bodies/zpolytope.h
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,11 @@ class Zonotope {
return b;
}

bool is_normalized ()
{
return true;
}

// change the matrix V
void set_mat(MT const& V2)
{
Expand Down

0 comments on commit 92a5132

Please sign in to comment.