[root] / trunk / math / mathcore / src / TMath.cxx Repository:
ViewVC logotype

Log of /trunk/math/mathcore/src/TMath.cxx

Parent Directory Parent Directory


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

Revision 46270 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Oct 2 13:58:32 2012 UTC (2 years, 3 months ago) by moneta
File length: 106743 byte(s)
Diff to previous 46214
Update comments in TMath::Landau and TRandom::Landau

Revision 46214 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Sep 27 10:10:19 2012 UTC (2 years, 3 months ago) by rdm
File length: 106747 byte(s)
Diff to previous 44507
Digital Alpha is no longer supported. Remove all references to __alpha and
__true64.

Revision 44507 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Jun 4 12:30:41 2012 UTC (2 years, 7 months ago) by axel
File length: 106769 byte(s)
Diff to previous 44433
Remove
  using namespace std;
from Riostream.h, which has huge consequences for all of ROOT.
Riostream.h is now a simple wrapper for fstream, iostream, iomanip for backward compatibility; Riosfwd.h simply wraps iosfwd.

Because of templates and their inline functions, Riostream.h needed to be included in headers, too (e.g. TParameter.h), which violated the assumption that Riostream.h is not exposing its using namespace std to headers.
ROOT now requires R__ANSISTREAM, R__SSTREAM, which does not change the set of supported compilers.

