PolyDiM
C++ library for POLYtopal DIscretization Methods
Loading...
Searching...
No Matches
Gedim::Utilities Class Reference

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 intRandomArrayNoRepetition (const unsigned int &n, const unsigned int &maxNumber=RAND_MAX, const unsigned int &seed=time(nullptr))
 
template<typename T >
static std::vector< unsigned intSortArrayIndices (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)
 

Detailed Description

Static class fot generic functions.

Member Function Documentation

◆ BinomialCoefficient()

static double Gedim::Utilities::BinomialCoefficient ( const unsigned int n,
const unsigned int k 
)
inlinestatic

Compute the binomial coefficient (n k)

◆ CombinationWithRepetition()

list< vector< int > > Gedim::Utilities::CombinationWithRepetition ( int  n,
int  k 
)
static

create Combination With Repetition with n elements in k subset

Parameters
nsize of elements
ksize of subset

◆ RandomArrayNoRepetition()

std::vector< unsigned int > Gedim::Utilities::RandomArrayNoRepetition ( const unsigned int n,
const unsigned int maxNumber = RAND_MAX,
const unsigned int seed = time(nullptr) 
)
static
Parameters
nsize of elements
seedthe side
Returns
random array

◆ RandomSeed()

static unsigned int Gedim::Utilities::RandomSeed ( )
inlinestatic

◆ Shuffle()

template<class container >
static void Gedim::Utilities::Shuffle ( container array,
const unsigned int seed = time(nullptr) 
)
inlinestatic

Shuffle an array.

◆ Slope()

static double Gedim::Utilities::Slope ( _InputIterator  x_begin,
_InputIterator  y_begin,
const unsigned int n 
)
inlinestatic

Compute the regression line slope of points (x,y).

Parameters
x_beginStart of x range.
y_beginStart of y range.
nthe number of points
Returns
The slope.

◆ SortArrayIndices()

template<typename T >
static std::vector< unsigned int > Gedim::Utilities::SortArrayIndices ( const std::vector< T > &  array)
inlinestatic

Gives you back the array sorted indices.

Parameters
arraythe array to sort
Returns
the indices of the array ordered

◆ Union()

template<typename T >
static T Gedim::Utilities::Union ( const std::initializer_list< T > &  arrays)
inlinestatic

◆ Unused()

template<class T >
static void Gedim::Utilities::Unused ( const T )
inlinestatic

Tells the compiler the parameter is unused.


The documentation for this class was generated from the following files: