Random numbers using GSL | |
void | rng_init () |
Initializes the random number generator. | |
double | randomFlat () |
Retruns a random number in the interval ]0;1[. | |
double | randomGaussian (double mu, double sigma) |
Retruns a random number on a Gaussian distribution. | |
double | randomExp (double mu) |
Retruns a random number on a Gaussian distribution. | |
double | randomRayleigh (double sigma) |
Retruns a random number on a Rayleigh distribution. | |
Mathematical scalar functions using GSL | |
double | bessel (double x, int n) |
double | airy (double x) |
double | erf (double x) |
double | gamma (double x) |
double | beta (double a, double b) |
double | factorial (int n) |
Return the factorial of n. | |
double | binomialCoefficient (int n, int k) |
Return the binomial coefficient of n and k, . | |
String tools | |
*string | fileNumber (int number, int ndigits=0) |
Create a string from an integer. | |
template<class T> | |
*string | formatNumber (T number, const char *format) |
Format a number. | |
template<class T> | |
string | sconv (T t) |
Convert an object of any type to a string. | |
template<class T> | |
T | conv (string s) |
template<class T> | |
T | getField (string str, int field) |
template<> | |
string | getField< string > (string str, int field) |
Standard scalar functions | |
template<class T> | |
largest< float, T >::type | sinc (T x) |
Return sinc(x) = sin(x)/x. | |
template<class T> | |
T | step (T x) |
Return the value of the step function: 0 if x<0 and 1 otherwise. | |
template<class T, class T2> | |
T | round (T x, T2 s=1) |
Round the number with a precision defined by s. |
double airy | ( | double | x | ) | [inline] |
Return the value of the Airy function:
double bessel | ( | double | x, | |
int | n | |||
) | [inline] |
Return the value of the cylindrical Bessel function
double beta | ( | double | a, | |
double | b | |||
) | [inline] |
Return the value of the Beta function of a and b.
T conv | ( | string | s | ) | [inline] |
Convert a int to a string into any type T. Use conv<T>(str)
double erf | ( | double | x | ) | [inline] |
Return the value of the error function:
* string fileNumber | ( | int | number, | |
int | ndigits = 0 | |||
) | [inline] |
Create a string from an integer.
number | : number to be converted | |
ndigits | : number of digits; complete at the beginning with "0"s. |
* string formatNumber | ( | T | number, | |
const char * | format | |||
) | [inline] |
Format a number.
number | : number to be converted | |
format | : string containing the c-style printf format. |
double gamma | ( | double | x | ) | [inline] |
Return the value of the gamma function:
T getField | ( | string | str, | |
int | field | |||
) | [inline] |
Extract a given field in a string. Default separator is a space. Later versions will improve this.