2
0
mirror of https://github.com/boostorg/ublas.git synced 2026-02-21 03:22:14 +00:00

FIX index_pair and index_tripler LessTen Comparable

[SVN r34361]
This commit is contained in:
Michael Stevens
2006-06-20 18:55:30 +00:00
parent 79a455dbea
commit ffbfa47181

View File

@@ -1582,10 +1582,15 @@ namespace boost { namespace numeric { namespace ublas {
bool equal(const self_type& rhs) const {
return (v1_ == rhs.v1_);
}
BOOST_UBLAS_INLINE
bool less(const self_type& rhs) const {
return (v1_ < rhs.v1_);
}
BOOST_UBLAS_INLINE
bool greater(const self_type& rhs) const {
return (v1_ > rhs.v1_);
}
BOOST_UBLAS_INLINE
friend bool operator == (const self_type& lhs, const self_type& rhs) {
return lhs.equal(rhs);
}
@@ -1597,6 +1602,18 @@ namespace boost { namespace numeric { namespace ublas {
friend bool operator < (const self_type& lhs, const self_type& rhs) {
return lhs.less(rhs);
}
BOOST_UBLAS_INLINE
friend bool operator >= (const self_type& lhs, const self_type& rhs) {
return !lhs.less(rhs);
}
BOOST_UBLAS_INLINE
friend bool operator > (const self_type& lhs, const self_type& rhs) {
return lhs.greater(rhs);
}
BOOST_UBLAS_INLINE
friend bool operator <= (const self_type& lhs, const self_type& rhs) {
return !lhs.greater(rhs);
}
private:
size_type i_;
@@ -1747,6 +1764,11 @@ namespace boost { namespace numeric { namespace ublas {
(v1_ == rhs.v1_ && v2_ < rhs.v2_));
}
BOOST_UBLAS_INLINE
bool greater(const self_type& rhs) const {
return ((v1_ > rhs.v1_) ||
(v1_ == rhs.v1_ && v2_ > rhs.v2_));
}
BOOST_UBLAS_INLINE
friend bool operator == (const self_type& lhs, const self_type& rhs) {
return lhs.equal(rhs);
}
@@ -1758,6 +1780,18 @@ namespace boost { namespace numeric { namespace ublas {
friend bool operator < (const self_type& lhs, const self_type& rhs) {
return lhs.less(rhs);
}
BOOST_UBLAS_INLINE
friend bool operator >= (const self_type& lhs, const self_type& rhs) {
return !lhs.less(rhs);
}
BOOST_UBLAS_INLINE
friend bool operator > (const self_type& lhs, const self_type& rhs) {
return lhs.greater(rhs);
}
BOOST_UBLAS_INLINE
friend bool operator <= (const self_type& lhs, const self_type& rhs) {
return !lhs.greater(rhs);
}
private:
size_type i_;