Relational Operators
These are non-member functions.
Method |
---|
Multimap |
Compares the values in the multimap |
template <class K, size_t M, class T, class C, class A> bool operator==(const front<K, M, T, C, A> &lhs, const front<K, M, T, C, A> &rhs); |
template <class K, size_t M, class T, class C, class A> bool operator!=(const front<K, M, T, C, A> &lhs, const front<K, M, T, C, A> &rhs); |
FrontContainer |
Front-Front Comparison |
template <typename K, size_t M, typename T, typename C> bool operator<(const front<K, M, T, C> &lhs, const front<K, M, T, C> &rhs); |
template <typename K, size_t M, typename T, typename C> bool operator>(const front<K, M, T, C> &lhs, const front<K, M, T, C> &rhs) |
template <typename K, size_t M, typename T, typename C> bool operator<=(const front<K, M, T, C> &lhs, const front<K, M, T, C> &rhs) |
template <typename K, size_t M, typename T, typename C> bool operator>=(const front<K, M, T, C> &lhs, const front<K, M, T, C> &rhs) |
Front-Point Comparison |
template <typename K, size_t M, typename T, typename C> bool operator<(const front<K, M, T, C> &lhs, const typename front<K, M, T, C>::key_type &rhs) |
template <typename K, size_t M, typename T, typename C> bool operator>(const front<K, M, T, C> &lhs, const typename front<K, M, T, C>::key_type &rhs) |
template <typename K, size_t M, typename T, typename C> bool operator<=(const front<K, M, T, C> &lhs, const typename front<K, M, T, C>::key_type &rhs) |
template <typename K, size_t M, typename T, typename C> bool operator>=(const front<K, M, T, C> &lhs, const typename front<K, M, T, C>::key_type &rhs) |
template <typename K, size_t M, typename T, typename C> bool operator<(const typename front<K, M, T, C>::key_type &lhs, const front<K, M, T, C> &rhs) |
template <typename K, size_t M, typename T, typename C> bool operator>(const typename front<K, M, T, C>::key_type &lhs, const front<K, M, T, C> &rhs) |
template <typename K, size_t M, typename T, typename C> bool operator<=(const typename front<K, M, T, C>::key_type &lhs, const front<K, M, T, C> &rhs) |
template <typename K, size_t M, typename T, typename C> bool operator>=(const typename front<K, M, T, C>::key_type &lhs, const front<K, M, T, C> &rhs) |
Parameters
lhs
,rhs
-front
s orkey_type
s whose contents to compare
Return value
operator==
,operator!=
:true
if the internal contents of thefront
s are equal, false otherwise.operator<
,operator>
,operator<=
,operator>=
: true if frontlhs
(or a front containing onlylhs
as a point) dominatesrhs
Complexity
operator==
,operator!=
: \(O(mn)\)operator<
,operator>
,operator<=
,operator>=
: \(O(m n \log n)\) for fronts and \(O(m \log n)\) for points
\[
O(1)
\]
Notes
In addition to the equality and inequality operators defined for spatial containers, the front contains includes relational operators.
In the context of fronts, operator<
return true if the front lhs
dominates the front rhs
. When one of these parameters is a point, we treat this point as if it were front with a single point.
Info
Although these operators could be defined in other ways, the operators operator<
, operator>
, operator<=
, operator>=
as defined here are are later useful for pareto::archive
containers, which need to sort fronts by their dominance relationships.
Example
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
|
1 2 3 |
|