#include "Matrix.h"
#include <type_traits>
#include <vector>
Go to the source code of this file.
◆ insertion_sort() [1/2]
◆ insertion_sort() [2/2]
template<
typename T ,
typename = typename std::enable_if<std::is_arithmetic<T>::value, T>::type>
Insertion sort for numerical vectors of type T
- Template Parameters
-
- Parameters
-
elem | element to insert into given vector |
vec | given vector to add the element to |
current_index | vector index of last element |
◆ sort() [1/2]
◆ sort() [2/2]
template<
typename T ,
typename = typename std::enable_if<std::is_arithmetic<T>::value, T>::type>
std::vector< T > sort |
( |
const std::vector< T > & |
in | ) |
|
Sort given vector of elements of numerical type T
currently using insertion sort, might change at some point
- Template Parameters
-
- Parameters
-
- Returns
- sorted vector with ascending values
- Examples
- TestSorting.cpp.