A library for working with phylogenetic and population genetic data.
v0.32.0
ranking.hpp File Reference
#include "genesis/utils/core/algorithm.hpp"
#include <algorithm>
#include <cassert>
#include <cmath>
#include <cstdlib>
#include <queue>
#include <utility>
#include <vector>

Go to the source code of this file.

Namespaces

 genesis
 Container namespace for all symbols of genesis in order to keep them separate when used as a library.
 
 genesis::utils
 

Functions

template<typename ForwardIterator , typename T = typename ForwardIterator::value_type, typename Comp = std::less<T>>
std::vector< T > n_first_elements (ForwardIterator first, ForwardIterator last, size_t n, Comp comp=std::less< T >{})
 Return the n first elements of a given input range in sorting order. More...
 
template<class RandomAccessIterator >
std::vector< size_t > ranking_dense (RandomAccessIterator first, RandomAccessIterator last)
 Return the ranking of the values in the given range, using Dense ranking ("1223" ranking). More...
 
std::vector< size_t > ranking_dense (std::vector< double > const &vec)
 Return the ranking of the values in the given range, using Dense ranking ("1223" ranking). More...
 
template<class RandomAccessIterator >
std::vector< double > ranking_fractional (RandomAccessIterator first, RandomAccessIterator last)
 Return the ranking of the values in the given range, using Fractional ranking ("1 2.5 2.5 4" ranking). More...
 
std::vector< double > ranking_fractional (std::vector< double > const &vec)
 Return the ranking of the values in the given range, using Fractional ranking ("1 2.5 2.5 4" ranking). More...
 
template<class RandomAccessIterator >
std::vector< size_t > ranking_modified (RandomAccessIterator first, RandomAccessIterator last)
 Return the ranking of the values in the given range, using Modified competition ranking ("1334" ranking). More...
 
std::vector< size_t > ranking_modified (std::vector< double > const &vec)
 Return the ranking of the values in the given range, using Modified competition ranking ("1334" ranking). More...
 
template<class RandomAccessIterator >
std::vector< size_t > ranking_ordinal (RandomAccessIterator first, RandomAccessIterator last)
 Return the ranking of the values in the given range, using Ordinal ranking ("1234" ranking). More...
 
std::vector< size_t > ranking_ordinal (std::vector< double > const &vec)
 Return the ranking of the values in the given range, using Ordinal ranking ("1234" ranking). More...
 
template<class RandomAccessIterator >
std::vector< size_t > ranking_standard (RandomAccessIterator first, RandomAccessIterator last)
 Return the ranking of the values in the given range, using Standard competition ranking ("1224" ranking). More...
 
std::vector< size_t > ranking_standard (std::vector< double > const &vec)
 Return the ranking of the values in the given range, using Standard competition ranking ("1224" ranking). More...