A toolkit for working with phylogenetic data.
v0.18.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
algorithm.hpp File Reference

Detailed Description

Provides some valuable algorithms that are not part of the C++ 11 STL.

Definition in file algorithm.hpp.

#include <algorithm>
#include <cassert>
#include <cmath>
#include <functional>
#include <numeric>
#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<class C , class T >
bool contains (const C &v, const T &x)
 Returns whether a container object has a certain element. More...
 
template<class Container , class UnaryPredicate >
void erase_if (Container &c, UnaryPredicate p)
 Erases all elements from the container that satisfy a given predicate. An element is erased, if the predicate evaluates to true for it. The predicate needs to have a signature similar to (T const&)->bool. More...
 
template<typename RandomAccessIterator , typename Comparator >
std::vector< size_t > sort_indices (RandomAccessIterator first, RandomAccessIterator last, Comparator comparator)
 Get the indices to the sorted order of the given range. More...
 
template<typename RandomAccessIterator >
std::vector< size_t > sort_indices (RandomAccessIterator first, RandomAccessIterator last)
 Get the indices to the sorted order of the given range. More...
 
template<typename RandomAccessIterator , typename Comparator >
std::vector< size_t > stable_sort_indices (RandomAccessIterator first, RandomAccessIterator last, Comparator comparator)
 Get the indices to the stable sorted order of the given range. More...
 
template<typename RandomAccessIterator >
std::vector< size_t > stable_sort_indices (RandomAccessIterator first, RandomAccessIterator last)
 Get the indices to the stable sorted order of the given range. More...