Log of /trunk/math/mathcore/inc/TMath.h
Parent Directory
Revision
41837 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Wed Nov 9 16:04:19 2011 UTC (3 years, 2 months ago) by
rdm
File length: 35862 byte(s)
Diff to
previous 41690
From Filimon Roukoutakis and me:
Full port to AIX 7.1 and xlC Version: 09.00.0000.0017.
This port is complete (./configure --all; make) works (minus some minor
plugins that were not installed). The tutorials/benchmarks.C and test/* works.
For the list of linux-tool packages that need to be installed see:
http://root.cern.ch/drupal/content/build-prerequisites.
Port made on hardware kindly donated by IBM.
Revision
41687 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue Nov 1 16:41:15 2011 UTC (3 years, 2 months ago) by
moneta
File length: 35937 byte(s)
Diff to
previous 41660
fix TMath::IsNaN and TMath::Finite for intel compiler
with icc version 11 when used in combination with gcc > 4.3 one cannot use std::isnan but just ::isnan from math.h
Revision
41453 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue Oct 18 12:26:09 2011 UTC (3 years, 3 months ago) by
moneta
File length: 35804 byte(s)
Diff to
previous 41172
- add a new function TMath::Power(double, int) impelmented using std::pow(double,int) since it is 100% faster
- fix for new Power function some code in TMVA
- Fix in TMath implementation of IsNaN for the latest C++ compiler when used together with cmath
see https://savannah.cern.ch/bugs/?87534
Revision
38576 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Wed Mar 23 13:36:58 2011 UTC (3 years, 10 months ago) by
moneta
File length: 35056 byte(s)
Diff to
previous 36792
add new functions in TMath based on std::numeric_limits:
double TMath::QuietNaN() returning a quite NaN
(as requested in https://savannah.cern.ch/bugs/?77827 )
double TMath::SignalingNaN() returning a signaling NaN
double TMath::Infinity() returning an infinity double value
Added also (based on numeric_limits) templated functions on T (where T can be double, float or int) for computing the limits for a given type:
- T TMath::Limits< T >::Max() returning the maximum number which can be represented for the type T
- T TMath::Limits< T >::Min() returning the minimum number which can be represented for the type T
- T TMath::Limits< T >::Epsilon() returning the epsilon for the type T
Revision
36792 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Nov 19 16:53:42 2010 UTC (4 years, 2 months ago) by
rdm
File length: 33578 byte(s)
Diff to
previous 36490
Support for two new platforms ios and iossim. The first one compiles for
iOS running natively on ARM (iPhone/iPad) and the second one is
for the iPhone/iPad simulator running as i386 code on a Mac.
As both platforms don't in principle allow shared libraries, building for
these platforms creates by default the lib/libRoot.a object. These builds
provide most of ROOT classes except low level graphics. To build iOS
applications just drag the libRoot.a and include directory in an Xcode
project to build an app using the ROOT infrastructure. Some demos will
come soon.
Revision
29935 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Thu Aug 27 13:56:23 2009 UTC (5 years, 4 months ago) by
brun
File length: 32971 byte(s)
Diff to
previous 28382
Add 2 new functions to compare floating points:
Bool_t AreEqualAbs(Double_t af, Double_t bf, Double_t epsilon) {
//return kTRUE if absolute difference between af and bf is less than epsilon
Bool_t AreEqualRel(Double_t af, Double_t bf, Double_t relPrec) {
//return kTRUE if relative difference between af and bf is less than relPrec
Revision
26030 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Oct 31 10:57:57 2008 UTC (6 years, 2 months ago) by
moneta
File length: 32478 byte(s)
Diff to
previous 23858
- change template TMath::Sort to force to have the same type for the index array and the size value n.
Tmath::Sort<Element,Index> (Long64 n, Element x, Index w)
to
Tmath::Sort<Element,Index> (Index n, Element x, Index w)
Add in the dictionary the instantiations for both cases Index=Long64_t and Index=Int_t
Revision
23655 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue May 6 07:58:46 2008 UTC (6 years, 8 months ago) by
moneta
File length: 31943 byte(s)
Diff to
previous 22885
- merge changes with development branch (up to rev 23650).
Main changes are:
TMath:
from David: The following methods now have additional interface working with Iterators as well:
MinElement
MaxElement
LocMin
LocMax
Mean
GeomMean
RMS
BinarySearch
Sort -> (changed to SortItr)
- use now std in binary search algorithm. Old algorithm failed some tests and it is found to be a
little bit slower
- do not use std instead in LocMin and LocMax since generic std algorithm is slower on 64 bit arch.
- TMath::PoissonI
fix a problem for large values, by using directly the TMath::Poisson implementation
- TMath::Landau and TMath::Landau
remove duplications by using directly ROOT::Math::landau_pdf and ROOT::Math::landau_cdf
- TMath::Prob
use ROOT::Math::chisquared_cdf_c (gives also less rounding errors for small values)
- TMath::GammaDist
use ROOT::Math::gamma_pdf , implementation now returns correct value, 0, for large values of
shape parameter instead of nan
- TMath::LogNormal:
use ROOT::Math::lognormal_pdf
- compile TMath dictionary with -O2
- fix a warning in -Wshadow
- TMath.h is now reordered by functionality and alphabetical order
test:
various improvement from David, see http://root.cern.ch/viewcvs?rev=22880&root=root&view=rev
- add dictionary for the enumeration used in the Integration class
- from David: some clean up of Minimizer class (remove typedef definitions)
Revision
22518 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Mar 7 15:40:22 2008 UTC (6 years, 10 months ago) by
moneta
Original Path:
trunk/math/inc/TMath.h
File length: 17655 byte(s)
Diff to
previous 20882
Syncronize with the Math develoment branch:
- merge classes from math (TMath, TComplex and TRandom) in libMathCore
- change various functions of TMath (work from David ):
- make a single template functions for all the various types (like Sort or Binart Search)
- use std implementations for Sort, BinarySearch, LocMin
- use mathcore special functions for Gamma and Beta functions
- remove genvector from mathcore
- add classes for integration, derivation and root findings using the algorithms of TF1
- use the plug-in manager to instantiates different implementations of the same classes in MathMore
Revision
18611 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Apr 27 10:21:56 2007 UTC (7 years, 8 months ago) by
brun
Original Path:
trunk/math/inc/TMath.h
File length: 22436 byte(s)
Diff to
previous 17818
Implement a suggestion from Jason Detwiler: two new functions in TMath
inline Double_t Sqrt2() { return 1.4142135623730950488016887242097; }
// Euler-Mascheroni Constant
inline Double_t EulerGamma() { return 0.577215664901532860606512090082402431042; }
Revision
17776 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Thu Feb 8 09:07:50 2007 UTC (7 years, 11 months ago) by
brun
Original Path:
trunk/math/inc/TMath.h
File length: 22242 byte(s)
Diff to
previous 17330
-Move function NextPrime from TMath to TMathBase. This function is used
by a few Core classes. This moves make base, cont and meta independent of TMath.h.
-TMath::NextPrime implementation is in TObject.cxx (we do not have TMathBase.cxx).
Revision
17306 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Jan 12 16:03:17 2007 UTC (8 years ago) by
brun
Original Path:
trunk/math/inc/TMath.h
File length: 22163 byte(s)
Diff to
previous 14257
TMath::Abs, TMath::Min, TMath::Max, TMath::Sign, TMath::Range
These functions are unfortunately not defined in a standard way in std::
This include is referenced by a new version of TMath.h.
As a result, TMath.h is back compatible with the previous version.
TMathBase.h is used in place of TMath.h in all the classes
that will go into the future miniCore library.
TMath.h and the TMath implementation will go into a new math sub-directory.
TString.h uses TMathBase.h instead of TMath.h.
As a result, it was necessary to include "TMath.h" in some classes
assuming that TMath was included via TString and using other functions
than the ones defined in TMathBase.h
----------------------------------------------------------------------
Revision
14235 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon Mar 13 01:19:57 2006 UTC (8 years, 10 months ago) by
rdm
Original Path:
trunk/math/inc/TMath.h
File length: 27391 byte(s)
Diff to
previous 13963
Fixes to compile with the Intel icc 9.1 beta compiler for Mac OS X.
Remains one fatal linking libPyROOT for the rest everything else works.
stress runs 14% faster, stressLinear 24% faster and stressgeom 42% faster
than gcc 4.0.1.
Revision
13963 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue Jan 31 17:08:29 2006 UTC (8 years, 11 months ago) by
brun
Original Path:
trunk/math/inc/TMath.h
File length: 27370 byte(s)
Diff to
previous 13287
Improvement of TMath::RootsCubic by Francois-Xavier Gentit
If you call TMath::RootsCubic with the following coefficients:
coef[3] = 1, coef[2] = -2, coef[1] = 1, coef[0] = -2
the polynomial should have the following roots:
2 | +i | -i
and the result given by RootsCubic is:
a b c : 0.666667 2 0.666667 ??????
It is also strange that RootsCubic does not distinguish the 2 cases
(1) - 3 real roots
(2) - 1 real root and 2 complex conjugates ones
The 2 cases could be distinguished for instance by returning a boolean?
I join to this mail a possible replacement for RootsCubic correcting these 2
problems.
Revision
12473 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon Aug 15 08:42:46 2005 UTC (9 years, 5 months ago) by
brun
Original Path:
trunk/math/inc/TMath.h
File length: 27116 byte(s)
Diff to
previous 12027
-Add more comments in TH1::KolmogorovTest
-Implement new function
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.
// That is, it is used to compare two experimental distributions of unbinned data.
//
// Input:
// a,b: One-dimensional arrays of length na, nb, respectively.
// The elements of a and b must be given in ascending order.
// option is a character string to specify options
// "D" Put out a line of "Debug" printout
// "M" Return the Maximum Kolmogorov distance instead of prob
Revision
12027 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon Jun 13 13:21:04 2005 UTC (9 years, 7 months ago) by
brun
Original Path:
trunk/math/inc/TMath.h
File length: 27005 byte(s)
Diff to
previous 11819
From Anna Kreshuk:
Implementation of a new function recently requested a few times:
Double_t TMath::ChisquareQuantile(Double_t p, Double_t ndf)
// Evaluate the quantiles of the chi-squared probability distribution function.
// Algorithm AS 91 Appl. Statist. (1975) Vol.24, P.35
// Incorporates the suggested changes in AS R85 (vol.40(1), pp.233-5, 1991)
// Parameters:
// p - the probability value, at which the quantile is computed
// ndf - number of degrees of freedom
Revision
11819 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Thu May 19 08:26:01 2005 UTC (9 years, 8 months ago) by
brun
Original Path:
trunk/math/inc/TMath.h
File length: 26941 byte(s)
Diff to
previous 11694
Add two new functions to TMath:
inline Int_t CeilNint(Double_t x);
inline Int_t FloorNint(Double_t x);
make const several arguments in the following functions;
Float_t *Cross(const Float_t v1[3],const Float_t v2[3],Float_t out[3]);
Double_t *Cross(const Double_t v1[3],const Double_t v2[3],Double_t out[3]);
Float_t NormCross(const Float_t v1[3],const Float_t v2[3],Float_t out[3]);
Double_t NormCross(const Double_t v1[3],const Double_t v2[3],Double_t out[3]);
Float_t *Normal2Plane(const Float_t v1[3],const Float_t v2[3],const Float_t v3[3], Float_t normal[3]);
Double_t *Normal2Plane(const Double_t v1[3],const Double_t v2[3],const Double_t v3[3], Double_t normal[3]);
void RootsCubic(const Double_t coef[4],Double_t &a, Double_t &b, Double_t &c);
Revision
11536 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Apr 8 16:45:51 2005 UTC (9 years, 9 months ago) by
brun
Original Path:
trunk/math/inc/TMath.h
File length: 26621 byte(s)
Diff to
previous 10813
From Anna Kreshuk
Add the new following functions in TMath:
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. and Meth. B47(1990), 215-224
//Accuracy: quote from the reference above:
//"The resuls of our code have been compared with the values of the Vavilov
//density function computed numerically in an accurate way: our approximation
//shows a difference of less than 3% around the peak of the density function, slowly
//increasing going towards the extreme tails to the right and to the left"
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. and Meth. B47(1990), 215-224
//Accuracy: quote from the reference above:
//"The resuls of our code have been compared with the values of the Vavilov
//density function computed numerically in an accurate way: our approximation
//shows a difference of less than 3% around the peak of the density function, slowly
//increasing going towards the extreme tails to the right and to the left"
Double_t TMath::LandauI(Double_t x)
//Returns the value of the Landau distribution function at point x.
//The algorithm was taken from the Cernlib function dislan(G110)
//Reference: K.S.Kolbig and B.Schorr, "A program package for the Landau
//distribution", Computer Phys.Comm., 31(1984), 97-111
Revision
9723 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Wed Aug 11 09:39:16 2004 UTC (10 years, 5 months ago) by
brun
Original Path:
trunk/math/inc/TMath.h
File length: 25831 byte(s)
Diff to
previous 9652
New functions in TMath: Original code by Anna Kreshuk
Double_t TMath::CauchyDist(Double_t x, Double_t t, Double_t s)
//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.
//The practical meaning of this is that collecting 1,000 data points gives
//no more accurate an estimate of the mean and standard deviation than does a single point.
//the formula was taken from "Engineering Statistics Handbook" on site
//http://www.itl.nist.gov/div898/handbook/eda/section3/eda3663.htm
Double_t TMath::GammaDist(Double_t x, Double_t gamma, Double_t mu, Double_t beta)
//computes the density function of Gamma distribution at point x
//gamma - shape parameter
//mu - location parameter
//beta - scale parameter
//the formula was taken from "Engineering Statistics Handbook" on site
//http://www.itl.nist.gov/div898/handbook/eda/section3/eda366b.htm
// --implementation by Anna Kreshuk
Double_t TMath::LogNormal(Double_t x, Double_t sigma, Double_t theta, Double_t m)
//computes the density of LogNormal distribution at point x
//variable X has lognormal distribution if Y=Ln(X) has normal distribution
//sigma is the shape parameter
//theta is the location parameter
//m is the scale parameter
//the formula was taken from "Engineering Statistics Handbook" on site
//http://www.itl.nist.gov/div898/handbook/eda/section3/eda3669.htm
Examples of these functions are shown in the new tutorial mathGammaNormal.C
Revision
9636 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Jul 30 19:09:52 2004 UTC (10 years, 5 months ago) by
brun
Original Path:
trunk/math/inc/TMath.h
File length: 24766 byte(s)
Diff to
previous 9581
From Philippe:
This patch change TMath from a class to a namespace.
This patch also updates rootcint to that it force the
creation of a TClass for namepaces. The TClass for
namespace is needed to allow THtml and the command
completion mechanism to properly work.
This patch also add the new macro
NamespaceImp(namespacename)
which register an implementation file for the namespace.
This patch also update THtml to clean up the output for namespaces.
Revision
9581 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Jul 23 14:29:15 2004 UTC (10 years, 6 months ago) by
brun
Original Path:
trunk/math/inc/TMath.h
File length: 25625 byte(s)
Diff to
previous 9483
New version of TMath with several emhancements and new functions.
Most functions accept now a Long64_t instead of Int_t for the
length of the arrays.
The Median functions have been improved in speed (thanks Anna Kreshuk).
The following functions are either new or have a new prototype
that should be back compatible.
// Min, Max of an array
static Short_t MinElement(Long64_t n, const Short_t *a);
static Int_t MinElement(Long64_t n, const Int_t *a);
static Float_t MinElement(Long64_t n, const Float_t *a);
static Double_t MinElement(Long64_t n, const Double_t *a);
static Long64_t MinElement(Long64_t n, const Long64_t *a);
static Short_t MaxElement(Long64_t n, const Short_t *a);
static Int_t MaxElement(Long64_t n, const Int_t *a);
static Float_t MaxElement(Long64_t n, const Float_t *a);
static Double_t MaxElement(Long64_t n, const Double_t *a);
static Long64_t MaxElement(Long64_t n, const Long64_t *a);
// Locate Min, Max element number in an array
static Long64_t LocMin(Long64_t n, const Short_t *a);
static Long64_t LocMin(Long64_t n, const Int_t *a);
static Long64_t LocMin(Long64_t n, const Float_t *a);
static Long64_t LocMin(Long64_t n, const Double_t *a);
static Long64_t LocMin(Long64_t n, const Long64_t *a);
static Long64_t LocMax(Long64_t n, const Short_t *a);
static Long64_t LocMax(Long64_t n, const Int_t *a);
static Long64_t LocMax(Long64_t n, const Float_t *a);
static Long64_t LocMax(Long64_t n, const Double_t *a);
static Long64_t LocMax(Long64_t n, const Long64_t *a);
//Mean, Geometric Mean, Median, RMS
static Double_t Mean(Long64_t n, const Short_t *a, const Double_t *w=0);
static Double_t Mean(Long64_t n, const Int_t *a, const Double_t *w=0);
static Double_t Mean(Long64_t n, const Float_t *a, const Double_t *w=0);
static Double_t Mean(Long64_t n, const Double_t *a,const Double_t *w=0);
static Double_t Mean(Long64_t n, const Long64_t *a,const Double_t *w=0);
static Double_t GeomMean(Long64_t n, const Short_t *a);
static Double_t GeomMean(Long64_t n, const Int_t *a);
static Double_t GeomMean(Long64_t n, const Float_t *a);
static Double_t GeomMean(Long64_t n, const Double_t *a);
static Double_t GeomMean(Long64_t n, const Long64_t *a);
static Double_t RMS(Long64_t n, const Short_t *a);
static Double_t RMS(Long64_t n, const Int_t *a);
static Double_t RMS(Long64_t n, const Float_t *a);
static Double_t RMS(Long64_t n, const Double_t *a);
static Double_t RMS(Long64_t n, const Long64_t *a);
static Double_t Median(Long64_t n, const Short_t *a, const Double_t *w=0, Long64_t *work=0);
static Double_t Median(Long64_t n, const Int_t *a, const Double_t *w=0, Long64_t *work=0);
static Double_t Median(Long64_t n, const Float_t *a, const Double_t *w=0, Long64_t *work=0);
static Double_t Median(Long64_t n, const Double_t *a, const Double_t *w=0, Long64_t *work=0);
static Double_t Median(Long64_t n, const Long64_t *a, const Double_t *w=0, Long64_t *work=0);
static Short_t KOrdStat(Long64_t n, const Short_t *a, Long64_t k, Long64_t *work=0);
static Int_t KOrdStat(Long64_t n, const Int_t *a, Long64_t k, Long64_t *work=0);
static Float_t KOrdStat(Long64_t n, const Float_t *a, Long64_t k, Long64_t *work=0);
static Double_t KOrdStat(Long64_t n, const Double_t *a, Long64_t k, Long64_t *work=0);
static Long64_t KOrdStat(Long64_t n, const Long64_t *a, Long64_t k, Long64_t *work=0);
// Binary search
static Long64_t BinarySearch(Long64_t n, const Short_t *array, Short_t value);
static Long64_t BinarySearch(Long64_t n, const Short_t **array, Short_t value);
static Long64_t BinarySearch(Long64_t n, const Int_t *array, Int_t value);
static Long64_t BinarySearch(Long64_t n, const Int_t **array, Int_t value);
static Long64_t BinarySearch(Long64_t n, const Float_t *array, Float_t value);
static Long64_t BinarySearch(Long64_t n, const Float_t **array, Float_t value);
static Long64_t BinarySearch(Long64_t n, const Double_t *array, Double_t value);
static Long64_t BinarySearch(Long64_t n, const Double_t **array, Double_t value);
static Long64_t BinarySearch(Long64_t n, const Long64_t *array, Long64_t value);
static Long64_t BinarySearch(Long64_t n, const Long64_t **array, Long64_t value);
// Sorting
static void Sort(Int_t n, const Short_t *a, Int_t *index, Bool_t down=kTRUE);
static void Sort(Int_t n, const Int_t *a, Int_t *index, Bool_t down=kTRUE);
static void Sort(Int_t n, const Float_t *a, Int_t *index, Bool_t down=kTRUE);
static void Sort(Int_t n, const Double_t *a, Int_t *index, Bool_t down=kTRUE);
static void Sort(Int_t n, const Long64_t *a, Int_t *index, Bool_t down=kTRUE);
static void Sort(Long64_t n, const Short_t *a, Long64_t *index, Bool_t down=kTRUE);
static void Sort(Long64_t n, const Int_t *a, Long64_t *index, Bool_t down=kTRUE);
static void Sort(Long64_t n, const Float_t *a, Long64_t *index, Bool_t down=kTRUE);
static void Sort(Long64_t n, const Double_t *a, Long64_t *index, Bool_t down=kTRUE);
static void Sort(Long64_t n, const Long64_t *a, Long64_t *index, Bool_t down=kTRUE);
Revision
9451 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Thu Jul 8 17:42:04 2004 UTC (10 years, 6 months ago) by
brun
Original Path:
trunk/math/inc/TMath.h
File length: 23484 byte(s)
Diff to
previous 9434
From Philippe:
TMath: Add a 3rd argument to the SortImp template to allow the size of the array to be
a different type from the index. Also finally fix the compilation and linking on MSVC++ 6.0
Revision
9394 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon Jul 5 17:51:12 2004 UTC (10 years, 6 months ago) by
brun
Original Path:
trunk/math/inc/TMath.h
File length: 23353 byte(s)
Diff to
previous 9262
Add new prototype for TMath::Sort.
static void Sort(Long64_t n, const Long64_t *a, Long64_t *index, Bool_t down=kTRUE);
This new prototype will be used by the new TTreeIndex class.
Add new functions
static Double_t ErfInverse(Double_t x);
static Double_t ErfcInverse(Double_t x) {return TMath::ErfInverse(1-x);}
TMath::Erf computes the inverse of the error function
Revision
9262 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Sat Jun 19 13:38:56 2004 UTC (10 years, 7 months ago) by
brun
Original Path:
trunk/math/inc/TMath.h
File length: 23144 byte(s)
Diff to
previous 8736
Add new functions to TMath:
//Mean, Median, RMS
static Double_t Mean(Int_t n, const Short_t *a);
static Double_t Mean(Int_t n, const Int_t *a);
static Double_t Mean(Int_t n, const Float_t *a);
static Double_t Mean(Int_t n, const Double_t *a);
static Double_t Mean(Int_t n, const Long_t *a);
static Double_t Mean(Int_t n, const Long64_t *a);
static Short_t Median(Int_t n, const Short_t *a);
static Int_t Median(Int_t n, const Int_t *a);
static Float_t Median(Int_t n, const Float_t *a);
static Double_t Median(Int_t n, const Double_t *a);
static Long_t Median(Int_t n, const Long_t *a);
static Long64_t Median(Int_t n, const Long64_t *a);
static Double_t MedianSorted(Int_t n, Double_t *a);
static Double_t RMS(Int_t n, const Short_t *a);
static Double_t RMS(Int_t n, const Int_t *a);
static Double_t RMS(Int_t n, const Float_t *a);
static Double_t RMS(Int_t n, const Double_t *a);
static Double_t RMS(Int_t n, const Long_t *a);
static Double_t RMS(Int_t n, const Long64_t *a);
// Statistics
static Double_t Beta(Double_t p, Double_t q);
static Double_t BetaCf(Double_t x, Double_t a, Double_t b);
static Double_t BetaIncomplete(Double_t x, Double_t a, Double_t b);
static Double_t BinomialI(Double_t p, Int_t n, Int_t k);
static Double_t FDist(Double_t F, Double_t N, Double_t M);
static Double_t FDistI(Double_t F, Double_t N, Double_t M);
static Double_t Student(Double_t T, Double_t ndf);
static Double_t StudentI(Double_t T, Double_t ndf);
Revision
8050 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue Jan 27 16:28:53 2004 UTC (10 years, 11 months ago) by
brun
Original Path:
trunk/math/inc/TMath.h
File length: 20625 byte(s)
Diff to
previous 7994
Implement support for Long64 and ULong64_t types with the new functions:
static Long64_t Abs(Long64_t d);
static Long64_t Sign(Long64_t a, Long64_t b);
static Long64_t Min(Long64_t a, Long64_t b);
static ULong64_t Min(ULong64_t a, ULong64_t b);
static Long64_t Max(Long64_t a, Long64_t b);
static ULong64_t Max(ULong64_t a, ULong64_t b);
static Int_t LocMin(Int_t n, const Long64_t *a);
static Int_t LocMax(Int_t n, const Long64_t *a);
static Int_t BinarySearch(Int_t n, const Long64_t *array, Long64_t value);
static Int_t BinarySearch(Int_t n, const Long64_t **array, Long64_t value);
static void Sort(Int_t n, const Long64_t *a, Int_t *index, Bool_t down=kTRUE);
Revision
6322 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue Mar 18 15:49:25 2003 UTC (11 years, 10 months ago) by
brun
Original Path:
trunk/math/inc/TMath.h
File length: 19391 byte(s)
Diff to
previous 5998
Split the function previously called TMath::Struve(Int_t n, Double_t x)
into two functions with names following the mathematical nomenclature for Struve/Bessel
functions and add two new functions (thanks to Kirill Filimonov)
to compute the modified Struve functions.
The new functions are:
static Double_t StruveH0(Double_t x);
static Double_t StruveH1(Double_t x);
static Double_t StruveL0(Double_t x);
static Double_t StruveL1(Double_t x);
Revision
5412 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Thu Oct 10 17:08:52 2002 UTC (12 years, 3 months ago) by
brun
Original Path:
trunk/math/inc/TMath.h
File length: 19071 byte(s)
Diff to
previous 5246
Add new functions Inside
Bool_t TMath::IsInside(Double_t xp, Double_t yp, Int_t np, Double_t *x, Double_t *y)
// Function which returns kTRUE if point xp,yp lies inside the
// polygon defined by the np points in arrays x and y, kFALSE otherwise
Bool_t TMath::IsInside(Float_t xp, Float_t yp, Int_t np, Float_t *x, Float_t *y)
Bool_t TMath::IsInside(Int_t xp, Int_t yp, Int_t np, Int_t *x, Int_t *y)
Revision
5130 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Aug 16 13:43:10 2002 UTC (12 years, 5 months ago) by
brun
Original Path:
trunk/math/inc/TMath.h
File length: 18731 byte(s)
Diff to
previous 5024
Add a new function
Double_t TMath::Voigt(Double_t x, Double_t sigma, Double_t lg, Int_t R)
// Computation of Voigt function (normalised).
// Voigt is a convolution of
// gauss(x) = 1/(sqrt(2*pi)*sigma) * exp(x*x/(2*sigma*sigma)
// and
// lorentz(x) = (1/pi) * (lg/2) / (x*x + g*g/4)
// functions.
// The Voigt function is known to be the real part of Faddeeva function also
// called complex error function [2].
// The algoritm was developed by J. Humlicek [1].
// This code is based on fortran code presented by R. J. Wells [2].
// Translated and adapted by Miha D. Puc
// To calculate the Faddeeva function with relative error less than 10^(-R).
// R can be set by the the user subject to the constraints 2 <= R <= 5.
// [1] J. Humlicek, JQSRT, 21, 437 (1982).
// [2] R. J. Wells, Rapid Approximation to the Voigt/Faddeeva Function and
// it's Derivatives.
From original mail by miha.puc@marvin.fmf.uni-lj.si
Voigt function is very common in optical spectrometry (astronomy, ..) and
also in X-ray spectrometry. I found it's quite difficult to get a
good and fast approximation algorthm and I think having voigt in TMath
would be of great value to many. For this reason and since I already have
the code I'm sending it to you to consider.
Revision
4011 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon Feb 18 10:06:34 2002 UTC (12 years, 11 months ago) by
brun
Original Path:
trunk/math/inc/TMath.h
File length: 14988 byte(s)
Diff to
previous 3878
Add two new sorting functions:
void BubbleHigh(Int_t Narr, Double_t *arr1, Int_t *arr2)
void BubbleLow (Int_t Narr, Double_t *arr1, Int_t *arr2)
Thanks to Adrian Bevan, Liverpool University
Revision
3878 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue Feb 5 22:51:52 2002 UTC (12 years, 11 months ago) by
brun
Original Path:
trunk/math/inc/TMath.h
File length: 14851 byte(s)
Diff to
previous 3703
Add new Bessel functions and also the Struve function:
static Double_t BesselJ0(Double_t x); // Bessel function J0(x) for any real x
static Double_t BesselJ1(Double_t x); // Bessel function J1(x) for any real x
static Double_t BesselY0(Double_t x); // Bessel function Y0(x) for positive x
static Double_t BesselY1(Double_t x); // Bessel function Y1(x) for positive x
static Double_t Struve(Int_t n, Double_t x); // Struve functions of order 0 and 1
Revision
292 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Wed Jun 28 14:32:54 2000 UTC (14 years, 6 months ago) by
brun
Original Path:
trunk/math/inc/TMath.h
File length: 13203 byte(s)
Diff to
previous 3
Add a new function KolmogorovProb in TMath.
Double_t TMath::KolmogorovProb(Double_t z)
{
// Calculates the probability of exceeding the value z=dn*N**2
// for the Kolmogorov test, where dn=maximum distance between
// cumulative distribution function and N experimental values.
// Function holds only for large N, but is accurate to 10**-11
// Theta function inversion formula is used for Z <= 1
This form allows you to request diffs between any two revisions of this file.
For each of the two "sides" of the diff,
enter a numeric revision.