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

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

Parent Directory Parent Directory


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

Revision 49217 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Apr 11 09:57:14 2013 UTC (21 months, 1 week ago) by moneta
File length: 22202 byte(s)
Diff to previous 48161
update documentation for TRandom, The interval of the generated numbers in Rndm() is (0,1) and NOT (0,1]

Revision 48161 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Dec 20 15:40:23 2012 UTC (2 years, 1 month ago) by moneta
File length: 22130 byte(s)
Diff to previous 46270
fix seeding for seed = 0 (random seed from TUUID)

 Use TUUID to generate 3 unique seeds for TRandom2.
TRandom2 os then used for generating random states for both TRandom1 and TRandom3

TRandom is now initialized using the lowest 4 bytes of TUUID

This fixes the bug reported in https://savannah.cern.ch/bugs/?99516
All the 4 generators now pased the test reported by  Chris (see bug report)

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: 22232 byte(s)
Diff to previous 43094
Update comments in TMath::Landau and TRandom::Landau

Revision 43094 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Feb 22 15:24:51 2012 UTC (2 years, 11 months ago) by rdm
File length: 21896 byte(s)
Diff to previous 41891
updated layout of comments.

Revision 41891 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Nov 10 22:46:31 2011 UTC (3 years, 2 months ago) by pcanal
File length: 21996 byte(s)
Diff to previous 33362
Remove all assigned but unused variable discovered by g++ 4.6.1 (including one completely nop function)

Revision 33362 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue May 4 08:00:22 2010 UTC (4 years, 8 months ago) by moneta
File length: 22127 byte(s)
Diff to previous 32526
update TRandom::Landau to use now landau_quantile function

Revision 32526 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Mar 10 14:56:13 2010 UTC (4 years, 10 months ago) by moneta
File length: 33811 byte(s)
Diff to previous 27138
- use in TRandom::SetSeed a default argument = 0. 
  In this way we have the same default argument used in the derived classes ( TRandom2 and TRandom3)

  This fixes probelm reported in https://savannah.cern.ch/bugs/?64117 
  i.e. a different behaviour observed when running interpreted code compared to compiled code.

Revision 27138 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Jan 14 15:22:59 2009 UTC (6 years ago) by moneta
File length: 33427 byte(s)
Diff to previous 22885
- use Rndm() instead of Uniform() in the implementation of TRandom::Exp. 
  This has been suggested in https://savannah.cern.ch/bugs/?45873 and gives a gain in performances of a few %. 
- update also the testrandom.C macro to include the test on TRandom::Exp 
- update reference results using what obtained on lxbuild114 (Intel Quad-Core 2.33 Ghz)

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

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/TRandom.cxx
File length: 33350 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/TRandom.cxx
File length: 33350 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/TRandom.cxx
File length: 33400 byte(s)
Diff to previous 19810
remove :$ from tag line

Revision 19810 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Sep 18 07:42:50 2007 UTC (7 years, 4 months ago) by brun
Original Path: trunk/math/src/TRandom.cxx
File length: 33410 byte(s)
Diff to previous 18271
TRandom::ReadRandom and TRandom::WriteRandom were broken since the I/O reorganisation.

Revision 18271 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Mar 14 18:41:58 2007 UTC (7 years, 10 months ago) by brun
Original Path: trunk/math/src/TRandom.cxx
File length: 33338 byte(s)
Diff to previous 17818
From Lorenzo:

new implementation of TRandom::Gaus using the Acceptance-complement ratio
method from Hoermann-Derflinger. The new algorithm is probably the fastest
currently existing and it is a factor 2/3 faster than the previous
polar method.
The implementation comes from the UNURAN package of W.Hoermann & J. Leydold,
Institut f. Statistik, WU Wien.

The documentation in the TRandom class has been as well updated.

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/TRandom.cxx
File length: 31697 byte(s)
Diff to previous 17553
correct cvs ident line (base -> math).

