Logo ROOT   6.10/09
Reference Guide
Classes | Namespaces | Functions
TMath.h File Reference
#include "Rtypes.h"
#include "TMathBase.h"
#include "TError.h"
#include <algorithm>
#include <limits>
#include <cmath>
#include <float.h>
Include dependency graph for TMath.h:

Classes

struct  CompareAsc< T >
 
struct  CompareDesc< T >
 
struct  TMath::Limits< T >
 

Namespaces

 TMath
 

Functions

Double_t TMath::ACos (Double_t)
 
double acos (double)
 
Double_t TMath::ACosH (Double_t)
 
Bool_t TMath::AreEqualAbs (Double_t af, Double_t bf, Double_t epsilon)
 
Bool_t TMath::AreEqualRel (Double_t af, Double_t bf, Double_t relPrec)
 
Double_t TMath::ASin (Double_t)
 
double asin (double)
 
Double_t TMath::ASinH (Double_t)
 
Double_t TMath::ATan (Double_t)
 
double atan (double)
 
Double_t TMath::ATan2 (Double_t, Double_t)
 
double atan2 (double, double)
 
Double_t TMath::ATanH (Double_t)
 
Double_t TMath::BesselI (Int_t n, Double_t x)
 Compute the Integer Order Modified Bessel function I_n(x) for n=0,1,2,... More...
 
Double_t TMath::BesselI0 (Double_t x)
 Compute the modified Bessel function I_0(x) for any real x. More...
 
Double_t TMath::BesselI1 (Double_t x)
 Compute the modified Bessel function I_1(x) for any real x. More...
 
Double_t TMath::BesselJ0 (Double_t x)
 Returns the Bessel function J0(x) for any real x. More...
 
Double_t TMath::BesselJ1 (Double_t x)
 Returns the Bessel function J1(x) for any real x. More...
 
Double_t TMath::BesselK (Int_t n, Double_t x)
 Compute the Integer Order Modified Bessel function K_n(x) for n=0,1,2,... More...
 
Double_t TMath::BesselK0 (Double_t x)
 Compute the modified Bessel function K_0(x) for positive real x. More...
 
Double_t TMath::BesselK1 (Double_t x)
 Compute the modified Bessel function K_1(x) for positive real x. More...
 
Double_t TMath::BesselY0 (Double_t x)
 Returns the Bessel function Y0(x) for positive x. More...
 
Double_t TMath::BesselY1 (Double_t x)
 Returns the Bessel function Y1(x) for positive x. More...
 
Double_t TMath::Beta (Double_t p, Double_t q)
 Calculates Beta-function Gamma(p)*Gamma(q)/Gamma(p+q). More...
 
Double_t TMath::BetaCf (Double_t x, Double_t a, Double_t b)
 Continued fraction evaluation by modified Lentz's method used in calculation of incomplete Beta function. More...
 
Double_t TMath::BetaDist (Double_t x, Double_t p, Double_t q)
 Computes the probability density function of the Beta distribution (the distribution function is computed in BetaDistI). More...
 
Double_t TMath::BetaDistI (Double_t x, Double_t p, Double_t q)
 Computes the distribution function of the Beta distribution. More...
 
Double_t TMath::BetaIncomplete (Double_t x, Double_t a, Double_t b)
 Calculates the incomplete Beta-function. More...
 
template<typename T >
Long64_t TMath::BinarySearch (Long64_t n, const T *array, T value)
 
template<typename T >
Long64_t TMath::BinarySearch (Long64_t n, const T **array, T value)
 
template<typename Iterator , typename Element >
Iterator TMath::BinarySearch (Iterator first, Iterator last, Element value)
 
Double_t TMath::Binomial (Int_t n, Int_t k)
 Calculate the binomial coefficient n over k. More...
 
