Log of /trunk/math/mathcore/src/TRandom.cxx
Parent Directory
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
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
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
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
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
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
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
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
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
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.
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.