ThePEG::Math Namespace Reference

The Math namespace includes the declaration of some useful mathematical functions. More...


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  ThePEG::Math::Power< N, false >
 Struct for powers. More...
struct  ThePEG::Math::Power< N, true >
 Struct for powers. More...
struct  ThePEG::Math::Power< 0, true >
 Struct for powers. More...
struct  ThePEG::Math::Power< 0, false >
 Struct for powers. More...

Namespaces

namespace  Functions
 This namespace introduces some useful function classes with known primitive and inverse primitive functions.

Functions

double gamma (double)
 The gamma function.
double lngamma (double)
 The log of the gamma function.
double atanh (double)
 Return ${\rm atanh}(x)$.
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>
absmin (const T &x, const T &y)
 Return x if |x|<|y|, else return y.
template<typename T>
absmax (const T &x, const T &y)
 Return x if |x|>|y|, else return y.
template<typename T, typename U>
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.


Detailed Description

The Math namespace includes the declaration of some useful mathematical functions.


Function Documentation

template<typename T>
T ThePEG::Math::absmax ( const T &  x,
const T &  y 
) [inline]

Return x if |x|>|y|, else return y.

Definition at line 101 of file Maths.h.

template<typename T>
T ThePEG::Math::absmin ( const T &  x,
const T &  y 
) [inline]

Return x if |x|<|y|, else return y.

Definition at line 95 of file Maths.h.

double ThePEG::Math::exp1m ( double  x  ) 

Return $1-e^x$, with highest possible precision for $x\rightarrow 0$.

Referenced by ThePEG::PartonBinInstance::eps(), pXGenerate(), and pXIntegrate().

double ThePEG::Math::log1m ( double   ) 

Return $1\log(1-x)$, with highest possible precision for $x\rightarrow 0$.

Referenced by pXGenerate(), and pXIntegrate().

double ThePEG::Math::pGenerate ( int  p,
double  xl,
double  xu,
double  rnd 
) [inline]

Generate an x between xl and xu distributed as $x^p$.

Definition at line 70 of file Maths.h.

References powi().

double ThePEG::Math::pGenerate ( double  p,
double  xl,
double  xu,
double  rnd 
) [inline]

Generate an x between xl and xu distributed as $x^p$.

Definition at line 64 of file Maths.h.

double ThePEG::Math::pIntegrate ( int  p,
double  xl,
double  xu 
) [inline]

Return the integral of $x^p dx$ between xl and xu.

Definition at line 52 of file Maths.h.

References powi().

double ThePEG::Math::pIntegrate ( double  p,
double  xl,
double  xu 
) [inline]

Return the integral of $x^p dx$ between xl and xu.

Definition at line 47 of file Maths.h.

template<int N>
double ThePEG::Math::Pow ( double  x  )  [inline]

Templated function to calculate integer powers known at compile-time.

Definition at line 161 of file Maths.h.

double ThePEG::Math::powi ( double  x,
int  p 
)

Return x rased to the integer power p, using recursion.

Referenced by pGenerate(), and pIntegrate().

double ThePEG::Math::pXGenerate ( double  e,
double  xl,
double  dx,
double  rnd 
) [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$.

Parameters:
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[.

Definition at line 82 of file Maths.h.

References exp1m(), and log1m().

double ThePEG::Math::pXIntegrate ( double  e,
double  xl,
double  dx 
) [inline]

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$.

Definition at line 59 of file Maths.h.

References exp1m(), and log1m().

template<typename FloatType>
double ThePEG::Math::relativeError ( FloatType  x,
FloatType  y 
) [inline]

template<typename T, typename U>
T ThePEG::Math::sign ( x,
y 
) [inline]

Transfer the sign of the second argument to the first.

Returns:
$|x|$ if $y>0$ otherwise return $-|x|$.

Definition at line 109 of file Maths.h.


Generated on Thu Apr 29 12:43:32 2010 for ThePEG by  doxygen 1.5.5