Biomedical Image Analysis Library
The Biomedical Image Analysis Library is a poweful tool for developers, physicians, researchers, engineers, and so on.
|
Extensions for sorting methods. More...
Functions | |
template<template< class D > class C, class D > | |
size_t | BinarySearch (const C< D > &data, D val, size_t min=0) |
First vector index found in a binary search for 'val' in 'data' vector between min and the last indexes (extremities included). If the 'data' does not have any 'val' element, the function returns the next index to the expected position, limited by the index range. More... | |
template<template< class D > class C, class D > | |
size_t | BinarySearch (const C< D > &data, D val, size_t min, size_t max) |
First vector index found in a binary search for 'val' in 'data' vector between min and max indexes (extremities included). If the 'data' does not have any 'val' element, the function returns the next index to the expected position, limited by the index range. More... | |
template<template< class D > class C, class D > | |
void | Sort (C< D > &data, Vector< size_t > &order, size_t min_idx, size_t max_idx, bool increasing) |
Auxiliary recursive function for quick sort. More... | |
template<template< class D > class C, class D > | |
Vector< size_t > | Sort (C< D > &data, bool increasing=true) |
Sorts data and returns a Vector with the sorted indexes. More... | |
template<template< class D > class C, class D > | |
void | Sort (C< D > &data, const Vector< size_t > &order) |
Sorts data according to the sorting indexes in order vector. May be used with the return vector of Sort( C< D > &data, bool increasing ) function to sort other containers in the same order. More... | |
Extensions for sorting methods.
size_t Bial::Sorting::BinarySearch | ( | const C< D > & | data, |
D | val, | ||
size_t | min = 0 |
||
) |
First vector index found in a binary search for 'val' in 'data' vector between min and the last indexes (extremities included). If the 'data' does not have any 'val' element, the function returns the next index to the expected position, limited by the index range.
data | A sorted random access data structure that implements size( ) and operator[]( size_t ) functions. E.G. Vector, std::deque, Matrix, Image. |
val | Value to be found. |
min | Minimum search index. |
size_t Bial::Sorting::BinarySearch | ( | const C< D > & | data, |
D | val, | ||
size_t | min, | ||
size_t | max | ||
) |
First vector index found in a binary search for 'val' in 'data' vector between min and max indexes (extremities included). If the 'data' does not have any 'val' element, the function returns the next index to the expected position, limited by the index range.
data | A sorted random access data structure that implements size( ) and operator[]( size_t ) functions. E.G. Vector, std::deque, Matrix, Image. |
val | Value to be found. |
min | Minimum search index. |
max | Maximum search index. |
void Bial::Sorting::Sort | ( | C< D > & | data, |
Vector< size_t > & | order, | ||
size_t | min_idx, | ||
size_t | max_idx, | ||
bool | increasing | ||
) |
Auxiliary recursive function for quick sort.
data | A random access data structure that implements size( ) and operator[]( size_t ) functions. E.G. Vector, std::deque, Matrix, Image. |
min_idx | Minimum index of the elements to be sorted. |
max_idx | Maximum index of the elements to be sorted. |
increasing | If sorting in increasing or decreasing order. |
Vector< size_t > Bial::Sorting::Sort | ( | C< D > & | data, |
bool | increasing = true |
||
) |
Sorts data and returns a Vector with the sorted indexes.
data | A random access data structure that implements size( ) and operator[]( size_t ) functions. E.G. Vector, std::deque, Matrix, Image. |
increasing | If sorting in increasing or decreasing order. |
void Bial::Sorting::Sort | ( | C< D > & | data, |
const Vector< size_t > & | order | ||
) |
Sorts data according to the sorting indexes in order vector. May be used with the return vector of Sort( C< D > &data, bool increasing ) function to sort other containers in the same order.
data | A random access data structure that implements size( ) and operator[]( size_t ) functions. E.G. Vector, std::deque, Matrix, Image. |
order | vector with the sorting indexes. |