35 return fire( defaultA );
78 while ((w = u * u + v * v) > 1.0);
80 return(u * std::sqrt( a * ( std::exp(- 2.0 / a * std::log(w)) - 1.0) / w));
86 for(
double* v = vect; v != vect + size; ++v )
91 const int size,
double* vect,
94 for(
double* v = vect; v != vect + size; ++v )
95 *v =
shoot(anEngine,a);
104 u = 2.0 * localEngine->flat() - 1.0;
105 v = 2.0 * localEngine->flat() - 1.0;
107 while ((w = u * u + v * v) > 1.0);
109 return(u * std::sqrt( a * ( std::exp(- 2.0 / a * std::log(w)) - 1.0) / w));
114 for(
double* v = vect; v != vect + size; ++v )
121 for(
double* v = vect; v != vect + size; ++v )
131 u = 2.0 * anEngine->
flat() - 1.0;
132 v = 2.0 * anEngine->
flat() - 1.0;
134 while ((w = u * u + v * v) > 1.0);
136 return(u * std::sqrt( a * ( std::exp(- 2.0 / a * std::log(w)) - 1.0) / w));
140 int pr=os.precision(20);
141 std::vector<unsigned long> t(2);
142 os <<
" " <<
name() <<
"\n";
143 os <<
"Uvec" <<
"\n";
145 os << defaultA <<
" " << t[0] <<
" " << t[1] <<
"\n";
153 if (inName !=
name()) {
154 is.clear(std::ios::badbit | is.rdstate());
155 std::cerr <<
"Mismatch when expecting to read state of a "
156 <<
name() <<
" distribution\n"
157 <<
"Name found was " << inName
158 <<
"\nistream is left in the badbit state\n";
162 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)