The Math namespace includes the declaration of some useful mathematical functions. More...
Namespaces | |
namespace | Functions |
This namespace introduces some useful function classes with known primitive and inverse primitive functions. | |
Classes | |
struct | MathType |
MathType is an empty non-polymorphic base class for all mathematical function types. More... | |
struct | Power |
Templated class for calculating integer powers. More... | |
struct | Power< 0, false > |
Struct for powers. More... | |
struct | Power< 0, true > |
Struct for powers. More... | |
struct | Power< N, false > |
Struct for powers. More... | |
struct | Power< N, true > |
Struct for powers. More... | |
Functions | |
double | exp1m (double x) |
Return \(1-e^x\), with highest possible precision for \(x\rightarrow 0\). | |
double | log1m (double) |
Return \(1\log(1-x)\), with highest possible precision for \(x\rightarrow 0\). | |
double | powi (double x, int p) |
Return x rased to the integer power p, using recursion. | |
double | pIntegrate (double p, double xl, double xu) |
Return the integral of \(x^p dx\) between xl and xu. | |
double | pIntegrate (int p, double xl, double xu) |
Return the integral of \(x^p dx\) between xl and xu. | |
double | pXIntegrate (double e, double xl, double dx) |
Return the integral of \(x^{e-1} dx\) between xl and xl+dx with highest possible precision for \(dx\rightarrow 0\) and/or \(e\rightarrow 0\). | |
double | pGenerate (double p, double xl, double xu, double rnd) |
Generate an x between xl and xu distributed as \(x^p\). | |
double | pGenerate (int p, double xl, double xu, double rnd) |
Generate an x between xl and xu distributed as \(x^p\). | |
double | pXGenerate (double e, double xl, double dx, double rnd) |
Generate an x between xl and xl + dx distributed as \(x^{e-1}\) with highest possible precision for \(dx\rightarrow 0\) and/or * \(e\rightarrow 0\). | |
template<typename FloatType > | |
double | relativeError (FloatType x, FloatType y) |
Returns (x - y)/(|x| + |y|). | |
template<typename T > | |
T | absmin (const T &x, const T &y) |
Return x if |x|<|y|, else return y. | |
template<typename T > | |
T | absmax (const T &x, const T &y) |
Return x if |x|>|y|, else return y. | |
template<typename T , typename U > | |
T | sign (T x, U y) |
Transfer the sign of the second argument to the first. | |
template<int N> | |
double | Pow (double x) |
Templated function to calculate integer powers known at compile-time. | |
The Math namespace includes the declaration of some useful mathematical functions.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Generate an x between xl and xl + dx distributed as \(x^{e-1}\) with highest possible precision for \(dx\rightarrow 0\) and/or * \(e\rightarrow 0\).
e | the parameter defining the power in \(x^{e-1}\). |
xl | the lower bound of the generation interval. |
dx | the interval. |
rnd | a flat random number in the interval ]0,1[. |
|
inline |
|
inline |
Returns (x - y)/(|x| + |y|).
Definition at line 80 of file Maths.h.
Referenced by ThePEG::Lorentz5Vector< Value >::energyError(), ThePEG::Lorentz5Vector< Value >::massError(), and ThePEG::Lorentz5Vector< Value >::rhoError().