mirror of
https://github.com/davisking/dlib.git
synced 2024-11-01 10:14:53 +08:00
Added order_by_descending_distance()
This commit is contained in:
parent
2d034a58a0
commit
7f22ec06b8
@ -95,6 +95,15 @@ namespace dlib
|
||||
return a.distance() < b.distance();
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline bool order_by_descending_distance (
|
||||
const T& a,
|
||||
const T& b
|
||||
)
|
||||
{
|
||||
return a.distance() > b.distance();
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
bool order_by_distance_and_index (
|
||||
const T& a,
|
||||
|
@ -114,6 +114,20 @@ namespace dlib
|
||||
used with std::sort().
|
||||
!*/
|
||||
|
||||
template <typename T>
|
||||
bool order_by_descending_distance (
|
||||
const T& a,
|
||||
const T& b
|
||||
) { return a.distance() > b.distance(); }
|
||||
/*!
|
||||
requires
|
||||
- T is a type with an interface compatible with sample_pair.
|
||||
ensures
|
||||
- provides a total ordering of sample_pair objects that causes pairs with
|
||||
largest distance to be the first in a sorted list. This function can be
|
||||
used with std::sort().
|
||||
!*/
|
||||
|
||||
template <typename T>
|
||||
bool order_by_distance_and_index (
|
||||
const T& a,
|
||||
|
Loading…
Reference in New Issue
Block a user