[root] / trunk / math / mathcore / inc / TMath.h Repository:
ViewVC logotype

Log of /trunk/math/mathcore/inc/TMath.h

Parent Directory Parent Directory


Links to HEAD: (view) (download) (as text) (annotate)
Sticky Revision:

Revision 47595 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Nov 23 09:38:32 2012 UTC (2 years, 2 months ago) by moneta
File length: 36094 byte(s)
Diff to previous 47071
- add TMath::StdDev   (for RMS() ) 
- add TH1::GetStdDev and TH1::GetStdDevError
 as suggested in https://savannah.cern.ch/bugs/index.php?98989

Revision 47071 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Nov 6 16:51:47 2012 UTC (2 years, 2 months ago) by moneta
File length: 35887 byte(s)
Diff to previous 41837
apply fixes for Cuda compiler 
see https://savannah.cern.ch/bugs/?98212

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 41690 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Nov 1 16:59:52 2011 UTC (3 years, 2 months ago) by moneta
File length: 35843 byte(s)
Diff to previous 41687
revert changes in isfinite for a roblem on Windows. 
In Windows R__ANSISTREAM is defined and std::isfinite does not exist

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 41660 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Oct 31 15:18:17 2011 UTC (3 years, 2 months ago) by rdm
File length: 35814 byte(s)
Diff to previous 41535
fix for Solaris Express 11 with CC 5.

Revision 41535 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Oct 21 16:31:32 2011 UTC (3 years, 3 months ago) by moneta
File length: 35780 byte(s)
Diff to previous 41474
 fix warning on icc
 fix a problem found by G. Eulisse, by using  ::isnan

