36 double mean,
double stdDev )
38 for(
double* v = vect; v != vect + size; ++v )
39 *v =
shoot(mean,stdDev);
43 const int size,
double* vect,
44 double mean,
double stdDev )
46 for(
double* v = vect; v != vect + size; ++v )
47 *v =
shoot(anEngine,mean,stdDev);
52 for(
double* v = vect; v != vect + size; ++v )
57 double mean,
double stdDev )
59 for(
double* v = vect; v != vect + size; ++v )
60 *v =
fire( mean, stdDev );
74#define Table1size 1000
75#define TableSize (Table0size+Table1size)
77#define Table0step (2.0E-6)
78#define Table1step (5.0E-4)
80#define Table0scale (1.0/Table1step)
83#define Table1offset (Table0size)
87static const float gaussTables [
TableSize] = {
88#include "CLHEP/Random/gaussQTables.cdat"
117 double y0 = gaussTables [index++];
118 double y1 = gaussTables [index];
120 return (
float) (sign * ( y1 * dx + y0 * (1.0-dx) ));
149 for (
int i = 1; i < 50; i++ ) {
150 double vn2 = 1.0/(guess*guess);
151 double s1 = -13*11*9*7*5*3 * vn2*vn2*vn2*vn2*vn2*vn2*vn2;
152 s1 += 11*9*7*5*3 * vn2*vn2*vn2*vn2*vn2*vn2;
153 s1 += -9*7*5*3 * vn2*vn2*vn2*vn2*vn2;
154 s1 += 7*5*3 * vn2*vn2*vn2*vn2;
155 s1 += -5*3 * vn2*vn2*vn2;
156 s1 += 3 * vn2*vn2 - vn2 + 1.0;
157 v = std::sqrt ( 2.0 * std::log ( s1 / (r*guess*std::sqrt(CLHEP::twopi)) ) );
158 if ( std::fabs(v-guess) < eps )
break;
166 long pr=os.precision(20);
167 os <<
" " <<
name() <<
"\n";
176 if (inName !=
name()) {
177 is.clear(std::ios::badbit | is.rdstate());
178 std::cerr <<
"Mismatch when expecting to read state of a "
179 <<
name() <<
" distribution\n"
180 <<
"Name found was " << inName
181 <<
"\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()
std::shared_ptr< HepRandomEngine > localEngine