Without "using namespace std", several identifiers are now prefixed by std::; e.g. roofit/* source files now have a using namespace std to keep their coding style.
TFile::MakeProject() now generates "using namespace std" to convert the CINT-style class names into C++ ones.

Revision 44433 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Jun 1 08:16:43 2012 UTC (2 years, 7 months ago) by moneta
File length: 106749 byte(s)
Diff to previous 41830
from Gabriel: fix TMath::Binomial to return NaN for invalid input parameters

Revision 41830 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Nov 9 10:07:39 2011 UTC (3 years, 2 months ago) by moneta
File length: 106730 byte(s)
Diff to previous 36817
fix bug https://savannah.cern.ch/bugs/?87251 in TMath::Quantiles

 - reimplement the method following R impelmentation. This fixes also the case for type =3, 
 where a different result was returned

Revision 36817 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Sun Nov 21 08:36:19 2010 UTC (4 years, 2 months ago) by brun
File length: 106621 byte(s)
Diff to previous 36584
From Federico:
makes the calculation of the binomial distribution between 2 and 3 times faster.

Revision 36584 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Nov 10 10:44:31 2010 UTC (4 years, 2 months ago) by moneta
File length: 106636 byte(s)
Diff to previous 36293
fix in TMath::KolmogorovTest the case when the two vectors are identical
 - clean up and simplify also the code 

  in the case of ties the results have been checked manually with R ks.test function

Revision 36293 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Oct 11 12:27:10 2010 UTC (4 years, 3 months ago) by moneta
File length: 106660 byte(s)
Diff to previous 35278
fix a typo in the TMath::Voigt documentation (see RooTalk post)

Revision 35278 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Sep 14 14:27:42 2010 UTC (4 years, 4 months ago) by moneta
File length: 106657 byte(s)
Diff to previous 33719
- improve implementation of F distribution for large N and M. Use now same implementation everywhere

Revision 33719 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Jun 2 14:05:35 2010 UTC (4 years, 7 months ago) by moneta
File length: 106897 byte(s)
Diff to previous 32143
Fix documentation of TMath::ErfcInverse

Revision 32143 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Jan 28 18:29:19 2010 UTC (4 years, 11 months ago) by brun
File length: 106899 byte(s)
Diff to previous 30749
Fix a buffer overflow reported and fixed by morris@jhu.edu at http://savannah.cern.ch/bugs/?62046

Revision 30749 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Oct 15 16:33:04 2009 UTC (5 years, 3 months ago) by brun
File length: 106899 byte(s)
Diff to previous 29770
From Matthew Strait:
This patch fixes the spelling of "function" in the root source code
and documentation, which is misspelled (sometimes as part of larger
"function"-based words) at least 152 times:

* "funciton" 48 times
* "funcion" 36 times
* "funtion" 23 times
* "fucntion" 17 times
* "functionn" 6 times
* "fuction" 6 times
* "fuunction" 4 times
* "functioin" 3 times
* "fonction" 3 times
* "funstion" twice
* "fnuction" once
* "functiom" once
* "functio" once
* "funcition" once

Revision 29770 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Aug 12 16:40:27 2009 UTC (5 years, 5 months ago) by rdm
File length: 106899 byte(s)
Diff to previous 28382
Remove following obsolete architectures:
linuxkcc, alphakcc, linuxia64sgi, linuxdeb2ppc, solariskcc, sgikcc and
linuxpgcc.

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: 107384 byte(s)
Diff to previous 24832
- 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 24832 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Jul 15 13:10:27 2008 UTC (6 years, 6 months ago) by moneta
File length: 106980 byte(s)
Diff to previous 23655
- improve documentation for Landau distribution
- also fix landau_pdf to return normalized distribution when scale is different than 1

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: 106674 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: 112259 byte(s)
Copied from: trunk/math/src/TMath.cxx 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/src/TMath.cxx
File length: 112259 byte(s)
Copied from: trunk/math/src/TMath.cxx revision 22862
Diff to previous 22518
move remaining files from math to mathcore (they were part of libMathCore
anyway). Include paths remain the same.

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/src/TMath.cxx
File length: 112255 byte(s)
Diff to previous 22168
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 22168 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Feb 15 18:44:59 2008 UTC (6 years, 11 months ago) by rdm
Original Path: trunk/math/src/TMath.cxx
File length: 172812 byte(s)
Diff to previous 21322
white space.

Revision 21322 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Dec 11 13:07:49 2007 UTC (7 years, 1 month ago) by brun
Original Path: trunk/math/src/TMath.cxx
File length: 172829 byte(s)
Diff to previous 21169
In TMath::Gamma documentation remove a blank character in the definition of a Latex #frac

Revision 21169 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Dec 4 07:40:53 2007 UTC (7 years, 1 month ago) by brun
Original Path: trunk/math/src/TMath.cxx
File length: 172830 byte(s)
Diff to previous 21041
Fix coding conventions

Revision 21041 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Nov 26 13:19:02 2007 UTC (7 years, 1 month ago) by brun
Original Path: trunk/math/src/TMath.cxx
File length: 172826 byte(s)
Diff to previous 21031
From Axel and Silvia Arcelli:
* implement rebinning, add, multiply, divide (incl. binomial)
* fix error calculation, now similar to TH1 etc
* allow for non-equal bin sizes: call constructor without bin edges,
call SetBinEdges() afterwards

Revision 21031 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Sat Nov 24 09:56:30 2007 UTC (7 years, 2 months ago) by brun
Original Path: trunk/math/src/TMath.cxx
File length: 172827 byte(s)
Diff to previous 20975
Improve TMath::KolmogorovTest (Jason Detwiler)
//
//  Method Improvement by Jason A Detwiler (JADetwiler@lbl.gov)
//  -----------------------------------------------------------
//   The nuts-and-bolts of the TMath::KolmogorovTest() algorithm is a for-loop
//   over the two sorted arrays a and b representing empirical distribution
//   functions. The for-loop handles 3 cases: when the next points to be 
//   evaluated satisfy a>b, a<b, or a=b:
//    
//      for (Int_t i=0;i<na+nb;i++) {
//         if (a[ia-1] < b[ib-1]) {
//            rdiff -= sa;
//            ia++;
//            if (ia > na) {ok = kTRUE; break;}
//         } else if (a[ia-1] > b[ib-1]) {
//            rdiff += sb;
//            ib++;
//            if (ib > nb) {ok = kTRUE; break;}
//         } else {
//            rdiff += sb - sa;
//            ia++;
//            ib++;
//            if (ia > na) {ok = kTRUE; break;}
//            if (ib > nb) {ok = kTRUE; break;}
//        }
//         rdmax = TMath::Max(rdmax,TMath::Abs(rdiff));
//      }
//    
//   For the last case, a=b, the algorithm advances each array by one index in an
//   attempt to move through the equality. However, this is incorrect when one or
//   the other of a or b (or both) have a repeated value, call it x. For the KS
//   statistic to be computed properly, rdiff needs to be calculated after all of
//   the a and b at x have been tallied (this is due to the definition of the
//   empirical distribution function; another way to convince yourself that the
//   old CERNLIB method is wrong is that it implies that the function defined as the
//   difference between a and b is multi-valued at x -- besides being ugly, this
//   would invalidate Kolmogorov's theorem).
//    
//   The solution is to just add while-loops into the equality-case handling to
//   perform the tally:
//    
//         } else {
//            double x = a[ia-1];
//            while(a[ia-1] == x && ia <= na) {
//              rdiff -= sa;
//              ia++;
//            }
//            while(b[ib-1] == x && ib <= nb) {
//              rdiff += sb;
//              ib++;
//            }
//            if (ia > na) {ok = kTRUE; break;}
//            if (ib > nb) {ok = kTRUE; break;}
//         }

Revision 20975 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Nov 22 08:59:19 2007 UTC (7 years, 2 months ago) by moneta
Original Path: trunk/math/src/TMath.cxx
File length: 170471 byte(s)
Diff to previous 20882
update documentation for TMath::Gamma according to https://savannah.cern.ch/bugs/?31513

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/src/TMath.cxx
File length: 170435 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/src/TMath.cxx
File length: 170435 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/src/TMath.cxx
File length: 170484 byte(s)
Diff to previous 19024
remove :$ from tag line

Revision 19024 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Jun 13 19:36:27 2007 UTC (7 years, 7 months ago) by brun
Original Path: trunk/math/src/TMath.cxx
File length: 170494 byte(s)
Diff to previous 19023
Add a missing namespace TMath:: when calling NormQuantile.

Revision 19023 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Jun 13 19:33:07 2007 UTC (7 years, 7 months ago) by brun
Original Path: trunk/math/src/TMath.cxx
File length: 170487 byte(s)
Diff to previous 18087
In TMath::StudentQuantile fix a problem when ndf=1 reported at
https://savannah.cern.ch/bugs/?27163

Revision 18087 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Feb 26 15:32:04 2007 UTC (7 years, 10 months ago) by brun
Original Path: trunk/math/src/TMath.cxx
File length: 170489 byte(s)
Diff to previous 17818
Small improvement in TMath::IsInside in case the 1st and last point are not identical.

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/src/TMath.cxx
File length: 170401 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/src/TMath.cxx
File length: 170405 byte(s)
Diff to previous 17653
-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 17653 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Sat Feb 3 09:03:35 2007 UTC (7 years, 11 months ago) by brun
Original Path: trunk/math/src/TMath.cxx
File length: 170918 byte(s)
Diff to previous 17641
Fix coding conventions.

Revision 17641 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Feb 2 18:03:13 2007 UTC (7 years, 11 months ago) by brun
Original Path: trunk/math/src/TMath.cxx
File length: 170911 byte(s)
Diff to previous 17399
From Lorenzo:
patch for fixing the calculation of Dmax in the Kolmogorov test when there are identical values in the two data sets. Thanks to Ivan Melo for finding this bug ( bug 23408 in Savannah)

Revision 17399 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Jan 19 07:21:23 2007 UTC (8 years ago) by brun
Original Path: trunk/math/src/TMath.cxx
File length: 170890 byte(s)
Diff to previous 17284
From Jason Det:
TMath::BinomialI(p, n, k) is meant to return the probability of observing k
or more events of probability p in n trials. The function simply wraps
TMath::BetaIncomplete(x, a, b) because of the simple relationship between the
functions. However, BetaIncomplete is ill-defined for a=0, which corresponds
to k=0 in BinomialI. But Binomial(p, n, 0) should always give 1.0, since the
probability of getting 0 or more events is always 100%. So this bug can be
quickly fixed by adding the following if() statement in the body of
BinomialI() before the call to BetaIncomplete():

  if(k <= 0) return 1.0;

Although the same problem does not occur for k = n, I would still recommend
adding also the following if() statements before the call to BetaIncomplete()
to cut down on computation time:

  if(k > n) return 0.0;
  if(k == n) return TMath::Power(p, n);

Revision 17284 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Jan 10 16:54:00 2007 UTC (8 years ago) by brun
Original Path: trunk/math/src/TMath.cxx
File length: 170794 byte(s)
Diff to previous 17146
TMath::Hash calls now TString::Hash.

Revision 17146 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Dec 11 10:44:21 2006 UTC (8 years, 1 month ago) by brun
Original Path: trunk/math/src/TMath.cxx
File length: 178166 byte(s)
Diff to previous 15763
From Lorenzo:
Replace declarations like
    const Double_t array[892];
by
    static Double_t array[892];
This makes a huge performance improvement with most compilers (factor 20 !!).
With the const qualifier, the compiler allocates the array at each call !!

Revision 15763 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Jul 11 09:05:02 2006 UTC (8 years, 6 months ago) by rdm
Original Path: trunk/math/src/TMath.cxx
File length: 178048 byte(s)
Diff to previous 14821
correct a number of incorrect and/or ambiguous license statements.

Revision 14821 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Apr 25 06:19:35 2006 UTC (8 years, 9 months ago) by brun
Original Path: trunk/math/src/TMath.cxx
File length: 178172 byte(s)
Diff to previous 13987
n TMath::NextPrime the function comments state

   // Return next prime number after x, unless x is a prime in which case
   // x is returned.

this seems to be false for x=2 since 2 is prime and NextPrime(2) returns 3.
(Thanks to francois.boutines@gmail.com for reporting this problem)

Revision 13987 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Feb 3 21:55:39 2006 UTC (8 years, 11 months ago) by pcanal
Original Path: trunk/math/src/TMath.cxx
File length: 178168 byte(s)
Diff to previous 13983
Update of spacing and documentation to match the coding rule

Revision 13983 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Feb 3 14:56:12 2006 UTC (8 years, 11 months ago) by rdm
Original Path: trunk/math/src/TMath.cxx
File length: 178106 byte(s)
Diff to previous 13963
From Peter Hristov and Jan Fiete Grosse-Oetringhaus:
avoid a division by 0 in Landau().

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/src/TMath.cxx
File length: 178073 byte(s)
Diff to previous 13300
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 13300 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Nov 21 11:17:18 2005 UTC (9 years, 2 months ago) by rdm
Original Path: trunk/math/src/TMath.cxx
File length: 177685 byte(s)
Diff to previous 13287
coding style fixes.

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/src/TMath.cxx
File length: 177781 byte(s)
Diff to previous 13258
From Anna:
New function TMath::Quantiles. See doc in TMath.cxx

Revision 13258 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Nov 16 20:11:59 2005 UTC (9 years, 2 months ago) by pcanal
Original Path: trunk/math/src/TMath.cxx
File length: 172491 byte(s)
Diff to previous 12604
White spaces and comments update

Revision 12604 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Sat Sep 3 07:09:59 2005 UTC (9 years, 4 months ago) by brun
Original Path: trunk/math/src/TMath.cxx
File length: 172407 byte(s)
Diff to previous 12584
In TMath::KolmogorovTest, introduce an improved algorithm
suggested by Harry W. K. Cheung <cheung@fnal.gov> in case of
bins with identical contents.

Revision 12584 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Sep 2 07:51:51 2005 UTC (9 years, 4 months ago) by brun
Original Path: trunk/math/src/TMath.cxx
File length: 172253 byte(s)
Diff to previous 12546
Fix the remaining problems reported by the rule checker in directory base

Revision 12546 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Aug 29 08:24:08 2005 UTC (9 years, 4 months ago) by brun
Original Path: trunk/math/src/TMath.cxx
File length: 172127 byte(s)
Diff to previous 12473
Fix coding conventions in the base directory

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/src/TMath.cxx
File length: 172134 byte(s)
Diff to previous 12419
-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 12419 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Jul 29 15:43:05 2005 UTC (9 years, 5 months ago) by brun
Original Path: trunk/math/src/TMath.cxx
File length: 168738 byte(s)
Diff to previous 12409
Remove a debug printf stattement in TMath::RMS

Revision 12409 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Jul 29 08:53:30 2005 UTC (9 years, 5 months ago) by brun
Original Path: trunk/math/src/TMath.cxx
File length: 168771 byte(s)
Diff to previous 12375
From Anna Kreshuk.
Fix a bug in TMath::RMS reported by Robert Hatcher.

Revision 12375 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Sun Jul 24 20:47:09 2005 UTC (9 years, 6 months ago) by brun
Original Path: trunk/math/src/TMath.cxx
File length: 168431 byte(s)
Diff to previous 12028
From simon@lang-clan.de
Fix to get TMath.cxx to compile on freeBSD

Revision 12028 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Jun 13 13:31:57 2005 UTC (9 years, 7 months ago) by brun
Original Path: trunk/math/src/TMath.cxx
File length: 168409 byte(s)
Diff to previous 12027
Forgot toa dd the namespace TMath in the new function ChisquareQuantile

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/src/TMath.cxx
File length: 168402 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/src/TMath.cxx
File length: 165340 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/src/TMath.cxx
File length: 165274 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/src/TMath.cxx
File length: 165435 byte(s)
Diff to previous 11495
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 11495 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Apr 5 16:10:37 2005 UTC (9 years, 9 months ago) by brun
Original Path: trunk/math/src/TMath.cxx
File length: 144975 byte(s)
Diff to previous 11037
From Eddy Offermann
Improve comments in the Gamma functions.

Revision 11037 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Feb 4 22:34:51 2005 UTC (9 years, 11 months ago) by brun
Original Path: trunk/math/src/TMath.cxx
File length: 144688 byte(s)
Diff to previous 10813
From Victor:
Fix a bug in TMath::Hash reported by Mathieu de Naurois

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/src/TMath.cxx
File length: 144685 byte(s)
Diff to previous 10572
Implement TMath::DiLog, the dilogarithm function.
I have translated the original CERNLIB routine DILOG (C332)

Revision 10572 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Nov 19 14:28:17 2004 UTC (10 years, 2 months ago) by rdm
Original Path: trunk/math/src/TMath.cxx
File length: 142610 byte(s)
Diff to previous 10539
white space corrections, tab removal and error message corrections.

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/src/TMath.cxx
File length: 141893 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/src/TMath.cxx
File length: 135078 byte(s)
Diff to previous 10429
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 10429 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Oct 29 16:07:32 2004 UTC (10 years, 2 months ago) by rdm
Original Path: trunk/math/src/TMath.cxx
File length: 133616 byte(s)
Diff to previous 10380
Mods for port to latest aCC on HP-UX 11.5i. Most changes are related
to aCC now being standards compliant (STL container in proper std
namespace, etc.).

Revision 10380 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Oct 21 14:44:02 2004 UTC (10 years, 3 months ago) by rdm
Original Path: trunk/math/src/TMath.cxx
File length: 133579 byte(s)
Diff to previous 10376
fix return value to not depend on just deleted space.

Revision 10376 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Oct 21 13:58:46 2004 UTC (10 years, 3 months ago) by rdm
Original Path: trunk/math/src/TMath.cxx
File length: 133545 byte(s)
Diff to previous 10164
"delete [] ind;" was never executed in KOrdStatImp().

Revision 10164 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Sep 24 18:14:08 2004 UTC (10 years, 4 months ago) by brun
Original Path: trunk/math/src/TMath.cxx
File length: 133532 byte(s)
Diff to previous 10067
Modify TMath::MedianImp when computing the medium of an array
with n elements where n>1000 and is an odd number.
The new algorithm gives exactly the same result as other known algorithms, but
it is slower in case n>1000 and even.

Revision 10067 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Sep 15 19:24:46 2004 UTC (10 years, 4 months ago) by brun
Original Path: trunk/math/src/TMath.cxx
File length: 133623 byte(s)
Diff to previous 9864
From Anna Kreshuk
Fix a bug in TMath::MedianImp

Revision 9864 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Sep 1 10:24:00 2004 UTC (10 years, 4 months ago) by brun
Original Path: trunk/math/src/TMath.cxx
File length: 133625 byte(s)
Diff to previous 9795
In TMath::GanSer, TMath::BetaCf and TMath::GamCf change teh relative precision
from 3e-7 to 3e-14

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/src/TMath.cxx
File length: 133622 byte(s)
Diff to previous 9755
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 9755 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Aug 13 16:41:16 2004 UTC (10 years, 5 months ago) by brun
Original Path: trunk/math/src/TMath.cxx
File length: 133505 byte(s)
Diff to previous 9739
From Philippe:
This patch re-enables the generation of the Html documentation
for TMath (and any other namespace) on sgi kcc.
NamespaceImp is still not useable on alpha and solaris.
On solaris this is due to a bug/problen in the compiler/linker
in the handling of inline function (there are __always__ local
symbol (instead of weak symbols)).

Revision 9739 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Aug 12 11:41:11 2004 UTC (10 years, 5 months ago) by rdm
Original Path: trunk/math/src/TMath.cxx
File length: 133526 byte(s)
Diff to previous 9723
reformatting of Anna's new code (indentation 3 instead of 2).

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/src/TMath.cxx
File length: 133386 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/src/TMath.cxx
File length: 130416 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/src/TMath.cxx
File length: 122934 byte(s)
Diff to previous 9646
remove code related to MacOS 9 this was never really supported and has
been obsoleted by full MacOS X support.

Revision 9646 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Sat Jul 31 16:26:17 2004 UTC (10 years, 5 months ago) by brun
Original Path: trunk/math/src/TMath.cxx
File length: 122945 byte(s)
Diff to previous 9644
Like for ALPHA, do not define the Namespaceimp for SOLARIS and SGI.
This prevents the generation of the html code for this class on these platforms.

Revision 9644 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Jul 30 23:46:34 2004 UTC (10 years, 5 months ago) by rdm
Original Path: trunk/math/src/TMath.cxx
File length: 122905 byte(s)
Diff to previous 9636
From Philippe:
This patch should work around the problem on alpha by
disabling the external call to TMath::ROOT::GenerateInitInstance
but this disable the ability to generate the doc on Alpha (for
TMath).

This patch also resolves several problem with nesting of
namespace and classes.

Note: To register an implementation file for a namespace do
   NamespaceImp(namespaceName)
To do so for nested namespace, do not use a fully qualified
name but use the proper nesting:
    namespace reallyout { namespace outer { NamespaceImp(inner) } }

In rootcint, this patch also prevent the (re)definition of the
compilers specific macros (like __GNUC) when we are using the
compiler's preprocessor.

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/src/TMath.cxx
File length: 122821 byte(s)
Diff to previous 9591
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 9591 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Sun Jul 25 16:19:59 2004 UTC (10 years, 6 months ago) by rdm
Original Path: trunk/math/src/TMath.cxx
File length: 122785 byte(s)
Diff to previous 9581
fixes in code layout.

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/src/TMath.cxx
File length: 122451 byte(s)
Diff to previous 9485
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 9485 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Jul 9 17:40:32 2004 UTC (10 years, 6 months ago) by brun
Original Path: trunk/math/src/TMath.cxx
File length: 120723 byte(s)
Diff to previous 9483
Fix a compilation error for Solaris

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/src/TMath.cxx
File length: 120717 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/src/TMath.cxx
File length: 106894 byte(s)
Diff to previous 9443
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 9443 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Jul 8 14:18:16 2004 UTC (10 years, 6 months ago) by brun
Original Path: trunk/math/src/TMath.cxx
File length: 106820 byte(s)
Diff to previous 9441
From Philippe:
This patch work around the deficiency of MSVC++ 6.0 template instantiation mechanism.

Revision 9441 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Jul 8 12:45:00 2004 UTC (10 years, 6 months ago) by brun
Original Path: trunk/math/src/TMath.cxx
File length: 106644 byte(s)
Diff to previous 9434
From Anna Kreshuk:
A simplified/faster version of TMath::Median functions.

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/src/TMath.cxx
File length: 107188 byte(s)
Diff to previous 9401
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 9401 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Jul 6 09:04:51 2004 UTC (10 years, 6 months ago) by rdm
Original Path: trunk/math/src/TMath.cxx
File length: 113949 byte(s)
Diff to previous 9400
use Info() and Error() instead of printf. Correct some formatting (identation
must be 3 and not 2).

Revision 9400 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Jul 6 08:34:38 2004 UTC (10 years, 6 months ago) by brun
Original Path: trunk/math/src/TMath.cxx
File length: 113299 byte(s)
Diff to previous 9398
Fix a bug in the new function TMath::Sort(Long64_t...
An internal variable was declared Long_t instead of Long64_t

Revision 9398 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Jul 6 07:28:29 2004 UTC (10 years, 6 months ago) by brun
Original Path: trunk/math/src/TMath.cxx
File length: 113297 byte(s)
Diff to previous 9396
In TMath::BetaCf increase the maximum number of iterations from 100 to 500.

Revision 9396 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Jul 6 07:10:46 2004 UTC (10 years, 6 months ago) by brun
Original Path: trunk/math/src/TMath.cxx
File length: 113281 byte(s)
Diff to previous 9394
In TMath::Betacf add a \n in a printf statement

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/src/TMath.cxx
File length: 113279 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/src/TMath.cxx
File length: 110453 byte(s)
Diff to previous 9256
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 9256 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Jun 18 21:13:05 2004 UTC (10 years, 7 months ago) by brun
Original Path: trunk/math/src/TMath.cxx
File length: 93673 byte(s)
Diff to previous 8733
One of the coefficients in TMath::BesselK0 was wrong (7.4e-5 instead of 7.4e-6)

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/src/TMath.cxx
File length: 93673 byte(s)
Diff to previous 8723
Functions TMath::Ceil and TMath::Floor are now inline functions

Revision 8723 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Apr 28 12:19:28 2004 UTC (10 years, 8 months ago) by brun
Original Path: trunk/math/src/TMath.cxx
File length: 93951 byte(s)
Diff to previous 8717
Change Abs() to TMath::Abs() in function hypot (KCC only)

Revision 8717 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Apr 28 08:06:08 2004 UTC (10 years, 8 months ago) by brun
Original Path: trunk/math/src/TMath.cxx
File length: 93937 byte(s)
Diff to previous 8686
Implement suggestions (and code) from Kevin Lynch <krlynch@bu.edu>
in the TMath functions "hypot", "ASinH","ACosH", "Normalize", "Poisson".

... the functions I've "fixed" are those
that are not internally protected against numerical overflow in
intermediate calculations, but whose final results should be
representable.
  ... I have tested all this suggested code, although not extensively.
In the regions where the current TMath functions are safe, these
replacements behave similarly;  they also work in regions where the
current functions fail, including the region where Ken Bloom reported
the problem, for instance:

root [2] TMath::Poisson(170,70)
Error: Symbol inf is not defined in current scope  FILE: LINE:0
(Double_t)inf
*** Interpreter error recovered ***
root [3] TMathnew::Poisson(170,70)
(Double_t)2.54255920378495108e-24
root [4] TMath::Poisson(10,5)
(Double_t)1.81327887078059496e-02
root [5] TMathnew::Poisson(10,5)
(Double_t)1.81327887078059427e-02

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/src/TMath.cxx
File length: 92662 byte(s)
Diff to previous 8683
Change the return type of TMath::Binomial from Int_t to Double_t.
As Int_t, it overflows for n>31

Revision 8683 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Sat Apr 24 16:48:03 2004 UTC (10 years, 9 months ago) by brun
Original Path: trunk/math/src/TMath.cxx
File length: 92672 byte(s)
Diff to previous 8682
Fix typo

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/src/TMath.cxx
File length: 92681 byte(s)
Diff to previous 8679
From Federico Carminati:
Change calling API for TMath::Permute(Int_t, Int_t *a)
Add new function TMath::Binomial
see comments in functions

Revision 8679 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Sat Apr 24 05:59:20 2004 UTC (10 years, 9 months ago) by brun
Original Path: trunk/math/src/TMath.cxx
File length: 92583 byte(s)
Diff to previous 8678
Fix a problem in TMath::Permute in the C++ code initializing the array

Revision 8678 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Apr 23 20:29:53 2004 UTC (10 years, 9 months ago) by rdm
Original Path: trunk/math/src/TMath.cxx
File length: 92585 byte(s)
Diff to previous 8674
white space, remove of tabs, punctiation of comments.

Revision 8674 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Apr 23 16:18:15 2004 UTC (10 years, 9 months ago) by brun
Original Path: trunk/math/src/TMath.cxx
File length: 90976 byte(s)
Diff to previous 8671
One more fix for the redefinition of the loop index i

Revision 8671 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Apr 23 12:21:56 2004 UTC (10 years, 9 months ago) by brun
Original Path: trunk/math/src/TMath.cxx
File length: 90988 byte(s)
Diff to previous 8669
Fix a portability problem in TMath::Permute (redefinition of a loop index)

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/src/TMath.cxx
File length: 90998 byte(s)
Diff to previous 8383
New function TMath::Permute by Federico Carminati
see doc in function

Revision 8383 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Mar 12 15:42:38 2004 UTC (10 years, 10 months ago) by brun
Original Path: trunk/math/src/TMath.cxx
File length: 89654 byte(s)
Diff to previous 8139
Fix a bug in TMath::RootCubic

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/src/TMath.cxx
File length: 89656 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/src/TMath.cxx
File length: 87953 byte(s)
Diff to previous 7742
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 7742 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Dec 12 16:33:56 2003 UTC (11 years, 1 month ago) by brun
Original Path: trunk/math/src/TMath.cxx
File length: 83754 byte(s)
Diff to previous 7730
The function TMath::BesselI(n,0) is not defined for n>=2
although it should simply be 0.
Thanks Isabelle Bouchoule

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/src/TMath.cxx
File length: 83729 byte(s)
Diff to previous 7458
Add a new function TMath::PoissonI returning the true non-smooth Poisson distribution.
Add comments in TMath::Poisson. Add Pictures to the doc.

Revision 7458 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Oct 23 09:38:00 2003 UTC (11 years, 3 months ago) by brun
Original Path: trunk/math/src/TMath.cxx
File length: 82718 byte(s)
Diff to previous 7147
Modify the order of the tests on x>0 in TMath::Poisson

Revision 7147 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Sat Aug 23 00:08:13 2003 UTC (11 years, 5 months ago) by rdm
Original Path: trunk/math/src/TMath.cxx
File length: 82718 byte(s)
Diff to previous 7137
revert most cast issues reported by buggy gcc 3.4 snapshot of this week.
Checked with gcc 3.4 from cvs of today which does not report any
problems anymore.

Revision 7137 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Aug 22 12:43:58 2003 UTC (11 years, 5 months ago) by brun
Original Path: trunk/math/src/TMath.cxx
File length: 82730 byte(s)
Diff to previous 7010
Fix in TMath::Normalize to avoid a warning with gcc3.4. Explicit cast
required when calling TMath::Sqrt

Revision 7010 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Sun Jul 27 15:36:28 2003 UTC (11 years, 6 months ago) by brun
Original Path: trunk/math/src/TMath.cxx
File length: 82718 byte(s)
Diff to previous 6822
TMath::KolmogorovProv has been rewritten to be in phase with the latest
version of PROBKL in CERNLIB.

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/src/TMath.cxx
File length: 82796 byte(s)
Diff to previous 6719
Add an optional argument to TMath::Gaus to normalize the result to sqrt(2*pi)*sigma

Revision 6719 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Jun 13 15:57:46 2003 UTC (11 years, 7 months ago) by brun
Original Path: trunk/math/src/TMath.cxx
File length: 82592 byte(s)
Diff to previous 6568
Implement a suggestion from Sylwester Radomski in TMath::Poisson
The function TMath::Poisson(x, par) do not return correct value
for x = 0.

In the code of TMath it is: if (x<=0) return 0;
For x=0 the function shall return exp(-par).

Revision 6568 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed May 7 16:25:29 2003 UTC (11 years, 8 months ago) by brun
Original Path: trunk/math/src/TMath.cxx
File length: 82499 byte(s)
Diff to previous 6566
Fix another problem in TMath::BesselI (thanks Peter Steinberg),
1. if (TMath::Abs(x) < kBigPositive) return 0;
2.  for (Int_t j=m; j<=1; j--) {

in both cases, the "<" should be ">".

Revision 6566 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed May 7 16:07:35 2003 UTC (11 years, 8 months ago) by brun
Original Path: trunk/math/src/TMath.cxx
File length: 82499 byte(s)
Diff to previous 6322
Fix a bug in TMath::BesselI (kBigPositive was used instead of kBigNegative)
(thanks to Peter Steinberg)

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/src/TMath.cxx
File length: 82499 byte(s)
Diff to previous 6066
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 6066 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Feb 6 21:44:49 2003 UTC (11 years, 11 months ago) by brun
Original Path: trunk/math/src/TMath.cxx
File length: 81038 byte(s)
Diff to previous 5998
Remove references to numerical recipee and code twisting.

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/src/TMath.cxx
File length: 81479 byte(s)
Diff to previous 5986
Add the Poisson distribution function
   static Double_t  Poisson(Double_t x, Double_t par);

Revision 5986 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Sun Jan 26 13:21:24 2003 UTC (12 years ago) by brun
Original Path: trunk/math/src/TMath.cxx
File length: 81056 byte(s)
Diff to previous 5683
In the Locmin and Locmax functions, start loop at element 1 instead of 0.

Revision 5683 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Nov 27 15:24:04 2002 UTC (12 years, 1 month ago) by rdm
Original Path: trunk/math/src/TMath.cxx
File length: 81057 byte(s)
Diff to previous 5455
remove warning of possibly used variable which was not intialized.

Revision 5455 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Oct 22 08:19:29 2002 UTC (12 years, 3 months ago) by brun
Original Path: trunk/math/src/TMath.cxx
File length: 81072 byte(s)
Diff to previous 5412
Add remarks in the doc of TMath::isInside

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/src/TMath.cxx
File length: 80778 byte(s)
Diff to previous 5142
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 5142 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Sat Aug 17 18:42:27 2002 UTC (12 years, 5 months ago) by brun
Original Path: trunk/math/src/TMath.cxx
File length: 78797 byte(s)
Diff to previous 5138
Add some protections in TMath::Voigt

Revision 5138 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Aug 16 20:03:16 2002 UTC (12 years, 5 months ago) by brun
Original Path: trunk/math/src/TMath.cxx
File length: 78494 byte(s)
Diff to previous 5137
Minor change in Voigt to get one reference as a html link

Revision 5137 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Aug 16 19:50:23 2002 UTC (12 years, 5 months ago) by brun
Original Path: trunk/math/src/TMath.cxx
File length: 78452 byte(s)
Diff to previous 5131
Add a new reference to TMath::Voigt

Revision 5131 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Aug 16 13:48:28 2002 UTC (12 years, 5 months ago) by brun
Original Path: trunk/math/src/TMath.cxx
File length: 78347 byte(s)
Diff to previous 5130
Fix compiler warnings in new function TMath::Voigt

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/src/TMath.cxx
File length: 78307 byte(s)
Diff to previous 4805
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 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/src/TMath.cxx
File length: 71839 byte(s)
Diff to previous 4623
Add function
  Double_t TMath::Factorial(Int_t n)

Revision 4623 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu May 30 21:06:56 2002 UTC (12 years, 7 months ago) by rdm
Original Path: trunk/math/src/TMath.cxx
File length: 71576 byte(s)
Diff to previous 4619
Change by Mathieu in Hash() was not correct. Use union to fix problem.

Revision 4619 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu May 30 15:56:29 2002 UTC (12 years, 7 months ago) by brun
Original Path: trunk/math/src/TMath.cxx
File length: 71088 byte(s)
Diff to previous 4269
Fix by  Mathieu de Naurois in TMath::Hash.
gcc3.1 does not like to interpret the address of a long as the address
of an array of shorts. Generates a core dump.

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/src/TMath.cxx
File length: 71036 byte(s)
Diff to previous 4017
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 4017 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Feb 18 18:09:30 2002 UTC (12 years, 11 months ago) by brun
Original Path: trunk/math/src/TMath.cxx
File length: 70735 byte(s)
Diff to previous 4014
Fix portability problems in new BubbleSort functions

Revision 4014 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Feb 18 10:19:12 2002 UTC (12 years, 11 months ago) by brun
Original Path: trunk/math/src/TMath.cxx
File length: 70538 byte(s)
Diff to previous 4011
Remove compiler Warnings in new functions BubbleHigh/Low

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/src/TMath.cxx
File length: 70554 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/src/TMath.cxx
File length: 68273 byte(s)
Diff to previous 3743
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 3743 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Jan 23 22:48:07 2002 UTC (13 years ago) by brun
Original Path: trunk/math/src/TMath.cxx
File length: 58954 byte(s)
Diff to previous 3703
Fix a precision problem in TMath::Prob.
The Gaussian approximation cannot be used for values of the q parameter
less than 5. One must use the Gamma function instead.

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/src/TMath.cxx
File length: 58955 byte(s)
Diff to previous 3416
port to HP-UX 11i version 1.5 (IA-64) with the aCC compiler.

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/src/TMath.cxx
File length: 58978 byte(s)
Diff to previous 3287
Make the array arguments const in functions LocMin, LocMax, BinarySearch
and Sort.
Add new signatures with Long_t

Revision 3287 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Nov 26 13:33:35 2001 UTC (13 years, 2 months ago) by brun
Original Path: trunk/math/src/TMath.cxx
File length: 54678 byte(s)
Diff to previous 2449
Fix a typo in comments of TMath::Erfc

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/src/TMath.cxx
File length: 54677 byte(s)
Diff to previous 2017
Add TMath::Freq(x) computing the normal frequency function

Revision 2017 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Apr 20 07:29:46 2001 UTC (13 years, 9 months ago) by brun
Original Path: trunk/math/src/TMath.cxx
File length: 51785 byte(s)
Diff to previous 2016
Replave variable name "mean" by "mpv" in the Landau functions.

Revision 2016 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Apr 20 06:17:51 2001 UTC (13 years, 9 months ago) by brun
Original Path: trunk/math/src/TMath.cxx
File length: 51785 byte(s)
Diff to previous 1760
In the Landau functions, change the name of the argument "mean"
to "mpv" (most probable value).

Revision 1760 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Mar 7 16:49:17 2001 UTC (13 years, 10 months ago) by rdm
Original Path: trunk/math/src/TMath.cxx
File length: 51766 byte(s)
Diff to previous 1096
new Hash function by V.Perev. It has the following qualities:
Based on precalculated table of 256 specially selected numbers.
These numbers are selected in such a way, that for string
length == 4 (integer number) the hash is unambigous, i.e.
from hash value we can recalculate input (no degeneration).
The quality of hash method is good enough, that
"random" numbers made as R = Hash(1), Hash(2), ...Hash(N)
tested by <R>, <R*R>, <Ri*Ri+1> gives the same result
as for libc rand().

Revision 1096 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Nov 30 10:52:13 2000 UTC (14 years, 1 month ago) by rdm
Original Path: trunk/math/src/TMath.cxx
File length: 47235 byte(s)
Diff to previous 669
added proper comment for Nint() method.

Revision 669 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Sep 27 09:19:39 2000 UTC (14 years, 3 months ago) by rdm
Original Path: trunk/math/src/TMath.cxx
File length: 47057 byte(s)
Diff to previous 303
fix in Hash(). String length was erroneously taken to be modulo 255.

Revision 303 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Jun 30 09:02:57 2000 UTC (14 years, 6 months ago) by rdm
Original Path: trunk/math/src/TMath.cxx
File length: 47060 byte(s)
Diff to previous 302
updated spec of NextPrime(): return next prime, unless input is a prime in
which case the input is returned.

Revision 302 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Jun 30 07:24:54 2000 UTC (14 years, 6 months ago) by brun
Original Path: trunk/math/src/TMath.cxx
File length: 47021 byte(s)
Diff to previous 301
Fix a bug in TMath::NextPrime reported by David Faden
TMath::NextPrime(Long_t) doesn't return the next prime when its argument
happens to be prime (excluding two) - instead it returns its argument. As well,

TMath::NextPrime(x) returns three for x less than two and TMath::NextPrime(3)
doesn't check for the prime number following three but returns three directly.

Revision 301 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Jun 30 06:53:18 2000 UTC (14 years, 6 months ago) by brun
Original Path: trunk/math/src/TMath.cxx
File length: 46966 byte(s)
Diff to previous 292
Document the new function TMath::KolmogorovProb

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/src/TMath.cxx
File length: 46155 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/src/TMath.cxx
File length: 44708 byte(s)
Copied from: branches/unlabeled-1.1.1/math/src/TMath.cxx 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/src/TMath.cxx
File length: 44708 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