38 return fire( defaultA );
81 while ((w = u * u + v * v) > 1.0);
83 return(u * std::sqrt( a * ( std::exp(- 2.0 / a * std::log(w)) - 1.0) / w));
89 for(
double* v = vect; v != vect + size; ++v )
94 const int size,
double* vect,
97 for(
double* v = vect; v != vect + size; ++v )
98 *v =
shoot(anEngine,a);
107 u = 2.0 * localEngine->flat() - 1.0;
108 v = 2.0 * localEngine->flat() - 1.0;
110 while ((w = u * u + v * v) > 1.0);
112 return(u * std::sqrt( a * ( std::exp(- 2.0 / a * std::log(w)) - 1.0) / w));
117 for(
double* v = vect; v != vect + size; ++v )
124 for(
double* v = vect; v != vect + size; ++v )
134 u = 2.0 * anEngine->
flat() - 1.0;
135 v = 2.0 * anEngine->
flat() - 1.0;
137 while ((w = u * u + v * v) > 1.0);
139 return(u * std::sqrt( a * ( std::exp(- 2.0 / a * std::log(w)) - 1.0) / w));
143 int pr=os.precision(20);
144 std::vector<unsigned long> t(2);
145 os <<
" " <<
name() <<
"\n";
146 os <<
"Uvec" <<
"\n";
148 os << defaultA <<
" " << t[0] <<
" " << t[1] <<
"\n";
156 if (inName !=
name()) {
157 is.clear(std::ios::badbit | is.rdstate());
158 std::cerr <<
"Mismatch when expecting to read state of a "
159 <<
name() <<
" distribution\n"
160 <<
"Name found was " << inName
161 <<
"\nistream is left in the badbit state\n";
165 std::vector<unsigned long> t(2);
static double longs2double(const std::vector< unsigned long > &v)
static std::vector< unsigned long > dto2longs(double d)
static HepRandomEngine * getTheEngine()
static void shootArray(const int size, double *vect, double a=1.0)
void fireArray(const int size, double *vect)
HepRandomEngine & engine()
std::istream & get(std::istream &is)
std::ostream & put(std::ostream &os) const
bool possibleKeywordInput(IS &is, const std::string &key, T &t)