UFO
ufo::metofficesortdetail Namespace Reference

Functions

template<typename RandomIt , typename UnaryOperation >
void sinkParent (typename RandomIt::difference_type parentIndex, RandomIt heapStart, typename RandomIt::difference_type heapLength, const UnaryOperation &key)
 
template<typename RandomIt , typename UnaryOperation >
void makeHeap (RandomIt first, RandomIt last, const UnaryOperation &key)
 Arrange the range [first, last) into a max-heap ordered by key key. More...
 
template<typename RandomIt , typename UnaryOperation >
void sortHeap (RandomIt first, RandomIt last, const UnaryOperation &key)
 Sort the heap [first, last) in the order of ascending keys. More...
 

Function Documentation

◆ makeHeap()

template<typename RandomIt , typename UnaryOperation >
void ufo::metofficesortdetail::makeHeap ( RandomIt  first,
RandomIt  last,
const UnaryOperation &  key 
)

Arrange the range [first, last) into a max-heap ordered by key key.

Definition at line 55 of file src/ufo/utils/metoffice/MetOfficeSort.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sinkParent()

template<typename RandomIt , typename UnaryOperation >
void ufo::metofficesortdetail::sinkParent ( typename RandomIt::difference_type  parentIndex,
RandomIt  heapStart,
typename RandomIt::difference_type  heapLength,
const UnaryOperation &  key 
)

Sink element parentIndex of the heap starting at heapStart with heapLength elements until its correct position.

If the parent's key is smaller than the key of any of its children, the parent is swapped with its largest child. This is repeated until the parent's key is at least as large as the keys of its children.

Definition at line 24 of file src/ufo/utils/metoffice/MetOfficeSort.h.

Here is the caller graph for this function:

◆ sortHeap()

template<typename RandomIt , typename UnaryOperation >
void ufo::metofficesortdetail::sortHeap ( RandomIt  first,
RandomIt  last,
const UnaryOperation &  key 
)

Sort the heap [first, last) in the order of ascending keys.

Definition at line 65 of file src/ufo/utils/metoffice/MetOfficeSort.h.

Here is the call graph for this function:
Here is the caller graph for this function: