44 return fire( a, b, c );
59 double val, rval, displ;
61 if ( gamma == 0.0 )
return mean;
62 val = std::atan(2.0*cut/gamma);
64 displ = 0.5*gamma*std::tan(rval*val);
71 double val, rval, displ;
73 if ( gamma == 0.0 )
return mean;
74 val = std::atan(-mean/gamma);
76 displ = gamma*std::tan(rval);
78 return std::sqrt(mean*mean + mean*displ);
84 double lower, upper,
tmp;
86 if ( gamma == 0.0 )
return mean;
88 lower = std::atan( (tmp*tmp-mean*mean)/(mean*gamma) );
89 upper = std::atan( ((mean+cut)*(mean+cut)-mean*mean)/(mean*gamma) );
91 displ = gamma*std::tan(rval);
93 return std::sqrt(
std::max(0.0, mean*mean + mean*displ));
98 for(
double*
v = vect;
v != vect + size; ++
v )
105 for(
double*
v = vect;
v != vect + size; ++
v )
113 for(
double*
v = vect;
v != vect + size; ++
v )
120 double mean,
double gamma)
124 rval = 2.0*anEngine->
flat()-1.0;
131 double mean,
double gamma,
double cut )
133 double val, rval, displ;
135 if ( gamma == 0.0 )
return mean;
136 val = std::atan(2.0*cut/gamma);
137 rval = 2.0*anEngine->
flat()-1.0;
138 displ = 0.5*gamma*std::tan(rval*val);
144 double mean,
double gamma )
146 double val, rval, displ;
148 if ( gamma == 0.0 )
return mean;
149 val = std::atan(-mean/gamma);
151 displ = gamma*std::tan(rval);
153 return std::sqrt(mean*mean + mean*displ);
157 double mean,
double gamma,
double cut )
160 double lower, upper,
tmp;
162 if ( gamma == 0.0 )
return mean;
164 lower = std::atan( (tmp*tmp-mean*mean)/(mean*gamma) );
165 upper = std::atan( ((mean+cut)*(mean+cut)-mean*mean)/(mean*gamma) );
167 displ = gamma*std::tan(rval);
169 return std::sqrt(
std::max(0.0, mean*mean+mean*displ) );
173 const int size,
double* vect )
175 for(
double*
v = vect;
v != vect + size; ++
v )
176 *
v =
shoot( anEngine, 1.0, 0.2 );
180 const int size,
double* vect,
183 for(
double*
v = vect;
v != vect + size; ++
v )
184 *
v =
shoot( anEngine, a, b );
188 const int size,
double* vect,
189 double a,
double b,
double c )
191 for(
double*
v = vect;
v != vect + size; ++
v )
192 *
v =
shoot( anEngine, a, b, c );
214 double val, rval, displ;
216 if ( gamma == 0.0 )
return mean;
217 val = std::atan(2.0*cut/gamma);
219 displ = 0.5*gamma*std::tan(rval*val);
231 double val, rval, displ;
233 if ( gamma == 0.0 )
return mean;
234 val = std::atan(-mean/gamma);
236 displ = gamma*std::tan(rval);
238 return std::sqrt(mean*mean + mean*displ);
244 double lower, upper,
tmp;
246 if ( gamma == 0.0 )
return mean;
248 lower = std::atan( (tmp*tmp-mean*mean)/(mean*gamma) );
249 upper = std::atan( ((mean+cut)*(mean+cut)-mean*mean)/(mean*gamma) );
251 displ = gamma*std::tan(rval);
253 return std::sqrt(
std::max(0.0, mean*mean + mean*displ));
258 for(
double*
v = vect;
v != vect + size; ++
v )
265 for(
double*
v = vect;
v != vect + size; ++
v )
270 double a,
double b,
double c )
272 for(
double*
v = vect;
v != vect + size; ++
v )
273 *
v =
fire( a, b, c );
278 int pr=os.precision(20);
279 std::vector<unsigned long>
t(2);
280 os <<
" " <<
name() <<
"\n";
281 os <<
"Uvec" <<
"\n";
283 os <<
defaultA <<
" " << t[0] <<
" " << t[1] <<
"\n";
285 os <<
defaultB <<
" " << t[0] <<
" " << t[1] <<
"\n";
293 if (inName !=
name()) {
294 is.clear(std::ios::badbit | is.rdstate());
295 std::cerr <<
"Mismatch when expecting to read state of a "
296 <<
name() <<
" distribution\n"
297 <<
"Name found was " << inName
298 <<
"\nistream is left in the badbit state\n";
302 std::vector<unsigned long>
t(2);