Utilities
utils
Functions
-
void file_error(const std::string &input)
File not found error.
- Parameters:
input – filename or path
Variables
-
constexpr int error_file = 1
error as no file found
-
namespace std
STL namespace.
Functions
sort
Functions
-
template<typename type, typename lambda>
void mergeargsort_serial(int32_t *index, type *arr, const int32_t &start, const int32_t &end, lambda order) Mergesort of the indexes serial.
This function is the serial version of the sorting using indexes. The original array is unchanged at the end of the function but the indexes for its reordering are evaluated and stored into the
indexesvariable. See numpy.argsort in Python as analogy.- Template Parameters:
type – Input array type
lambda – Function for the comparison evaluation
- Parameters:
index – Array of indexes (it must have the same size of
arr)arr – Array of values to reorder
start – Starting point for the reordering (commonly set to
0)end – End point for the reordering (commonly set to
array_size)order – Lambda function for the comparison evaluation
-
template<typename type, typename lambda>
void mergeargsort_parallel_omp(int32_t *index, type *arr, const int32_t &start, const int32_t &end, const int32_t &threads, lambda order) Mergesort of the indexes with OMP multithreading support.
This function is the parallel version of the sorting using indexes. The original array is unchanged at the end of the function but the indexes for its reordering are evaluated and stored into the
indexesvariable. See numpy.argsort in Python as analogy.- Template Parameters:
type – Input array type
lambda – Function for the comparison evaluation
- Parameters:
index – Array of indexes (it must have the same size of
arr)arr – Array of values to reorder
start – Starting point for the reordering (commonly set to
0, but it is used for the parallelization master-slave)end – End point for the reordering (commonly set to
array_size)threads – Number of threads to use in the evaluation
order – Lambda function for the comparison evaluation