Commit 1d12937a authored by Lynn Garren's avatar Lynn Garren
Browse files

merging changes from 2.0.5.0.b01

parent e704a7cc
This diff is collapsed.
GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
This version of the GNU Lesser General Public License incorporates
the terms and conditions of version 3 of the GNU General Public
License, supplemented by the additional permissions listed below.
0. Additional Definitions.
As used herein, "this License" refers to version 3 of the GNU Lesser
General Public License, and the "GNU GPL" refers to version 3 of the GNU
General Public License.
"The Library" refers to a covered work governed by this License,
other than an Application or a Combined Work as defined below.
An "Application" is any work that makes use of an interface provided
by the Library, but which is not otherwise based on the Library.
Defining a subclass of a class defined by the Library is deemed a mode
of using an interface provided by the Library.
A "Combined Work" is a work produced by combining or linking an
Application with the Library. The particular version of the Library
with which the Combined Work was made is also called the "Linked
Version".
The "Minimal Corresponding Source" for a Combined Work means the
Corresponding Source for the Combined Work, excluding any source code
for portions of the Combined Work that, considered in isolation, are
based on the Application, and not on the Linked Version.
The "Corresponding Application Code" for a Combined Work means the
object code and/or source code for the Application, including any data
and utility programs needed for reproducing the Combined Work from the
Application, but excluding the System Libraries of the Combined Work.
1. Exception to Section 3 of the GNU GPL.
You may convey a covered work under sections 3 and 4 of this License
without being bound by section 3 of the GNU GPL.
2. Conveying Modified Versions.
If you modify a copy of the Library, and, in your modifications, a
facility refers to a function or data to be supplied by an Application
that uses the facility (other than as an argument passed when the
facility is invoked), then you may convey a copy of the modified
version:
a) under this License, provided that you make a good faith effort to
ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs
whatever part of its purpose remains meaningful, or
b) under the GNU GPL, with none of the additional permissions of
this License applicable to that copy.
3. Object Code Incorporating Material from Library Header Files.
The object code form of an Application may incorporate material from
a header file that is part of the Library. You may convey such object
code under terms of your choice, provided that, if the incorporated
material is not limited to numerical parameters, data structure
layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following:
a) Give prominent notice with each copy of the object code that the
Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the object code with a copy of the GNU GPL and this license
document.
4. Combined Works.
You may convey a Combined Work under terms of your choice that,
taken together, effectively do not restrict modification of the
portions of the Library contained in the Combined Work and reverse
engineering for debugging such modifications, if you also do each of
the following:
a) Give prominent notice with each copy of the Combined Work that
the Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the Combined Work with a copy of the GNU GPL and this license
document.
c) For a Combined Work that displays copyright notices during
execution, include the copyright notice for the Library among
these notices, as well as a reference directing the user to the
copies of the GNU GPL and this license document.
d) Do one of the following:
0) Convey the Minimal Corresponding Source under the terms of this
License, and the Corresponding Application Code in a form
suitable for, and under terms that permit, the user to
recombine or relink the Application with a modified version of
the Linked Version to produce a modified Combined Work, in the
manner specified by section 6 of the GNU GPL for conveying
Corresponding Source.
1) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (a) uses at run time
a copy of the Library already present on the user's computer
system, and (b) will operate properly with a modified version
of the Library that is interface-compatible with the Linked
Version.
e) Provide Installation Information, but only if you would otherwise
be required to provide such information under section 6 of the
GNU GPL, and only to the extent that such information is
necessary to install and execute a modified version of the
Combined Work produced by recombining or relinking the
Application with a modified version of the Linked Version. (If
you use option 4d0, the Installation Information must accompany
the Minimal Corresponding Source and Corresponding Application
Code. If you use option 4d1, you must provide the Installation
Information in the manner specified by section 6 of the GNU GPL
for conveying Corresponding Source.)
5. Combined Libraries.
You may place library facilities that are a work based on the
Library side by side in a single library together with other library
facilities that are not Applications and are not covered by this
License, and convey such a combined library under terms of your
choice, if you do both of the following:
a) Accompany the combined library with a copy of the same work based
on the Library, uncombined with any other library facilities,
conveyed under the terms of this License.
b) Give prominent notice with the combined library that part of it
is a work based on the Library, and explaining where to find the
accompanying uncombined form of the same work.
6. Revised Versions of the GNU Lesser General Public License.
The Free Software Foundation may publish revised and/or new versions
of the GNU Lesser General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the
Library as you received it specifies that a certain numbered version
of the GNU Lesser General Public License "or any later version"
applies to it, you have the option of following the terms and
conditions either of that published version or of any later version
published by the Free Software Foundation. If the Library as you
received it does not specify a version number of the GNU Lesser
General Public License, you may choose any version of the GNU Lesser
General Public License ever published by the Free Software Foundation.
If the Library as you received it specifies that a proxy can decide
whether future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is
permanent authorization for you to choose that version for the
Library.
==============================
11.06.10 Release CLHEP-2.0.5.0.b01
==============================
2010-04-29 Walter Brown <wb@fnal.gov>
* DRand48Engine: use CLHEP/Utility/noncopyable.h
* RandBinomial, RandBreitWigner, RandChiSquare,
RandExponential, RandFlat, RandGamma, RandGauss,
RandGeneral, RandLandau, RandPoisson, RandStudentT:
use shared pointer from CLHEP/Utility/memory.h
* Random.h: no longer need deleteEngine
* test/testDistCopy: test copy constructors
(note that all copy constructors are now compiler generated)
2010-03-04 Walter Brown <wb@fnal.gov>
* DualRand, Hurd160Engine, Hurd288Engine, JamesRandom,
MTwistEngine, RandEngine, RanecuEngine, RanluxEngine,
Ranlux64Engine, RanshiEngine, TripleRand:
Let the compiler generate the copy constructors. Use the new
static functions. Also define static const int's as relevant.
This produces code which is both more efficient and more compact.
* RandomEngine: move static variables here and make them
static functions. This streamlines the code.
Affected variables are exponent_bit_32, mantissa_bit_12,
mantissa_bit_24, mantissa_bit_32, twoToMinus_32,
twoToMinus_48, twoToMinus_49, twoToMinus_53, and
nearlyTwoToMinus_54.
2010-03-04 Mark Fischler <mf@fnal.gov>
* test/testEngineCopy.cc: test copy constructors and operator =
==============================
09.03.10 Release CLHEP-2.0.4.6
==============================
2010-03-08 Mark Fischler <mf@fnal.gov> and Lynn Garren <garren@fnal.gov>
* src/RandEngine.cc: Cast RAND_MAX to unsigned long to avoid
gcc 4.4 warnings.
* src/RanecuEngine.cc: Fix a bug introduced in 2.0.4.5/1.9.4.5
which resulted in the inability to rollback the random state.
* test/testBug58950: test rolling back the random state
==============================
08.12.09 Release CLHEP-2.0.4.5
==============================
2009-12-07 Lynn Garren <garren@fnal.gov>
* test/testBug58950.cc: test for the 64bit bug
2009-12-01 Mark Fischler <mf@fnal.gov> and Lynn Garren <garren@fnal.gov>
* src/RanecuEngine.cc: Negative seeds are not allowed. In the past,
negative seeds were ignored, resulting in a reproducable sequence.
Instead, we now use the absolute value of any negative seeds.
2009-12-01 Mark Fischler <mf@fnal.gov> and Lynn Garren <garren@fnal.gov>
* Random/RanecuEngine.h, src/RanecuEngine.cc: define maxSeq
as a static const int since it contains the size of an array
* src/RanecuEngine.cc: ensure that all seeds are in the expected 32bit range.
==============================
12.11.09 Release CLHEP-2.0.4.4
==============================
==============================
03.11.09 Release CLHEP-2.0.4.4.b01
==============================
==============================
04.07.09 Release CLHEP-2.0.4.3
==============================
2009-06-30 Mark Fischler <mf@fnal.gov>
* src/Ranlux64Engine.cc: Fix bug #24689. setSeeds() now
uses all seeds passed to it instead of only the first one.
==============================
18.11.08 Release CLHEP-2.0.4.2
==============================
2008-11-18 Lynn Garren <garren@fnal.gov>
* test/testVectorSave.cc: Add a test for bug #44156
2008-11-13 Mark Fischler <mf@fnal.gov>
* src/engineIDulong.cc: Fix problem that caused check for proper
engine type to fail where an unsigned long is 64bits. (bug #44156)
* src/*Engine.cc: make sure that existing stored engine states
don't break due to the change in engineIDulong.cc
==============================
04.11.08 Release CLHEP-2.0.4.1
==============================
==============================
07.08.08 Release CLHEP-2.0.4.0
==============================
2008-07-17 Lynn Garren <garren@fnal.gov>
* add explicit parentheses in various places to keep gcc 4.3 happy
* src/RandEngine.cc: change how the compiler decides how to implement flat()
* test/testRandDists.cc: force variables to be in memory so
testRandGeneral() behaves the same with both gcc 4.3 and 3.4.
* Random/src/DRand48Engine.cc,RandEngine.cc:
Remove (incorrect) implementation of private, unused, copy constructor
and operator=.
* Random/src/drand48.src:
The implementaton of the drand48_iterate method contained a problematic
"if (sizeof (unsigned short int) == 2) { } else {}" structure.
Code contained in the else portion had unintended side effects.
We have retained only the code in the if portion, which should work
on all machines.
==============================
01.05.08 Release CLHEP-2.0.3.3
==============================
==============================
18.10.07 Release CLHEP-2.0.3.2
==============================
2007-10-18 Mark Fischler <mf@fnal.gov>
* RandPoissonQ.cc: Change fire(mena) to call
shoot(theLocalEngine(),mean) instead of
shoot(mean), which had caused "cross-talk" between
modules that should not have affected eah other.
==============================
15.11.06 Release CLHEP-2.0.3.1
==============================
2006-11-15 Mark Fischler <mf@fnal.gov>
* Random/src/MTwistEngine.cc: improve seeding method
==============================
18.10.06 Release CLHEP-2.0.3.0
==============================
==============================
20.06.06 Release CLHEP-2.0.2.3
==============================
==============================
21.11.05 Release CLHEP-2.0.2.2
==============================
2005-11-21 Lynn Garren <garren@fnal.gov>
* src/Makefile.am, test/Makefile.am: Build libraries for
Windows Visual C++ without lib prefix.
==============================
22.06.05 Release CLHEP-2.0.2.1
==============================
Wed Jun 22 2005 Andreas Pfeiffer <andreas.pfeiffer@cern.ch>
* configure.in: changed soname to install_name for darwin targets,
dylibs still don't build properly on 10.3/10.4, static libs ok.
2005-06-19 Lynn Garren <garren@fnal.gov>
* configure.in, Makefile.am:
Use lib when building Visual C++ libraries.
Disable shared library build for Solaris CC.
==============================
22.04.05 Release CLHEP-2.0.2.0
==============================
2005-04-14 Mark Fischler <mf@fnal.gov>
* RandFlat.cc RandGauss.cc RandBinomial.cc ... all the distributions
......
......@@ -11,6 +11,10 @@ If you build CLHEP with gcc 2.95.2, you must configure --disable-shared.
To build for Solaris CC, configure with CXX=CC CC=cc and use gmake.
On MacOSX, you need to define MACOSX_DEPLOYMENT_TARGET appropriately.
For instance, set MACOSX_DEPLOYMENT_TARGET to "10.4" if you
have MacOS 10.4 installed on your system.
#-------------------------------------------------------------
# installing from a source code tar ball
#-------------------------------------------------------------
......
......@@ -14,7 +14,8 @@ Usage: Random-config [OPTION]
Known values for OPTION are:
--prefix show installation prefix
--cxx print compilation command
--cxx print C++ compilation command
--cpp print pre-processor commands
--cppflags print pre-processor flags
--cxxflags print C++ compiler flags
--ldflags print linker flags
......@@ -60,10 +61,11 @@ while test $# -gt 0; do
;;
--cxx)
echo "CXX: " @CXX@
echo "CC: " @CC@
echo "CPP: " @CPP@
echo "CXXCPP: " @CXXCPP@
echo @CXX@ @CPPFLAGS@ @AM_CXXFLAGS@ @CXXFLAGS@
;;
--cpp)
echo @CXXCPP@ @CPPFLAGS@ @Random_CPPFLAGS@
;;
--cppflags)
......@@ -75,7 +77,7 @@ while test $# -gt 0; do
;;
--ldflags)
echo @LDFLAGS@ @Random_LDFLAGS@
echo @AM_LDFLAGS@ @LDFLAGS@ @Random_LDFLAGS@
;;
--libs)
......
CLHEP-@PACKAGE@-@VERSION@ CLHEP-@PACKAGE@-@VERSION@
CLHEP-@PACKAGE@-@VERSION@ CLHEP-Units-@VERSION@
CLHEP-@PACKAGE@-@VERSION@ CLHEP-Utility-@VERSION@
// $Id: DRand48Engine.h,v 1.4 2005/04/27 20:12:49 garren Exp $
// $Id: DRand48Engine.h,v 1.5 2010/06/16 17:24:53 garren Exp $
// -*- C++ -*-
//
// -----------------------------------------------------------------------
......@@ -45,6 +45,7 @@
#include "CLHEP/Random/defs.h"
#include "CLHEP/Random/RandomEngine.h"
#include "CLHEP/Utility/noncopyable.h"
namespace CLHEP {
......@@ -52,7 +53,7 @@ namespace CLHEP {
* @author <Gabriele.Cosmo@cern.ch>
* @ingroup random
*/
class DRand48Engine : public HepRandomEngine {
class DRand48Engine : public HepRandomEngine, public noncopyable {
public:
......@@ -107,10 +108,6 @@ private:
static int numEngines;
static int maxIndex;
DRand48Engine(const DRand48Engine &p);
DRand48Engine & operator = (const DRand48Engine &p);
// Private copy constructor and assignment operator.
};
} // namespace CLHEP
......
// $Id: DualRand.h,v 1.4 2005/04/27 20:12:49 garren Exp $
// $Id: DualRand.h,v 1.5 2010/06/16 17:24:53 garren Exp $
// -*- C++ -*-
//
// -----------------------------------------------------------------------
......@@ -58,8 +58,9 @@ public:
DualRand(int rowIndex, int colIndex);
virtual ~DualRand();
DualRand(const DualRand & p);
DualRand & operator=(const DualRand & p);
// let the compiler generate the copy constructors
//DualRand(const DualRand & p);
//DualRand & operator=(const DualRand & p);
double flat();
// Returns a pseudo random number between 0 and 1
......@@ -105,11 +106,6 @@ private:
static int numEngines;
static double twoToMinus_32;
static double twoToMinus_53;
static double nearlyTwoToMinus_54;
void powersOfTwo();
// This generator is composed of two others combined:
class Tausworthe {
......
// $Id: Hurd160Engine.h,v 1.4 2005/04/27 20:12:49 garren Exp $
// $Id: Hurd160Engine.h,v 1.5 2010/06/16 17:24:53 garren Exp $
// -*- C++ -*-
//
// -----------------------------------------------------------------------
......@@ -49,10 +49,6 @@ public:
virtual ~Hurd160Engine();
// Constructors and destructor.
Hurd160Engine( const Hurd160Engine &p );
Hurd160Engine & operator = ( const Hurd160Engine &p );
// Copy constructor and operator=.
double flat();
// Returns a pseudo random number between 0 and 1
......@@ -97,10 +93,6 @@ private:
static int numEngines;
static int maxIndex;
static double twoToMinus_32;
static double twoToMinus_53;
static double nearlyTwoToMinus_54;
void powersOfTwo();
void advance();
int wordIndex;
......
// $Id: Hurd288Engine.h,v 1.4 2005/04/27 20:12:49 garren Exp $
// $Id: Hurd288Engine.h,v 1.5 2010/06/16 17:24:53 garren Exp $
// -*- C++ -*-
//
// -----------------------------------------------------------------------
......@@ -48,10 +48,6 @@ public:
virtual ~Hurd288Engine();
// Constructors and destructor.
Hurd288Engine( const Hurd288Engine &p );
Hurd288Engine & operator = ( const Hurd288Engine &p );
// Copy constructor and operator=.
double flat();
// Returns a pseudo random number between 0 and 1
......@@ -96,10 +92,6 @@ private:
static int numEngines;
static int maxIndex;
static double twoToMinus_32;
static double twoToMinus_53;
static double nearlyTwoToMinus_54;
void powersOfTwo();
void advance();
int wordIndex;
......
// $Id: JamesRandom.h,v 1.4 2005/04/27 20:12:49 garren Exp $
// $Id: JamesRandom.h,v 1.5 2010/06/16 17:24:53 garren Exp $
// -*- C++ -*-
//
// -----------------------------------------------------------------------
......@@ -53,12 +53,6 @@ public:
virtual ~HepJamesRandom();
// Constructor and destructor.
HepJamesRandom(const HepJamesRandom &p);
// Copy constructor
HepJamesRandom & operator = (const HepJamesRandom &p);
// Overloaded assignment operator, to retrieve the engine status.
double flat();
// Returns a pseudo random number between 0 and 1
// (excluding the end points)
......
// $Id: MTwistEngine.h,v 1.4 2005/04/27 20:12:49 garren Exp $
// $Id: MTwistEngine.h,v 1.5 2010/06/16 17:24:53 garren Exp $
// -*- C++ -*-
//
// -----------------------------------------------------------------------
......@@ -44,10 +44,6 @@ public:
virtual ~MTwistEngine();
// Constructors and destructor.
MTwistEngine( const MTwistEngine & p );
MTwistEngine & operator=( const MTwistEngine & p );
// Copy constructor and operator=.
double flat();
// Returns a pseudo random number between 0 and 1 (excluding the end points).
......@@ -92,11 +88,6 @@ private:
unsigned int mt[624];
int count624;
static double twoToMinus_32;
static double twoToMinus_53;
static double nearlyTwoToMinus_54;
void powersOfTwo();
enum{ NminusM = 227, M = 397, N = 624};
static int numEngines;
static int maxIndex;
......
// $Id: NonRandomEngine.h,v 1.4 2005/04/27 20:12:49 garren Exp $
// $Id: NonRandomEngine.h,v 1.5 2010/06/16 17:24:53 garren Exp $
// -*- C++ -*-
//
// -----------------------------------------------------------------------
......
// $Id: RandBinomial.h,v 1.4 2005/04/27 20:12:49 garren Exp $
// $Id: RandBinomial.h,v 1.5 2010/06/16 17:24:53 garren Exp $
// -*- C++ -*-
//
// -----------------------------------------------------------------------
......@@ -26,6 +26,7 @@
#define RandBinomial_h 1
#include "CLHEP/Random/Random.h"
#include "CLHEP/Utility/memory.h"
namespace CLHEP {
......@@ -100,13 +101,9 @@ public:
private:
// Private copy constructor. Defining it here disallows use.
RandBinomial(const RandBinomial& d);
static double genBinomial( HepRandomEngine *anEngine, long n, double p );
HepRandomEngine* localEngine;
bool deleteEngine;
shared_ptr<HepRandomEngine> localEngine;
long defaultN;
double defaultP;
......
// $Id: RandBinomial.icc,v 1.2 2003/07/17 19:20:02 garren Exp $
// $Id: RandBinomial.icc,v 1.3 2010/06/16 17:24:53 garren Exp $
// -*- C++ -*-
//
// -----------------------------------------------------------------------
......@@ -15,12 +15,12 @@ namespace CLHEP {
inline RandBinomial::RandBinomial(HepRandomEngine & anEngine, long n,
double p )
: localEngine(&anEngine), deleteEngine(false),
: HepRandom ( ), localEngine( &anEngine, do_nothing_deleter() ),
defaultN(n), defaultP(p) {}
inline RandBinomial::RandBinomial(HepRandomEngine * anEngine, long n,
double p )
: localEngine(anEngine), deleteEngine(true),
: HepRandom ( ), localEngine( anEngine),
defaultN(n), defaultP(p) {}
inline double RandBinomial::shoot() {
......
// $Id: RandBit.h,v 1.4 2005/04/27 20:12:49 garren Exp $
// $Id: RandBit.h,v 1.5 2010/06/16 17:24:53 garren Exp $
// -*- C++ -*-
//
// -----------------------------------------------------------------------
......@@ -100,9 +100,6 @@ public:
private:
// Private copy constructor. Defining it here disallows use.
RandBit(const RandBit& d);
// All the engine info, and the default A and B, are in the RandFlat
// base class.
......
// $Id: RandBit.icc,v 1.2 2003/07/17 19:20:02 garren Exp $
// $Id: RandBit.icc,v 1.3 2010/06/16 17:24:53 garren Exp $
// -*- C++ -*-
//
// -----------------------------------------------------------------------
......@@ -43,11 +43,7 @@ inline RandBit::RandBit(HepRandomEngine * anEngine, double a,
inline int RandBit::shootBit() {
double x = shoot();
if (x > .5) {
return 1;
} else {
return 0;
}
return (x > .5) ? 1 : 0;
}