Double_t TMath::BinomialI (Double_t p, Int_t n, Int_t k)
 Suppose an event occurs with probability p per trial Then the probability P of its occurring k or more times in n trials is termed a cumulative binomial probability the formula is P = sum_from_j=k_to_n(TMath::Binomial(n, j)* *TMath::Power(p, j)*TMathPower(1-p, n-j) For n larger than 12 BetaIncomplete is a much better way to evaluate the sum than would be the straightforward sum calculation for n smaller than 12 either method is acceptable ("Numerical Recipes") –implementation by Anna Kreshuk. More...
 
Double_t TMath::BreitWigner (Double_t x, Double_t mean=0, Double_t gamma=1)
 Calculate a Breit Wigner function with mean and gamma. More...
 
void TMath::BubbleHigh (Int_t Narr, Double_t *arr1, Int_t *arr2)
 Bubble sort variant to obtain the order of an array's elements into an index in order to do more useful things than the standard built in functions. More...
 
void TMath::BubbleLow (Int_t Narr, Double_t *arr1, Int_t *arr2)
 Opposite ordering of the array arr2[] to that of BubbleHigh. More...
 
constexpr Double_t TMath::C ()
 
Double_t TMath::CauchyDist (Double_t x, Double_t t=0, Double_t s=1)
 Computes the density of Cauchy distribution at point x by default, standard Cauchy distribution is used (t=0, s=1) t is the location parameter s is the scale parameter The Cauchy distribution, also called Lorentzian distribution, is a continuous distribution describing resonance behavior The mean and standard deviation of the Cauchy distribution are undefined. More...
 
constexpr Double_t TMath::Ccgs ()
 
Double_t TMath::Ceil (Double_t x)
 
double ceil (double)
 
Int_t TMath::CeilNint (Double_t x)
 
Double_t TMath::ChisquareQuantile (Double_t p, Double_t ndf)
 Evaluate the quantiles of the chi-squared probability distribution function. More...
 
Double_t TMath::Cos (Double_t)
 
double cos (double)
 
Double_t TMath::CosH (Double_t)
 
double cosh (double)
 
template<typename T >
T * TMath::Cross (const T v1[3], const T v2[3], T out[3])
 
constexpr Double_t TMath::CUncertainty ()
 
constexpr Double_t TMath::DegToRad ()
 
Double_t TMath::DiLog (Double_t x)
 The DiLogarithm function Code translated by R.Brun from CERNLIB DILOG function C332. More...
 
constexpr Double_t TMath::E ()
 
Double_t TMath::Erf (Double_t x)
 Computation of the error function erf(x). More...
 
Double_t TMath::Erfc (Double_t x)
 Compute the complementary error function erfc(x). More...
 
Double_t TMath::ErfcInverse (Double_t x)
 
Double_t TMath::ErfInverse (Double_t x)
 returns the inverse error function x must be <-1<x<1 More...
 
constexpr Double_t TMath::EulerGamma ()
 
Double_t TMath::Exp (Double_t x)
 
double exp (double)
 
Double_t TMath::Factorial (Int_t i)
 Compute factorial(n). More...
 
Double_t TMath::FDist (Double_t F, Double_t N, Double_t M)
 Computes the density function of F-distribution (probability function, integral of density, is computed in FDistI). More...
 
Double_t TMath::FDistI (Double_t F, Double_t N, Double_t M)
 Calculates the cumulative distribution function of F-distribution, this function occurs in the statistical test of whether two observed samples have the same variance. More...
 
Int_t TMath::Finite (Double_t x)
 
Int_t TMath::Finite (Float_t x)
 
int finite (double)
 
Double_t TMath::Floor (Double_t x)
 
double floor (double)
 
Int_t TMath::FloorNint (Double_t x)
 
Double_t TMath::Freq (Double_t x)
 Computation of the normal frequency function freq(x). More...
 
constexpr Double_t TMath::G ()
 
Double_t TMath::Gamma (Double_t z)
 Computation of gamma(z) for all z. More...
 
Double_t TMath::Gamma (Double_t a, Double_t x)
 Computation of the normalized lower incomplete gamma function P(a,x) as defined in the Handbook of Mathematical Functions by Abramowitz and Stegun, formula 6.5.1 on page 260 . More...
 
Double_t TMath::GammaDist (Double_t x, Double_t gamma, Double_t mu=0, Double_t beta=1)
 Computes the density function of Gamma distribution at point x. More...
 
Double_t TMath::Gaus (Double_t x, Double_t mean=0, Double_t sigma=1, Bool_t norm=kFALSE)
 Calculate a gaussian function with mean and sigma. More...
 
constexpr Double_t TMath::Gcgs ()
 
template<typename T >
Double_t TMath::GeomMean (Long64_t n, const T *a)
 
template<typename Iterator >
Double_t TMath::GeomMean (Iterator first, Iterator last)
 
constexpr Double_t TMath::GhbarC ()
 
constexpr Double_t TMath::GhbarCUncertainty ()
 
constexpr Double_t TMath::Gn ()
 
constexpr Double_t TMath::GnUncertainty ()
 
constexpr Double_t TMath::GUncertainty ()
 
constexpr Double_t TMath::H ()
 
ULong_t TMath::Hash (const void *txt, Int_t ntxt)
 Calculates hash index from any char string. More...
 
ULong_t TMath::Hash (const char *str)
 Return a case-sensitive hash value (endian independent). More...
 
constexpr Double_t TMath::Hbar ()
 
constexpr Double_t TMath::Hbarcgs ()
 
constexpr Double_t TMath::HbarUncertainty ()
 
constexpr Double_t TMath::HC ()
 
constexpr Double_t TMath::HCcgs ()
 
constexpr Double_t TMath::Hcgs ()
 
constexpr Double_t TMath::HUncertainty ()
 
Double_t TMath::Hypot (Double_t x, Double_t y)
 
Long_t TMath::Hypot (Long_t x, Long_t y)
 
Double_t TMath::Infinity ()
 
constexpr Double_t TMath::InvPi ()
 
template<typename T >
Bool_t TMath::IsInside (T xp, T yp, Int_t np, T *x, T *y)
 
Int_t TMath::IsNaN (Double_t x)
 
Int_t TMath::IsNaN (Float_t x)
 
int isnan (double)
 
constexpr Double_t TMath::K ()
 
constexpr Double_t TMath::Kcgs ()
 
Double_t TMath::KolmogorovProb (Double_t z)
 Calculates the Kolmogorov distribution function,. More...
 
Double_t TMath::KolmogorovTest (Int_t na, const Double_t *a, Int_t nb, const Double_t *b, Option_t *option)
 Statistical test whether two one-dimensional sets of points are compatible with coming from the same parent distribution, using the Kolmogorov test. More...
 
template<class Element , typename Size >
Element TMath::KOrdStat (Size n, const Element *a, Size k, Size *work=0)
 
constexpr Double_t TMath::KUncertainty ()
 
Double_t TMath::Landau (Double_t x, Double_t mpv=0, Double_t sigma=1, Bool_t norm=kFALSE)
 The LANDAU function. More...
 
Double_t TMath::LandauI (Double_t x)
 Returns the value of the Landau distribution function at point x. More...
 
Double_t TMath::LaplaceDist (Double_t x, Double_t alpha=0, Double_t beta=1)
 Computes the probability density function of Laplace distribution at point x, with location parameter alpha and shape parameter beta. More...
 
Double_t TMath::LaplaceDistI (Double_t x, Double_t alpha=0, Double_t beta=1)
 Computes the distribution function of Laplace distribution at point x, with location parameter alpha and shape parameter beta. More...
 
Double_t TMath::Ldexp (Double_t x, Int_t exp)
 
double ldexp (double, int)
 
constexpr Double_t TMath::Ln10 ()
 
Double_t TMath::LnGamma (Double_t z)
 Computation of ln[gamma(z)] for all z. More...
 
template<typename T >
Long64_t TMath::LocMax (Long64_t n, const T *a)
 
template<typename Iterator >
Iterator TMath::LocMax (Iterator first, Iterator last)
 
template<typename T >
Long64_t TMath::LocMin (Long64_t n, const T *a)
 
template<typename Iterator >
Iterator TMath::LocMin (Iterator first, Iterator last)
 
Double_t TMath::Log (Double_t x)
 
double log (double)
 
Double_t TMath::Log10 (Double_t x)
 
double log10 (double)
 
Double_t TMath::Log2 (Double_t x)
 
constexpr Double_t TMath::LogE ()
 
Double_t TMath::LogNormal (Double_t x, Double_t sigma, Double_t theta=0, Double_t m=1)
 Computes the density of LogNormal distribution at point x. More...
 
template<typename T >
TMath::MaxElement (Long64_t n, const T *a)
 
template<typename T >
Double_t TMath::Mean (Long64_t n, const T *a, const Double_t *w=0)
 
template<typename Iterator >
Double_t TMath::Mean (Iterator first, Iterator last)
 
template<typename Iterator , typename WeightIterator >
Double_t TMath::Mean (Iterator first, Iterator last, WeightIterator wfirst)
 
template<typename T >
Double_t TMath::Median (Long64_t n, const T *a, const Double_t *w=0, Long64_t *work=0)
 
template<typename T >
TMath::MinElement (Long64_t n, const T *a)
 
constexpr Double_t TMath::MWair ()
 
constexpr Double_t TMath::Na ()
 
constexpr Double_t TMath::NaUncertainty ()
 
template<typename T >
Int_t TMath::Nint (T x)
 
template<typename T >
T * TMath::Normal2Plane (const T v1[3], const T v2[3], const T v3[3], T normal[3])
 
Float_t TMath::Normalize (Float_t v[3])
 Normalize a vector v in place. More...
 
Double_t TMath::Normalize (Double_t v[3])
 Normalize a vector v in place. More...
 
template<typename T >
TMath::NormCross (const T v1[3], const T v2[3], T out[3])
 
Double_t TMath::NormQuantile (Double_t p)
 Computes quantiles for standard normal distribution N(0, 1) at probability p ALGORITHM AS241 APPL. More...
 
Bool_t TMath::Permute (Int_t n, Int_t *a)
 Simple recursive algorithm to find the permutations of n natural numbers, not necessarily all distinct adapted from CERNLIB routine PERMU. More...
 
constexpr Double_t TMath::Pi ()
 
constexpr Double_t TMath::PiOver2 ()
 
constexpr Double_t TMath::PiOver4 ()
 
Double_t TMath::Poisson (Double_t x, Double_t par)
 Compute the Poisson distribution function for (x,par) The Poisson PDF is implemented by means of Euler's Gamma-function (for the factorial), so for any x integer argument it is correct. More...
 
Double_t TMath::PoissonI (Double_t x, Double_t par)
 compute the Poisson distribution function for (x,par) This is a non-smooth function. More...
 
double pow (double, double)
 
LongDouble_t TMath::Power (LongDouble_t x, LongDouble_t y)
 
LongDouble_t TMath::Power (LongDouble_t x, Long64_t y)
 
LongDouble_t TMath::Power (Long64_t x, Long64_t y)
 
Double_t TMath::Power (Double_t x, Double_t y)
 
Double_t TMath::Power (Double_t x, Int_t y)
 
Double_t TMath::Prob (Double_t chi2, Int_t ndf)
 Computation of the probability for a certain Chi-squared (chi2) and number of degrees of freedom (ndf). More...
 
constexpr Double_t TMath::Qe ()
 
constexpr Double_t TMath::QeUncertainty ()
 
void TMath::Quantiles (Int_t n, Int_t nprob, Double_t *x, Double_t *quantiles, Double_t *prob, Bool_t isSorted=kTRUE, Int_t *index=0, Int_t type=7)
 Computes sample quantiles, corresponding to the given probabilities Parameters: x -the data sample n - its size quantiles - computed quantiles are returned in there prob - probabilities where to compute quantiles nprob - size of prob array isSorted - is the input array x sorted? NOTE, that when the input is not sorted, an array of integers of size n needs to be allocated. More...
 
Double_t TMath::QuietNaN ()
 
constexpr Double_t TMath::R ()
 
constexpr Double_t TMath::RadToDeg ()
 
constexpr Double_t TMath::Rgair ()
 
template<typename T >
Double_t TMath::RMS (Long64_t n, const T *a, const Double_t *w=0)
 
template<typename Iterator >
Double_t TMath::RMS (Iterator first, Iterator last)
 
template<typename Iterator , typename WeightIterator >
Double_t TMath::RMS (Iterator first, Iterator last, WeightIterator wfirst)
 
Bool_t TMath::RootsCubic (const Double_t coef[4], Double_t &a, Double_t &b, Double_t &c)
 Calculates roots of polynomial of 3rd order a*x^3 + b*x^2 + c*x + d, where a == coef[3], b == coef[2], c == coef[1], d == coef[0] coef[3] must be different from 0 If the boolean returned by the method is false: ==> there are 3 real roots a,b,c If the boolean returned by the method is true: ==> there is one real root a and 2 complex conjugates roots (b+i*c,b-i*c) Author: Francois-Xavier Gentit. More...
 
constexpr Double_t TMath::RUncertainty ()
 
constexpr Double_t TMath::Sigma ()
 
constexpr Double_t TMath::SigmaUncertainty ()
 
Double_t TMath::SignalingNaN ()
 
Double_t TMath::Sin (Double_t)
 
double sin (double)
 
Double_t TMath::SinH (Double_t)
 
double sinh (double)
 
template<typename Element , typename Index >
void TMath::Sort (Index n, const Element *a, Index *index, Bool_t down=kTRUE)
 
template<typename Iterator , typename IndexIterator >
void TMath::SortItr (Iterator first, Iterator last, IndexIterator index, Bool_t down=kTRUE)
 
Double_t TMath::Sq (Double_t x)
 
Double_t TMath::Sqrt (Double_t x)
 
double sqrt (double)
 
constexpr Double_t TMath::Sqrt2 ()
 
template<typename T >
Double_t TMath::StdDev (Long64_t n, const T *a, const Double_t *w=0)
 
template<typename Iterator >
Double_t TMath::StdDev (Iterator first, Iterator last)
 
template<typename Iterator , typename WeightIterator >
Double_t TMath::StdDev (Iterator first, Iterator last, WeightIterator wfirst)
 
Double_t TMath::StruveH0 (Double_t x)
 Struve Functions of Order 0. More...
 
Double_t TMath::StruveH1 (Double_t x)
 Struve Functions of Order 1. More...
 
Double_t TMath::StruveL0 (Double_t x)
 Modified Struve Function of Order 0. More...
 
Double_t TMath::StruveL1 (Double_t x)
 Modified Struve Function of Order 1. More...
 
Double_t TMath::Student (Double_t T, Double_t ndf)
 Computes density function for Student's t- distribution (the probability function (integral of density) is computed in StudentI). More...
 
Double_t TMath::StudentI (Double_t T, Double_t ndf)
 Calculates the cumulative distribution function of Student's t-distribution second parameter stands for number of degrees of freedom, not for the number of samples if x has Student's t-distribution, the function returns the probability of x being less than T. More...
 
Double_t TMath::StudentQuantile (Double_t p, Double_t ndf, Bool_t lower_tail=kTRUE)
 Computes quantiles of the Student's t-distribution 1st argument is the probability, at which the quantile is computed 2nd argument - the number of degrees of freedom of the Student distribution When the 3rd argument lower_tail is kTRUE (default)- the algorithm returns such x0, that P(x < x0)=p upper tail (lower_tail is kFALSE)- the algorithm returns such x0, that P(x > x0)=p the algorithm was taken from G.W.Hill, "Algorithm 396, Student's t-quantiles" "Communications of the ACM", 13(10), October 1970. More...
 
Double_t TMath::Tan (Double_t)
 
double tan (double)
 
Double_t TMath::TanH (Double_t)
 
double tanh (double)
 
constexpr Double_t TMath::TwoPi ()
 
Double_t TMath::Vavilov (Double_t x, Double_t kappa, Double_t beta2)
 Returns the value of the Vavilov density function Parameters: 1st - the point were the density function is evaluated 2nd - value of kappa (distribution parameter) 3rd - value of beta2 (distribution parameter) The algorithm was taken from the CernLib function vavden(G115) Reference: A.Rotondi and P.Montagna, Fast Calculation of Vavilov distribution Nucl.Instr. More...
 
Double_t TMath::VavilovI (Double_t x, Double_t kappa, Double_t beta2)
 Returns the value of the Vavilov distribution function Parameters: 1st - the point were the density function is evaluated 2nd - value of kappa (distribution parameter) 3rd - value of beta2 (distribution parameter) The algorithm was taken from the CernLib function vavden(G115) Reference: A.Rotondi and P.Montagna, Fast Calculation of Vavilov distribution Nucl.Instr. More...
 
Double_t TMath::Voigt (Double_t x, Double_t sigma, Double_t lg, Int_t r=4)
 Computation of Voigt function (normalised). More...
 

Function Documentation

◆ acos()

double acos ( double  )

◆ asin()

double asin ( double  )

◆ atan()

double atan ( double  )

◆ atan2()

double atan2 ( double  ,
double   
)

◆ ceil()

double ceil ( double  )

◆ cos()

double cos ( double  )

◆ cosh()

double cosh ( double  )

◆ exp()

double exp ( double  )

◆ finite()

int finite ( double  )

◆ floor()

double floor ( double  )

◆ isnan()

int isnan ( double  )

◆ ldexp()

double ldexp ( double  ,
int   
)

◆ log()

double log ( double  )

◆ log10()

double log10 ( double  )

◆ pow()

double pow ( double  ,
double   
)

◆ sin()

double sin ( double  )

◆ sinh()

double sinh ( double  )

◆ sqrt()

double sqrt ( double  )

◆ tan()

double tan ( double  )

◆ tanh()

double tanh ( double  )