diff --git a/Kernel_d/doc/Kernel_d/CGAL/Kernel_d/Point_d.h b/Kernel_d/doc/Kernel_d/CGAL/Kernel_d/Point_d.h index 772363a625bc..b1493b3fda67 100644 --- a/Kernel_d/doc/Kernel_d/CGAL/Kernel_d/Point_d.h +++ b/Kernel_d/doc/Kernel_d/CGAL/Kernel_d/Point_d.h @@ -241,6 +241,38 @@ the origin. */ bool operator==(const Origin&) ; +/*! +returns true iff `p` is lexicographically +smaller than `q` with respect to %Cartesian +lexicographic order of points. +\pre `p.dimension() == q.dimension()`. +*/ +bool operator<(const Point_d& q); + +/*! +returns true iff `p` is lexicographically +greater than `q` with respect to %Cartesian +lexicographic order of points. +\pre `p.dimension() == q.dimension()`. +*/ +bool operator>(const Point_d& q); + +/*! +returns true iff `p` is lexicographically +smaller than or equal to `q` with respect to %Cartesian +lexicographic order of points. +\pre `p.dimension() == q.dimension()`. +*/ +bool operator<=(const Point_d& q); + +/*! +returns true iff `p` is lexicographically +greater than or equal to `q` with respect to %Cartesian +lexicographic order of points. +\pre `p.dimension() == q.dimension()`. +*/ +bool operator>=(const Point_d& q); + /// @} }; /* end Point_d */ diff --git a/Kernel_d/include/CGAL/Kernel_d/Point_d.h b/Kernel_d/include/CGAL/Kernel_d/Point_d.h index 6f9434609b94..703a82021738 100644 --- a/Kernel_d/include/CGAL/Kernel_d/Point_d.h +++ b/Kernel_d/include/CGAL/Kernel_d/Point_d.h @@ -93,6 +93,14 @@ class Point_d : public pR::Point_d_base Self& operator-=(const Vector_d& v) { return static_cast(Base::operator-=(v)); } + inline bool operator<(const Self& q) const + { return R().less_lexicographically_d_object()(*this, q); } + inline bool operator>(const Self& q) const + { return R().less_lexicographically_d_object()(q, *this); } + inline bool operator<=(const Self& q) const + { return ! R().less_lexicographically_d_object()(q, *this); } + inline bool operator>=(const Self& q) const + { return ! R().less_lexicographically_d_object()(*this, q); } }; } //namespace CGAL