irafhy
Interval arithmetic based Reachability Analysis Framework for Hybrid Automaton
halfSpace.h
Go to the documentation of this file.
1 #ifndef REPRESENTATION_GEOMETRIC_BASIC_HALFSPACE_H
2 #define REPRESENTATION_GEOMETRIC_BASIC_HALFSPACE_H
3 
5 
6 namespace irafhy
7 {
8  class HalfSpace
9  {
10  private:
14  Eigen::VectorXd normal_;
18  double offset_;
19 
20  public:
26  static HalfSpace Empty(std::size_t dimension = 0);
27 
28  public:
32  HalfSpace();
37  HalfSpace(const HalfSpace& halfSpace) = default;
42  HalfSpace(HalfSpace&& halfSpace) = default;
48  HalfSpace(const Eigen::VectorXd& normal, double offset);
54  HalfSpace(Eigen::VectorXd&& normal, double&& offset);
58  virtual ~HalfSpace() = default;
63  [[nodiscard]] int dimension() const;
68  [[nodiscard]] Eigen::VectorXd normal() const;
73  [[nodiscard]] double offset() const;
79  [[nodiscard]] bool contains(const Point& point) const;
85  [[nodiscard]] bool contains(const Eigen::VectorXd& coordinate) const;
91  [[nodiscard]] bool holds(const Point& point) const;
97  [[nodiscard]] bool holds(const Eigen::VectorXd& coordinate) const;
105  bool intersect(const Eigen::VectorXd& lhsEndPoint,
106  const Eigen::VectorXd& rhsEndPoint,
107  Eigen::VectorXd& intersection) const;
113  HalfSpace& operator=(const HalfSpace& halfSpace) = default;
119  HalfSpace& operator=(HalfSpace&& halfSpace) noexcept = default;
124  HalfSpace& operator-();
129  HalfSpace& reverse();
130  };
131 
138  std::ostream& operator<<(std::ostream& out, const HalfSpace& halfSpace);
144  const HalfSpace operator-(const HalfSpace& halfSpace);
145 } // namespace irafhy
146 #endif //REPRESENTATION_GEOMETRIC_BASIC_HALFSPACE_H
Eigen::VectorXd normal_
normal of the half space which defined by normal * x + offset <= 0
Definition: halfSpace.h:14
std::ostream & operator<<(std::ostream &out, const Condition &rhs)
output the right hand side condition to the standard out stream
Definition: condition.cpp:246
HalfSpace()
default constructor
Definition: halfSpace.cpp:7
HalfSpace & operator=(const HalfSpace &halfSpace)=default
assignment operator
double offset() const
get the offset of the half space
Definition: halfSpace.cpp:29
HalfSpace & operator-()
reverse the normal of the half space
Definition: halfSpace.cpp:69
int dimension() const
get the dimension of the half space
Definition: halfSpace.cpp:25
HalfSpace & reverse()
reverse the normal the of the half space
Definition: halfSpace.cpp:76
Definition: point.h:10
bool holds(const Point &point) const
check if the given point on the boundary of the half space or not
Definition: halfSpace.cpp:35
Definition: condition.cpp:3
static HalfSpace Empty(std::size_t dimension=0)
static constructor of Empty half space object
Definition: halfSpace.cpp:5
Eigen::VectorXd normal() const
get the normal of the half space
Definition: halfSpace.cpp:27
double offset_
offset used to define the half space
Definition: halfSpace.h:18
bool intersect(const Eigen::VectorXd &lhsEndPoint, const Eigen::VectorXd &rhsEndPoint, Eigen::VectorXd &intersection) const
check if the line segment between two points intersect with the half space or not ...
Definition: halfSpace.cpp:45
Definition: halfSpace.h:8
bool contains(const Point &point) const
check if the given point inside the half space or not
Definition: halfSpace.cpp:31
virtual ~HalfSpace()=default
destructor