mirror of https://github.com/CGAL/cgal
Adding less-than operator (<) to Point_d
This commit is contained in:
parent
4af747178a
commit
35b3b09ab8
|
|
@ -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<Kernel>& 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<Kernel>& 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<Kernel>& 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<Kernel>& q);
|
||||
|
||||
/// @}
|
||||
|
||||
}; /* end Point_d */
|
||||
|
|
|
|||
|
|
@ -93,6 +93,14 @@ public:
|
|||
Self& operator-=(const Vector_d<R>& v)
|
||||
{ return static_cast<Self&>(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
|
||||
|
|
|
|||
Loading…
Reference in New Issue