Revision 17553 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Jan 29 10:06:51 2007 UTC (7 years, 11 months ago) by brun
Original Path: trunk/math/src/TRandom.cxx
File length: 31762 byte(s)
Diff to previous 17541
Add explicit inclusion of "TClass.h" in view of a future removal of TClass.h
from TQObject.h.

Revision 17541 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Sun Jan 28 18:29:53 2007 UTC (7 years, 11 months ago) by brun
Original Path: trunk/math/src/TRandom.cxx
File length: 31738 byte(s)
Diff to previous 17532
-Replace the calls to TVirtualIO by new calls in TBuffer or TDirectory

Revision 17532 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Jan 26 15:40:38 2007 UTC (7 years, 11 months ago) by brun
Original Path: trunk/math/src/TRandom.cxx
File length: 31646 byte(s)
Diff to previous 17503
The functions TRandom::ReadRandom and TRandom::WriteRandom invoke now the
new functions TDirectory::ReadTObject and TDirectory::WriteTObject.

Revision 17503 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Jan 25 11:48:39 2007 UTC (8 years ago) by brun
Original Path: trunk/math/src/TRandom.cxx
File length: 31662 byte(s)
Diff to previous 17146
Replace the direct dependencies on TFile and TObject::Write by
the new functions Open, ReadObject and WriteObject from TVirtualIO.

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/TRandom.cxx
File length: 31545 byte(s)
Diff to previous 15189
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 15189 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Sun May 28 06:15:54 2006 UTC (8 years, 7 months ago) by brun
Original Path: trunk/math/src/TRandom.cxx
File length: 31544 byte(s)
Diff to previous 15185
Fix coding conventions violations

Revision 15185 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri May 26 16:38:56 2006 UTC (8 years, 8 months ago) by brun
Original Path: trunk/math/src/TRandom.cxx
File length: 31516 byte(s)
Diff to previous 15184
From Lorenzo,

Change array f[892]  from Double_t to const Double_t.
This makes the function much faster.

Revision 15184 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri May 26 16:30:46 2006 UTC (8 years, 8 months ago) by brun
Original Path: trunk/math/src/TRandom.cxx
File length: 31510 byte(s)
Diff to previous 15176
From Lorenzo:
One can improve the TRandom::SPhere algorithm. What is there
now, it is from the cernlib and it is more inefficient than the algorithm
suggested by Knuth and used also by GSL.
Here is the patch for the new algorithm which require less calls to Rndm()

Revision 15176 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri May 26 09:27:12 2006 UTC (8 years, 8 months ago) by brun
Original Path: trunk/math/src/TRandom.cxx
File length: 31733 byte(s)
Diff to previous 15170
Fix coding conventions violations

Revision 15170 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed May 24 15:34:51 2006 UTC (8 years, 8 months ago) by brun
Original Path: trunk/math/src/TRandom.cxx
File length: 31634 byte(s)
Diff to previous 15145
From Lorenzo:
new algorithm for Poisson variate , which is correct (no approximation) up to all unsigned int values (2 10**9)

Revision 15145 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue May 23 10:12:17 2006 UTC (8 years, 8 months ago) by brun
Original Path: trunk/math/src/TRandom.cxx
File length: 30111 byte(s)
Diff to previous 15095
From Lorenzo:
Added comments in the class description to show the timings/pros/cons
of all TRandomXX generators

Revision 15095 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu May 18 09:37:04 2006 UTC (8 years, 8 months ago) by brun
Original Path: trunk/math/src/TRandom.cxx
File length: 29233 byte(s)
Diff to previous 15093
Exclude 0 as a return value from Trandom, TRandom1 and TRandom2

Revision 15093 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu May 18 08:04:25 2006 UTC (8 years, 8 months ago) by brun
Original Path: trunk/math/src/TRandom.cxx
File length: 28915 byte(s)
Diff to previous 15084
Fix coding conventions violations

Revision 15084 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed May 17 17:32:40 2006 UTC (8 years, 8 months ago) by brun
Original Path: trunk/math/src/TRandom.cxx
File length: 28956 byte(s)
Diff to previous 14932
New version of TRandom and TRandom2. More doc coming later.

