Static class fot generic functions. More...
#include <CommonUtilities.hpp>
Static Public Member Functions | |
| template<class T > | |
| static void | Unused (const T &) |
| Tells the compiler the parameter is unused. | |
| static unsigned int | RandomSeed () |
| static std::list< std::vector< int > > | CombinationWithRepetition (int n, int k) |
| create Combination With Repetition with n elements in k subset | |
| template<class container > | |
| static void | Shuffle (container &array, const unsigned int &seed=time(nullptr)) |
| Shuffle an array. | |
| static std::vector< unsigned int > | RandomArrayNoRepetition (const unsigned int &n, const unsigned int &maxNumber=RAND_MAX, const unsigned int &seed=time(nullptr)) |
| template<typename T > | |
| static std::vector< unsigned int > | SortArrayIndices (const std::vector< T > &array) |
| Gives you back the array sorted indices. | |
| template<typename _InputIterator > | |
| static double | Slope (_InputIterator x_begin, _InputIterator y_begin, const unsigned int &n) |
| Compute the regression line slope of points (x,y). | |
| static double | BinomialCoefficient (const unsigned int &n, const unsigned int &k) |
| Compute the binomial coefficient (n k) | |
| template<typename T > | |
| static T | Union (const std::initializer_list< T > &arrays) |
Static class fot generic functions.
|
inlinestatic |
Compute the binomial coefficient (n k)
create Combination With Repetition with n elements in k subset
| n | size of elements |
| k | size of subset |
|
static |
| n | size of elements |
| seed | the side |
|
inlinestatic |
Shuffle an array.
|
inlinestatic |
Compute the regression line slope of points (x,y).
| x_begin | Start of x range. |
| y_begin | Start of y range. |
| n | the number of points |
|
inlinestatic |
Gives you back the array sorted indices.
| array | the array to sort |
Tells the compiler the parameter is unused.