MercuryDPM
0.10
|
Namespace for some extra maths function that are often needed. More...
Functions | |
Mdouble | gamma (Mdouble gamma_in) |
This is the gamma function returns the true value for the half integer value. More... | |
Mdouble | chi_squared (Mdouble x, int k) |
This is a chi_squared function return the value x and degrees of freedom k. More... | |
Mdouble | chi_squared_prob (Mdouble x, int k) |
This is the function which actually gives the probability back using a chi squared test. More... | |
template<typename T > | |
int | sign (T val) |
This is a sign function, it returns -1 for negative numbers, 1 for positive numbers and 0 for 0. More... | |
Namespace for some extra maths function that are often needed.
This is a chi_squared function return the value x and degrees of freedom k.
Definition at line 60 of file ExtendedMath.cc.
References gamma().
Referenced by chi_squared_prob().
This is the function which actually gives the probability back using a chi squared test.
This calulates the probabity based on a chi squared test First we calculated the cummelative chi_squared function.
This is the function which actually gives the probability back It is calculated by calling the normal chi_squated function and using the trapezoidal rule. The final results is 1-the cummulative chi_squared function
Definition at line 78 of file ExtendedMath.cc.
References chi_squared().
Referenced by RNG::test().
This is the gamma function returns the true value for the half integer value.
This is the gamma function, gives 'exact' answers for the half integer values This is done using the recussion relation and the known values for 1 and 0.5 Note, return NaN for non-half integer values.
Definition at line 37 of file ExtendedMath.cc.
References constants::sqrt_pi.
Referenced by chi_squared(), ChuteWithHopper::create_inflow_particle(), and ChuteWithHopperAndInset::create_inflow_particle().
int mathsFunc::sign | ( | T | val | ) |
This is a sign function, it returns -1 for negative numbers, 1 for positive numbers and 0 for 0.
Definition at line 75 of file ExtendedMath.h.
Referenced by Screw::get_distance_and_normal().