Revision 14932 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Sat May 6 08:25:15 2006 UTC (8 years, 8 months ago) by brun
Original Path: trunk/math/src/TRandom.cxx
File length: 28610 byte(s)
Diff to previous 13258
Implement new function TRandom::Circle

void TRandom::Circle(Double_t &x, Double_t &y, Double_t r)
   // generates random vectors, uniformly distributed over a circle of given radius.
   //   Input : r = circle radius
   //   Output: x,y a random 2-d vector of length r

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/TRandom.cxx
File length: 28206 byte(s)
Diff to previous 12584
White spaces and comments update

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/TRandom.cxx
File length: 28185 byte(s)
Diff to previous 12538
Fix the remaining problems reported by the rule checker in directory base

Revision 12538 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Aug 25 17:07:30 2005 UTC (9 years, 5 months ago) by brun
Original Path: trunk/math/src/TRandom.cxx
File length: 28189 byte(s)
Diff to previous 10997
In TRandom::Sphere call directly Rndm() instead of gRandom->Rndm()

Revision 10997 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Jan 27 20:14:09 2005 UTC (9 years, 11 months ago) by brun
Original Path: trunk/math/src/TRandom.cxx
File length: 28216 byte(s)
Diff to previous 9149
Fix a wrong comment in TRandom::BreitWigner

Revision 9149 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Jun 9 06:46:30 2004 UTC (10 years, 7 months ago) by brun
Original Path: trunk/math/src/TRandom.cxx
File length: 28196 byte(s)
Diff to previous 7632
Add new random generator function:
void TRandom::Sphere(Double_t &x, Double_t &y, Double_t &z, Double_t xlong)
   // generates random vectors, uniformly distributed over the surface
   // of a sphere of given radius.

Revision 7632 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Sun Nov 23 16:13:08 2003 UTC (11 years, 2 months ago) by brun
Original Path: trunk/math/src/TRandom.cxx
File length: 27154 byte(s)
Diff to previous 6074
Add a new function in TRandom returning a random number following
a Breit-Wigner distribution
  Double_t TRandom::BreitWigner(Double_t mean=0, Double_t gamma=1)

Revision 6074 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Sun Feb 9 08:55:33 2003 UTC (11 years, 11 months ago) by brun
Original Path: trunk/math/src/TRandom.cxx
File length: 26809 byte(s)
Diff to previous 5990
Do not mask to 31 bits in Rndm, RndmArray.

Revision 5990 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Jan 27 10:28:12 2003 UTC (11 years, 11 months ago) by brun
Original Path: trunk/math/src/TRandom.cxx
File length: 27135 byte(s)
Diff to previous 5989
Minor optimisation in RndmArray

Revision 5989 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Sun Jan 26 21:03:16 2003 UTC (11 years, 11 months ago) by brun
Original Path: trunk/math/src/TRandom.cxx
File length: 27129 byte(s)
Diff to previous 5605
In TRandom add new function:
   virtual  void     RndmArray(Int_t n, Float_t *array);

In TRandom2 and TRandom3, add the functions:
   virtual  void     RndmArray(Int_t n, Float_t *array);
   virtual  void     RndmArray(Int_t n, Double_t *array);

Revision 5605 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Sun Nov 17 17:04:36 2002 UTC (12 years, 2 months ago) by brun
Original Path: trunk/math/src/TRandom.cxx
File length: 26125 byte(s)
Diff to previous 5494
Modify the Rndm function in the generator classes such that they never
return 0.
Remove the test on 0 from several functions in TRandom.

Revision 5494 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Oct 25 12:41:46 2002 UTC (12 years, 3 months ago) by brun
Original Path: trunk/math/src/TRandom.cxx
File length: 26369 byte(s)
Diff to previous 4932
TRandom::Rndm optimized by Sverre Jarp

