#include "Matrix.h"
#include <type_traits>
#include <vector>
Go to the source code of this file.
|
template<typename T , typename = typename std::enable_if<std::is_arithmetic<T>::value, T>::type> |
void | insertion_sort (const T &elem, std::vector< T > &vec, const int ¤t_index) |
|
template<typename T , typename = typename std::enable_if<std::is_arithmetic<T>::value, T>::type> |
std::vector< T > | sort (const std::vector< T > &in) |
|
template<typename T > |
void | insertion_sort (const T &elem, Matrix< T > &out, const int ¤t_index) |
|
template<typename T > |
Matrix< T > | sort (const Matrix< T > &in) |
|
◆ insertion_sort() [1/2]
template<typename T >
void insertion_sort |
( |
const T & |
elem, |
|
|
Matrix< T > & |
out, |
|
|
const int & |
current_index |
|
) |
| |
◆ insertion_sort() [2/2]
template<typename T , typename = typename std::enable_if<std::is_arithmetic<T>::value, T>::type>
void insertion_sort |
( |
const T & |
elem, |
|
|
std::vector< T > & |
vec, |
|
|
const int & |
current_index |
|
) |
| |
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.