Revision 41474 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Oct 19 08:14:26 2011 UTC (3 years, 3 months ago) by moneta
File length: 35779 byte(s)
Diff to previous 41453
use correct definition for macro (fix previous commit)

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 41172 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Oct 5 20:44:49 2011 UTC (3 years, 3 months ago) by moneta
File length: 35513 byte(s)
Diff to previous 40640
use lower case for R (see http://root.cern.ch/phpBB3//viewtopic.php?f=10&t=13521 )

Revision 40640 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Aug 19 08:45:45 2011 UTC (3 years, 5 months ago) by moneta
File length: 35513 byte(s)
Diff to previous 38578
update documentation of KOrdStat to add a note on the working array

Revision 38578 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Mar 23 14:01:53 2011 UTC (3 years, 10 months ago) by moneta
File length: 35202 byte(s)
Diff to previous 38576
Fix compilation problem on Windows

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 36490 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Nov 3 08:41:38 2010 UTC (4 years, 2 months ago) by brun
File length: 33213 byte(s)
Diff to previous 36488
Fix a compilation warning

Revision 36488 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Nov 3 08:32:18 2010 UTC (4 years, 2 months ago) by brun
File length: 33209 byte(s)
Diff to previous 34992
From Olivier;
Implement a better algorithm for TMath::IsInside supporting open and closed polygons.

Revision 34992 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Aug 25 10:36:11 2010 UTC (4 years, 5 months ago) by moneta
File length: 33331 byte(s)
Diff to previous 34684
apply fixes from coverity: 
   manly not initialized constructors

Revision 34684 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Sat Jul 31 06:25:29 2010 UTC (4 years, 5 months ago) by brun
File length: 33210 byte(s)
Diff to previous 34503
In TMath::AreEqualRel take intoaccount the case when the two arguments may be null.
see: http://root.cern.ch/phpBB3/viewtopic.php?f=3&t=10920`

Revision 34503 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Jul 20 10:58:01 2010 UTC (4 years, 6 months ago) by rdm
File length: 33209 byte(s)
Diff to previous 34498
revert to previous version using finite as isfinite is too new (C99 which
is not covered by std C++).

Revision 34498 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Jul 20 10:00:47 2010 UTC (4 years, 6 months ago) by rdm
File length: 33080 byte(s)
Diff to previous 32037
Suggested by Fed: use isfinite which is ISOC99 while finite is BSD
(might have to finetune with the help of buildbot).

Revision 32037 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Jan 18 11:09:23 2010 UTC (5 years ago) by brun
File length: 33256 byte(s)
Diff to previous 29937
Fix typos and clarify the doc of TMath::RMS

Revision 29937 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Aug 27 14:15:39 2009 UTC (5 years, 4 months ago) by brun
File length: 32985 byte(s)
Diff to previous 29935
Declare the new functions AreEqual as inline functions.

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 28382 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Apr 29 10:06:36 2009 UTC (5 years, 8 months ago) by moneta
File length: 32503 byte(s)
Diff to previous 28094
- implement ErfcInverse using normal qunatile funciton instead of ErfInverse. 
  In this way numerical errors are avoided for very small input values
  (fixes problem seen at http://root.cern.ch/phpBB2/viewtopic.php?t=8428 )

Revision 28094 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Apr 3 14:10:51 2009 UTC (5 years, 9 months ago) by moneta
File length: 32542 byte(s)
Diff to previous 26030
fix a warning observed on VC9 when sorting using Long64 indices
(see http://root.cern.ch/phpBB2/viewtopic.php?t=8319)

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 23858 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu May 15 08:17:41 2008 UTC (6 years, 8 months ago) by moneta
File length: 32330 byte(s)
Diff to previous 23655
from David: improve doc in TMath for new functions  using iterators

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 22885 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Mar 28 13:57:25 2008 UTC (6 years, 9 months ago) by rdm
File length: 30120 byte(s)
Copied from: trunk/math/inc/TMath.h revision 22862
Diff to previous 22866
move the following directories under the new "math" meta directory:
   mathcore
   mathmore
   fftw
   foam
   fumili
   genvector
   matrix
   minuit
   minuit2
   mlp
   physics
   smatrix
   splot
   unuran
   quadp

Revision 22866 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Mar 27 15:32:50 2008 UTC (6 years, 9 months ago) by rdm
Original Path: trunk/mathcore/inc/TMath.h
File length: 30120 byte(s)
Copied from: trunk/math/inc/TMath.h revision 22862
Diff to previous 22728
move remaining files from math to mathcore (they were part of libMathCore
anyway). Include paths remain the same.

Revision 22728 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Mar 19 10:05:41 2008 UTC (6 years, 10 months ago) by moneta
Original Path: trunk/math/inc/TMath.h
File length: 30116 byte(s)
Diff to previous 22518
- update documentation for new mathcore classes introduced in 5.19.02
- remove TMathImp.h file to fix documentaiton problem
- change name for class GaussIntegratorOneDim to GaussIntegrator

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 20882 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Nov 19 11:31:26 2007 UTC (7 years, 2 months ago) by rdm
Original Path: trunk/math/inc/TMath.h
File length: 22381 byte(s)
Diff to previous 19826
Set property svn:eol-style LF on all source and Makefiles. This should avoid
problems with Win32 line endings ending up in the repository. All MS tools
support LF eols fine.

Revision 19826 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Sep 19 19:56:11 2007 UTC (7 years, 4 months ago) by rdm
Original Path: trunk/math/inc/TMath.h
File length: 22381 byte(s)
Diff to previous 19825
imported svn:keywords Id property

Revision 19825 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Sep 19 19:49:10 2007 UTC (7 years, 4 months ago) by rdm
Original Path: trunk/math/inc/TMath.h
File length: 22426 byte(s)
Diff to previous 18611
remove :$ from tag line

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 17818 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Feb 9 10:15:39 2007 UTC (7 years, 11 months ago) by rdm
Original Path: trunk/math/inc/TMath.h
File length: 22242 byte(s)
Diff to previous 17776
correct cvs ident line (base -> math).

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 17330 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Jan 15 14:27:07 2007 UTC (8 years ago) by brun
Original Path: trunk/math/inc/TMath.h
File length: 22314 byte(s)
Diff to previous 17306
Fix wrong info in comments

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 14257 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Mar 14 10:52:26 2006 UTC (8 years, 10 months ago) by rdm
Original Path: trunk/math/inc/TMath.h
File length: 27408 byte(s)
Diff to previous 14252
revert previous changes and add jusr specific change for Intel's icc for
MacOS X.

Revision 14252 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Mar 13 22:12:35 2006 UTC (8 years, 10 months ago) by rdm
Original Path: trunk/math/inc/TMath.h
File length: 27402 byte(s)
Diff to previous 14235
fix for Mac OS X < 10.4.

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 13287 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Nov 18 20:30:04 2005 UTC (9 years, 2 months ago) by brun
Original Path: trunk/math/inc/TMath.h
File length: 27370 byte(s)
Diff to previous 12473
From Anna:
New function TMath::Quantiles. See doc in TMath.cxx

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 11694 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Apr 29 17:08:34 2005 UTC (9 years, 8 months ago) by brun
Original Path: trunk/math/inc/TMath.h
File length: 26586 byte(s)
Diff to previous 11536
Remove the function TMath::Sqrt(Long_t) that causes more problems
than solutions.

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 10813 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Dec 16 18:08:03 2004 UTC (10 years, 1 month ago) by brun
Original Path: trunk/math/inc/TMath.h
File length: 26435 byte(s)
Diff to previous 10539
Implement TMath::DiLog, the dilogarithm function.
I have translated the original CERNLIB routine DILOG (C332)

Revision 10539 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Nov 16 17:15:34 2004 UTC (10 years, 2 months ago) by brun
Original Path: trunk/math/inc/TMath.h
File length: 26397 byte(s)
Diff to previous 10535
From Anna Kreshuk
Add the Laplace distributions
   Double_t LaplaceDist(Double_t x, Double_t alpha=0, Double_t beta=1);
   Double_t LaplaceDistI(Double_t x, Double_t alpha=0, Double_t beta=1);

Revision 10535 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Nov 15 22:28:14 2004 UTC (10 years, 2 months ago) by brun
Original Path: trunk/math/inc/TMath.h
File length: 26107 byte(s)
Diff to previous 10515
From Anna Kreshuk:
Add two new functions to TMath:
          Double_t BetaDist(Double_t x, Double_t p, Double_t q);
          Double_t BetaDistI(Double_t x, Double_t p, Double_t q);

Revision 10515 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Nov 10 20:26:24 2004 UTC (10 years, 2 months ago) by brun
Original Path: trunk/math/inc/TMath.h
File length: 25855 byte(s)
Diff to previous 10165
Remove an extra ";" at the end of the TMath declaration.
This was a left over when TMath was a class instead of a namespace.
Thanks to Robert Hatcher.

Revision 10165 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Sep 24 18:18:42 2004 UTC (10 years, 4 months ago) by brun
Original Path: trunk/math/inc/TMath.h
File length: 25856 byte(s)
Diff to previous 9796
Fix a small problem in TMath::Abs(x) when x=0

Revision 9796 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Aug 20 10:00:33 2004 UTC (10 years, 5 months ago) by brun
Original Path: trunk/math/inc/TMath.h
File length: 25850 byte(s)
Diff to previous 9795
In TMath::Landau change the name of the argument "mean" to "mpv" (most probable value).

Revision 9795 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Aug 20 09:57:03 2004 UTC (10 years, 5 months ago) by brun
Original Path: trunk/math/inc/TMath.h
File length: 25851 byte(s)
Diff to previous 9723
Add an optional argument Bool_t norm=kFALSE to TMath::Landau
When norm is kTRUE, TMath::Landau returns a normalized (divided by sigma) result.

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 9652 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Aug 2 11:20:49 2004 UTC (10 years, 5 months ago) by brun
Original Path: trunk/math/inc/TMath.h
File length: 25600 byte(s)
Diff to previous 9651
Reintroduce functions with Long_t signatures for LocMin, LocMax, Mean, BinarySearch and Sort

Revision 9651 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Aug 2 08:52:54 2004 UTC (10 years, 5 months ago) by rdm
Original Path: trunk/math/inc/TMath.h
File length: 24735 byte(s)
Diff to previous 9636
remove code related to MacOS 9 this was never really supported and has
been obsoleted by full MacOS X support.

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 9483 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Jul 9 17:22:59 2004 UTC (10 years, 6 months ago) by brun
Original Path: trunk/math/inc/TMath.h
File length: 24177 byte(s)
Diff to previous 9451
From Eddy Offermann
1) New function GeomMean which caclculates the geomteric mean of
    a sample
2) Added the possibilty to use weights in the calculations of Mean
    and Median

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 9434 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Jul 8 08:19:17 2004 UTC (10 years, 6 months ago) by brun
Original Path: trunk/math/inc/TMath.h
File length: 23473 byte(s)
Diff to previous 9394
From Philippe:
The TMath::Sort functions are implemented via a templated function.
This saves a lot of code.
Other functions like Mean, RMS, BinarySearch will follow.

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 8736 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Apr 29 08:27:15 2004 UTC (10 years, 8 months ago) by brun
Original Path: trunk/math/inc/TMath.h
File length: 21624 byte(s)
Diff to previous 8735
Prevent a double declaration of ceil and floor on Windows. Move the declaration
in the block already foreseen for R_WIN32

Revision 8735 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Apr 29 08:23:18 2004 UTC (10 years, 8 months ago) by brun
Original Path: trunk/math/inc/TMath.h
File length: 21624 byte(s)
Diff to previous 8734
The extern declaration for ceil and floor is mandatory on Solaris/CC

Revision 8734 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Apr 29 08:12:36 2004 UTC (10 years, 8 months ago) by brun
Original Path: trunk/math/inc/TMath.h
File length: 21561 byte(s)
Diff to previous 8733
Under Windows the functions ceil and floor must be declared as
   _CRTIMP double ceil(double);
   _CRTIMP double floor(double);

Revision 8733 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Apr 29 07:52:27 2004 UTC (10 years, 8 months ago) by brun
Original Path: trunk/math/inc/TMath.h
File length: 21559 byte(s)
Diff to previous 8722
Functions TMath::Ceil and TMath::Floor are now inline functions

Revision 8722 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Apr 28 12:13:00 2004 UTC (10 years, 8 months ago) by brun
Original Path: trunk/math/inc/TMath.h
File length: 21366 byte(s)
Diff to previous 8686
Add protections in TMath::ACos and TMath::ASin in case the argument
is outside [-1,1]

Revision 8686 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Sat Apr 24 19:36:20 2004 UTC (10 years, 9 months ago) by brun
Original Path: trunk/math/inc/TMath.h
File length: 21210 byte(s)
Diff to previous 8682
Change the return type of TMath::Binomial from Int_t to Double_t.
As Int_t, it overflows for n>31

Revision 8682 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Sat Apr 24 16:42:33 2004 UTC (10 years, 9 months ago) by brun
Original Path: trunk/math/inc/TMath.h
File length: 21206 byte(s)
Diff to previous 8669
From Federico Carminati:
Change calling API for TMath::Permute(Int_t, Int_t *a)
Add new function TMath::Binomial
see comments in functions

Revision 8669 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Apr 23 10:30:26 2004 UTC (10 years, 9 months ago) by brun
Original Path: trunk/math/inc/TMath.h
File length: 21129 byte(s)
Diff to previous 8607
New function TMath::Permute by Federico Carminati
see doc in function

Revision 8607 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Apr 19 14:01:05 2004 UTC (10 years, 9 months ago) by brun
Original Path: trunk/math/inc/TMath.h
File length: 21029 byte(s)
Diff to previous 8555
Fix a bux in TMath::ATan2(y,x). When x=y=0, the function must return 0.
(thanks Nick van Eijndhoven)

Revision 8555 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Apr 8 10:53:31 2004 UTC (10 years, 9 months ago) by rdm
Original Path: trunk/math/inc/TMath.h
File length: 20956 byte(s)
Diff to previous 8553
From Philippe:
fix prototype for ldexp() for MSV7.

Revision 8553 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Apr 7 14:11:17 2004 UTC (10 years, 9 months ago) by rdm
Original Path: trunk/math/inc/TMath.h
File length: 20913 byte(s)
Diff to previous 8139
From Eddy:
It would be nice tod add "ldexp" to TMath : TMath::Ldexp(Double_t x, Int_t xep)
The ldexp() function computes x * 2^exp.

Revision 8139 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Feb 6 14:30:55 2004 UTC (10 years, 11 months ago) by brun
Original Path: trunk/math/inc/TMath.h
File length: 20723 byte(s)
Diff to previous 8050
Add new function TMath::RootsCubic computing the roots of a cubic polynomial

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 7994 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Jan 23 18:50:03 2004 UTC (11 years ago) by brun
Original Path: trunk/math/inc/TMath.h
File length: 19495 byte(s)
Diff to previous 7730
From Philippe:
With this patch, rootcint is now aware that it is in a windows environment when parsing the header files.
In particular, this repairs the behavior of std::cout.

Revision 7730 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Dec 11 13:39:22 2003 UTC (11 years, 1 month ago) by brun
Original Path: trunk/math/inc/TMath.h
File length: 19467 byte(s)
Diff to previous 6822
Add a new function TMath::PoissonI returning the true non-smooth Poisson distribution.
Add comments in TMath::Poisson. Add Pictures to the doc.

Revision 6822 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Jul 4 13:05:25 2003 UTC (11 years, 6 months ago) by brun
Original Path: trunk/math/inc/TMath.h
File length: 19411 byte(s)
Diff to previous 6322
Add an optional argument to TMath::Gaus to normalize the result to sqrt(2*pi)*sigma

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 5998 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Jan 28 07:43:36 2003 UTC (11 years, 11 months ago) by brun
Original Path: trunk/math/inc/TMath.h
File length: 19127 byte(s)
Diff to previous 5412
Add the Poisson distribution function
   static Double_t  Poisson(Double_t x, Double_t par);

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 5246 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Sep 10 12:13:54 2002 UTC (12 years, 4 months ago) by rdm
Original Path: trunk/math/inc/TMath.h
File length: 18805 byte(s)
Diff to previous 5130
protect against finite and isnan already being defined for glibc. This
could happen in a particular sequence of system includes.

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 5024 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Jul 29 11:09:54 2002 UTC (12 years, 5 months ago) by rdm
Original Path: trunk/math/inc/TMath.h
File length: 18650 byte(s)
Diff to previous 5003
added many fundamental constants. List was donated by Tony Colley from ITT.

Revision 5003 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Jul 23 11:12:18 2002 UTC (12 years, 6 months ago) by rdm
Original Path: trunk/math/inc/TMath.h
File length: 15123 byte(s)
Diff to previous 4850
in case of GLIBC and g++ -ansi option add special define for finite and isnan.

Revision 4850 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Jul 9 15:57:02 2002 UTC (12 years, 6 months ago) by rdm
Original Path: trunk/math/inc/TMath.h
File length: 15002 byte(s)
Diff to previous 4805
fix for glibc and isnan. There were too many permutations and options
possible, just include math.h when using a glibc system.

Revision 4805 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Jul 2 06:43:32 2002 UTC (12 years, 6 months ago) by brun
Original Path: trunk/math/inc/TMath.h
File length: 15151 byte(s)
Diff to previous 4614
Add function
  Double_t TMath::Factorial(Int_t n)

Revision 4614 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu May 30 13:20:42 2002 UTC (12 years, 7 months ago) by rdm
Original Path: trunk/math/inc/TMath.h
File length: 15115 byte(s)
Diff to previous 4269
fix issue for gcc 2.95.2 with -ansi option releated to finite and isnan.

Revision 4269 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Mar 29 18:02:47 2002 UTC (12 years, 9 months ago) by brun
Original Path: trunk/math/inc/TMath.h
File length: 15068 byte(s)
Diff to previous 4011
Add BreitWigner function
Double_t TMath::BreitWigner(Double_t x, Double_t mean, Double_t gamma)
   // Calculate a Breit Wigner function with mean and gamma

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 3703 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Jan 18 18:46:07 2002 UTC (13 years ago) by rdm
Original Path: trunk/math/inc/TMath.h
File length: 14452 byte(s)
Diff to previous 3677
port to HP-UX 11i version 1.5 (IA-64) with the aCC compiler.

Revision 3677 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Jan 16 11:00:19 2002 UTC (13 years ago) by rdm
Original Path: trunk/math/inc/TMath.h
File length: 14373 byte(s)
Diff to previous 3501
fix finite() and isnan() being undefined problems when compiling with the
gcc -ansi option. This fixes also the G4 incompatibility problem since
the latest G4 makefile was setting -ansi for gcc.

Revision 3501 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Dec 19 14:30:32 2001 UTC (13 years, 1 month ago) by rdm
Original Path: trunk/math/inc/TMath.h
File length: 14266 byte(s)
Diff to previous 3416
add a protection in case isnan() and finite() are macros.

Revision 3416 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Dec 7 21:55:14 2001 UTC (13 years, 1 month ago) by brun
Original Path: trunk/math/inc/TMath.h
File length: 14207 byte(s)
Diff to previous 3388
Make the array arguments const in functions LocMin, LocMax, BinarySearch
and Sort.
Add new signatures with Long_t

Revision 3388 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Dec 4 19:15:56 2001 UTC (13 years, 1 month ago) by rdm
Original Path: trunk/math/inc/TMath.h
File length: 13754 byte(s)
Diff to previous 3382
final correction for isnan and finite for Win32

Revision 3382 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Dec 4 12:02:43 2001 UTC (13 years, 1 month ago) by rdm
Original Path: trunk/math/inc/TMath.h
File length: 13730 byte(s)
Diff to previous 3372
include <float.h> so TMath.h does not require explicit <float.h> inclusion
before itself.

Revision 3372 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Dec 3 12:47:24 2001 UTC (13 years, 1 month ago) by rdm
Original Path: trunk/math/inc/TMath.h
File length: 13709 byte(s)
Diff to previous 3371
#endif accidentally removed

Revision 3371 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Dec 3 12:46:07 2001 UTC (13 years, 1 month ago) by rdm
Original Path: trunk/math/inc/TMath.h
File length: 13702 byte(s)
Diff to previous 3370
added special case for finite() on Solaris (isnan() is in math.h, finite not).

Revision 3370 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Dec 3 12:38:24 2001 UTC (13 years, 1 month ago) by rdm
Original Path: trunk/math/inc/TMath.h
File length: 13632 byte(s)
Diff to previous 2449
added IsNaN() and Finite(). According to Yuri it should also work
on Solaris. If not, need to add define.

Revision 2449 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Jun 25 09:16:30 2001 UTC (13 years, 7 months ago) by brun
Original Path: trunk/math/inc/TMath.h
File length: 13253 byte(s)
Diff to previous 702
Add TMath::Freq(x) computing the normal frequency function

Revision 702 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Oct 2 10:44:28 2000 UTC (14 years, 3 months ago) by rdm
Original Path: trunk/math/inc/TMath.h
File length: 13216 byte(s)
Diff to previous 292
changes needed to compile on glibc 2.2 systems (Red Hat 7.0 being the first).

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

Revision 3 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue May 16 17:00:58 2000 UTC (14 years, 8 months ago) by rdm
Original Path: trunk/math/inc/TMath.h
File length: 13104 byte(s)
Copied from: branches/unlabeled-1.1.1/math/inc/TMath.h revision 2
Diff to previous 2
This commit was generated by cvs2svn to compensate for changes in r2,
which included commits to RCS files with non-trunk default branches.

Revision 2 - (view) (download) (as text) (annotate) - [select for diffs]
Added Tue May 16 17:00:58 2000 UTC (14 years, 8 months ago) by rdm
Original Path: branches/unlabeled-1.1.1/math/inc/TMath.h
File length: 13104 byte(s)
Initial import of ROOT into CVS

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.

  Diffs between and
  Type of Diff should be a

Sort log by:

Subversion Admin
ViewVC Help
Powered by ViewVC 1.0.9