37 double mean,
double stdDev )
39 for(
double* v = vect; v != vect + size; ++v )
40 *v =
shoot(mean,stdDev);
44 const int size,
double* vect,
45 double mean,
double stdDev )
47 for(
double* v = vect; v != vect + size; ++v )
48 *v =
shoot(anEngine,mean,stdDev);
53 for(
double* v = vect; v != vect + size; ++v )
58 double mean,
double stdDev )
60 for(
double* v = vect; v != vect + size; ++v )
61 *v =
fire( mean, stdDev );
75#define Table1size 1000
76#define TableSize (Table0size+Table1size)
78#define Table0step (2.0E-6)
79#define Table1step (5.0E-4)
81#define Table0scale (1.0/Table1step)
84#define Table1offset (Table0size)
88static const float gaussTables [
TableSize] = {
89#include "CLHEP/Random/gaussQTables.cdat"
118 double y0 = gaussTables [index++];
119 double y1 = gaussTables [index];
121 return (
float) (sign * ( y1 * dx + y0 * (1.0-dx) ));
150 for (
int i = 1; i < 50; i++ ) {
151 double vn2 = 1.0/(guess*guess);
152 double s1 = -13*11*9*7*5*3 * vn2*vn2*vn2*vn2*vn2*vn2*vn2;
153 s1 += 11*9*7*5*3 * vn2*vn2*vn2*vn2*vn2*vn2;
154 s1 += -9*7*5*3 * vn2*vn2*vn2*vn2*vn2;
155 s1 += 7*5*3 * vn2*vn2*vn2*vn2;
156 s1 += -5*3 * vn2*vn2*vn2;
157 s1 += 3 * vn2*vn2 - vn2 + 1.0;
158 v = std::sqrt ( 2.0 * std::log ( s1 / (r*guess*std::sqrt(CLHEP::twopi)) ) );
159 if ( std::fabs(v-guess) < eps )
break;
167 int pr=os.precision(20);
168 os <<
" " <<
name() <<
"\n";
177 if (inName !=
name()) {
178 is.clear(std::ios::badbit | is.rdstate());
179 std::cerr <<
"Mismatch when expecting to read state of a "
180 <<
name() <<
" distribution\n"
181 <<
"Name found was " << inName
182 <<
"\nistream is left in the badbit state\n";
std::istream & get(std::istream &is)
static double transformSmall(double r)
std::ostream & put(std::ostream &os) const
static void shootArray(const int size, double *vect, double mean=0.0, double stdDev=1.0)
void fireArray(const int size, double *vect)
HepRandomEngine & engine()
virtual double operator()()
static double transformQuick(double r)
std::istream & get(std::istream &is)
std::ostream & put(std::ostream &os) const
HepRandomEngine & engine()
shared_ptr< HepRandomEngine > localEngine