Revision 4932 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Jul 16 13:09:15 2002 UTC (12 years, 6 months ago) by brun
Original Path: trunk/math/src/TRandom.cxx
File length: 26359 byte(s)
Diff to previous 4917
Replace constant 6.283185 by 6.28318530717958623

Revision 4917 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Jul 15 15:23:31 2002 UTC (12 years, 6 months ago) by brun
Original Path: trunk/math/src/TRandom.cxx
File length: 26326 byte(s)
Diff to previous 4472
Modify TRandom::Rannor (case with Float_t.
The return values a and b must be casted to Float_t (alpha)

Revision 4472 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue May 7 06:38:20 2002 UTC (12 years, 8 months ago) by brun
Original Path: trunk/math/src/TRandom.cxx
File length: 26303 byte(s)
Diff to previous 4260
Add a new function:
  Double_t TRandom::PoissonD(Double_t mean).
This function is like Poisson but returns a Double_t instead of Int_t.

Revision 4260 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Mar 28 09:22:36 2002 UTC (12 years, 10 months ago) by brun
Original Path: trunk/math/src/TRandom.cxx
File length: 25572 byte(s)
Diff to previous 2697
Add the following new functions:

void TRandom::RndmArray(Int_t n, Double_t *array)
  // Return an array of n random numbers uniformly distributed
  // between 0 and 1 not included

Double_t TRandom::Uniform(Double_t x1, Double_t x2)
// returns a uniform deviate on the interval ( x1, x2 ].

void TRandom::ReadRandom(const char *filename)
  // Reads saved random generator status from filename

void TRandom::WriteRandom(const char *filename)
  // Writes random generator status to filename

Note that since TRandom is teh base class for all random number classes,
the new function may be used with TRandom, TRandom2 and TRandom3.

Revision 2697 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Aug 17 07:27:43 2001 UTC (13 years, 5 months ago) by brun
Original Path: trunk/math/src/TRandom.cxx
File length: 24206 byte(s)
Diff to previous 2017
In TRandom destructor, set gRandom=0 if gRandom is the object being deleted.

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/TRandom.cxx
File length: 24172 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/TRandom.cxx
File length: 24173 byte(s)
Diff to previous 1006
In the Landau functions, change the name of the argument "mean"
to "mpv" (most probable value).

Revision 1006 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Nov 22 08:35:44 2000 UTC (14 years, 2 months ago) by brun
Original Path: trunk/math/src/TRandom.cxx
File length: 24167 byte(s)
Diff to previous 672
Use double precision in return types and all arguments
of the random number generator classes. The modified prototypes are:
   virtual  Int_t    Binomial(Int_t ntot, Double_t prob);
   virtual  Double_t Gaus(Double_t mean=0, Double_t sigma=1);
   virtual  Double_t Landau(Double_t mean=0, Double_t sigma=1);
   virtual  Int_t    Poisson(Double_t mean);
   virtual  void     Rannor(Float_t &a, Float_t &b);
   virtual  void     Rannor(Double_t &a, Double_t &b);
   virtual  Double_t Rndm(Int_t i=0);
   virtual  Double_t Uniform(Double_t x1=1);

 Note that in case of Rannor, two functions are provided, one with
float and one with double for back compatibility.

Revision 672 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Sep 29 07:12:43 2000 UTC (14 years, 3 months ago) by brun
Original Path: trunk/math/src/TRandom.cxx
File length: 23712 byte(s)
Diff to previous 272
Add a protection in Rannor and Gaus function when random = 0

Revision 272 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Jun 23 15:15:42 2000 UTC (14 years, 7 months ago) by brun
Original Path: trunk/math/src/TRandom.cxx
File length: 23704 byte(s)
Diff to previous 43
Fix a bug in TRandom::Binomial

Revision 43 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu May 25 06:35:32 2000 UTC (14 years, 8 months ago) by brun
Original Path: trunk/math/src/TRandom.cxx
File length: 23704 byte(s)
Diff to previous 3
Add a warning/comment in SetSeed about seed=0

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