|
int | binomial (int n, int k) |
| Returns \(n \choose k\).
|
|
double | binomial_d (int n, int k) |
| Returns \(n \choose k\).
|
|
double | degreesToRadians (const double &angleInDegrees) |
| Converts an angle from degrees to radians.
|
|
int | factorial (int n) |
| Returns n! .
|
|
double | factorial_d (int n) |
| Returns n! .
|
|
int | floorLog2 (int v) |
| A method to obtain the rounded down binary logarithm of v .
|
|
template<class T , class INDEX = int> |
T | gcd (const Array< T, INDEX > &numbers) |
| Returns the greatest common divisor of a list of numbers.
|
|
template<typename T > |
T | gcd (T a, T b) |
| Returns the greatest common divisor of two numbers.
|
|
void | getFraction (double d, int &num, int &denom, const double epsilon=5e-10, const int count=10) |
| Converts a double to a fraction.
|
|
double | harmonic (unsigned n) |
| Returns the n-th harmonic number or 1.0 if n < 1.
|
|
template<typename T > |
T | lcm (T a, T b) |
| Returns the least common multipler of two numbers.
|
|
template<typename T > |
T | log2 (T x) |
| Returns the logarithm of x to the base 2.
|
|
double | log4 (double x) |
| Returns the logarithm of x to the base 4.
|
|
template<class Container > |
Container::value_type | maxValue (const Container &values) |
| Returns the maximum of an iterable container of given values .
|
|
template<class Container > |
double | mean (const Container &values) |
| Returns the mean of an iterable container of given values .
|
|
template<class Container > |
Container::value_type | minValue (const Container &values) |
| Returns the minimum of an iterable container of given values .
|
|
template<typename T , typename... Args> |
static T | nextPower2 (T arg1, T arg2, Args... args) |
| Returns the smallest power of 2 that is no less than the given (integral) arguments.
|
|
template<typename T > |
T | nextPower2 (T x) |
| Returns the smallest power of 2 that is no less than the given (integral) argument.
|
|
double | radiansToDegrees (const double &angleInRadians) |
| Converts an angle from radians to degrees.
|
|
template<typename T > |
int | sgn (T val) |
| Returns +1 for val > 0, 0 for val = 0, and -1 for val < 0.
|
|
template<class Container > |
double | standardDeviation (const Container &values) |
| Returns the standard deviation of an iterable container of given values .
|
|
template<class Container > |
double | standardDeviation (const Container &values, double mean) |
| Returns the standard deviation of an iterable container of given values .
|
|
template<class Container > |
Container::value_type | sum (const Container &values) |
| Returns the sum of an iterable container of given values .
|
|
template<typename T > |
void | updateMax (T &max, const T &newValue) |
| Stores the maximum of max and newValue in max .
|
|
template<typename T > |
void | updateMin (T &min, const T &newValue) |
| Stores the minimum of min and newValue in min .
|
|