#include <RandExpZiggurat.h>
|
| RandExpZiggurat (HepRandomEngine &anEngine, double mean=1.0) |
|
| RandExpZiggurat (HepRandomEngine *anEngine, double mean=1.0) |
|
virtual | ~RandExpZiggurat () |
|
float | fire () |
|
float | fire (float mean) |
|
void | fireArray (const int size, float *vect) |
|
void | fireArray (const int size, double *vect) |
|
void | fireArray (const int size, float *vect, float mean) |
|
void | fireArray (const int size, double *vect, double mean) |
|
virtual double | operator() () |
|
float | operator() (float mean) |
|
std::ostream & | put (std::ostream &os) const |
|
std::istream & | get (std::istream &is) |
|
std::string | name () const |
|
HepRandomEngine & | engine () |
|
Public Member Functions inherited from CLHEP::HepRandom |
| HepRandom () |
|
| HepRandom (long seed) |
|
| HepRandom (HepRandomEngine &algorithm) |
|
| HepRandom (HepRandomEngine *algorithm) |
|
virtual | ~HepRandom () |
|
double | flat () |
|
void | flatArray (const int size, double *vect) |
|
double | flat (HepRandomEngine *theNewEngine) |
|
void | flatArray (HepRandomEngine *theNewEngine, const int size, double *vect) |
|
|
static float | shoot () |
|
static float | shoot (float mean) |
|
static void | shootArray (const int size, float *vect, float mean=1.0) |
|
static void | shootArray (const int size, double *vect, double mean=1.0) |
|
static float | shoot (HepRandomEngine *anEngine) |
|
static float | shoot (HepRandomEngine *anEngine, float mean) |
|
static void | shootArray (HepRandomEngine *anEngine, const int size, float *vect, float mean=1.0) |
|
static void | shootArray (HepRandomEngine *anEngine, const int size, double *vect, double mean=1.0) |
|
static std::string | distributionName () |
|
static bool | ziggurat_init () |
|
Static Public Member Functions inherited from CLHEP::HepRandom |
static void | setTheSeed (long seed, int lux=3) |
|
static long | getTheSeed () |
|
static void | setTheSeeds (const long *seeds, int aux=-1) |
|
static const long * | getTheSeeds () |
|
static void | getTheTableSeeds (long *seeds, int index) |
|
static HepRandom * | getTheGenerator () |
|
static void | setTheEngine (HepRandomEngine *theNewEngine) |
|
static HepRandomEngine * | getTheEngine () |
|
static void | saveEngineStatus (const char filename[]="Config.conf") |
|
static void | restoreEngineStatus (const char filename[]="Config.conf") |
|
static std::ostream & | saveFullState (std::ostream &os) |
|
static std::istream & | restoreFullState (std::istream &is) |
|
static std::ostream & | saveDistState (std::ostream &os) |
|
static std::istream & | restoreDistState (std::istream &is) |
|
static std::ostream & | saveStaticRandomStates (std::ostream &os) |
|
static std::istream & | restoreStaticRandomStates (std::istream &is) |
|
static void | showEngineStatus () |
|
static int | createInstance () |
|
static std::string | distributionName () |
|
- Author
- ATLAS
Definition at line 34 of file RandExpZiggurat.h.
CLHEP::RandExpZiggurat::RandExpZiggurat |
( |
HepRandomEngine & |
anEngine, |
|
|
double |
mean = 1.0 |
|
) |
| |
|
inline |
CLHEP::RandExpZiggurat::RandExpZiggurat |
( |
HepRandomEngine * |
anEngine, |
|
|
double |
mean = 1.0 |
|
) |
| |
|
inline |
CLHEP::RandExpZiggurat::~RandExpZiggurat |
( |
| ) |
|
|
virtual |
static std::string CLHEP::RandExpZiggurat::distributionName |
( |
| ) |
|
|
inlinestatic |
float CLHEP::RandExpZiggurat::fire |
( |
| ) |
|
|
inline |
float CLHEP::RandExpZiggurat::fire |
( |
float |
mean | ) |
|
|
inline |
void CLHEP::RandExpZiggurat::fireArray |
( |
const int |
size, |
|
|
float * |
vect |
|
) |
| |
void CLHEP::RandExpZiggurat::fireArray |
( |
const int |
size, |
|
|
double * |
vect |
|
) |
| |
void CLHEP::RandExpZiggurat::fireArray |
( |
const int |
size, |
|
|
float * |
vect, |
|
|
float |
mean |
|
) |
| |
void CLHEP::RandExpZiggurat::fireArray |
( |
const int |
size, |
|
|
double * |
vect, |
|
|
double |
mean |
|
) |
| |
std::istream & CLHEP::RandExpZiggurat::get |
( |
std::istream & |
is | ) |
|
|
virtual |
Reimplemented from CLHEP::HepRandom.
Definition at line 90 of file RandExpZiggurat.cc.
References CLHEP::DoubConv::longs2double(), name(), and CLHEP::possibleKeywordInput().
93 if (inName !=
name()) {
94 is.clear(std::ios::badbit | is.rdstate());
95 std::cerr <<
"Mismatch when expecting to read state of a "
96 <<
name() <<
" distribution\n"
97 <<
"Name found was " << inName
98 <<
"\nistream is left in the badbit state\n";
102 std::vector<unsigned long> t(2);
bool possibleKeywordInput(IS &is, const std::string &key, T &t)
static double longs2double(const std::vector< unsigned long > &v)
std::string CLHEP::RandExpZiggurat::name |
( |
| ) |
const |
|
virtual |
double CLHEP::RandExpZiggurat::operator() |
( |
| ) |
|
|
virtual |
float CLHEP::RandExpZiggurat::operator() |
( |
float |
mean | ) |
|
|
inline |
std::ostream & CLHEP::RandExpZiggurat::put |
( |
std::ostream & |
os | ) |
const |
|
virtual |
static float CLHEP::RandExpZiggurat::shoot |
( |
| ) |
|
|
inlinestatic |
static float CLHEP::RandExpZiggurat::shoot |
( |
float |
mean | ) |
|
|
inlinestatic |
static float CLHEP::RandExpZiggurat::shoot |
( |
HepRandomEngine * |
anEngine, |
|
|
float |
mean |
|
) |
| |
|
inlinestatic |
void CLHEP::RandExpZiggurat::shootArray |
( |
const int |
size, |
|
|
float * |
vect, |
|
|
float |
mean = 1.0 |
|
) |
| |
|
static |
void CLHEP::RandExpZiggurat::shootArray |
( |
const int |
size, |
|
|
double * |
vect, |
|
|
double |
mean = 1.0 |
|
) |
| |
|
static |
void CLHEP::RandExpZiggurat::shootArray |
( |
HepRandomEngine * |
anEngine, |
|
|
const int |
size, |
|
|
float * |
vect, |
|
|
float |
mean = 1.0 |
|
) |
| |
|
static |
void CLHEP::RandExpZiggurat::shootArray |
( |
HepRandomEngine * |
anEngine, |
|
|
const int |
size, |
|
|
double * |
vect, |
|
|
double |
mean = 1.0 |
|
) |
| |
|
static |
float CLHEP::RandExpZiggurat::ziggurat_efix |
( |
unsigned long |
jz, |
|
|
HepRandomEngine * |
anEngine |
|
) |
| |
|
staticprotected |
bool CLHEP::RandExpZiggurat::ziggurat_init |
( |
| ) |
|
|
static |
Definition at line 129 of file RandExpZiggurat.cc.
References fe, fn, ke, kn, we, wn, and ziggurat_is_init.
Referenced by RandExpZiggurat().
131 const double rzm1 = 2147483648.0, rzm2 = 4294967296.;
132 double dn=3.442619855899,tn=dn,vn=9.91256303526217e-3, q;
133 double de=7.697117470131487, te=de, ve=3.949659822581572e-3;
137 q=vn/std::exp(-.5*dn*dn);
138 kn[0]=(
unsigned long)((dn/q)*rzm1);
145 fn[127]=std::exp(-.5*dn*dn);
147 for(i=126;i>=1;i--) {
148 dn=std::sqrt(-2.*std::log(vn/dn+std::exp(-.5*dn*dn)));
149 kn[i+1]=(
unsigned long)((dn/tn)*rzm1);
151 fn[i]=std::exp(-.5*dn*dn);
156 q = ve/std::exp(-de);
157 ke[0]=(
unsigned long)((de/q)*rzm2);
164 fe[255]=std::exp(-de);
166 for(i=254;i>=1;i--) {
167 de=-std::log(ve/de+std::exp(-de));
168 ke[i+1]= (
unsigned long)((de/te)*rzm2);
static unsigned long kn[128]
static unsigned long ke[256]
static bool ziggurat_is_init
static float CLHEP::RandExpZiggurat::ziggurat_REXP |
( |
HepRandomEngine * |
anEngine | ) |
|
|
inlinestaticprotected |
static unsigned long CLHEP::RandExpZiggurat::ziggurat_SHR3 |
( |
HepRandomEngine * |
anEngine | ) |
|
|
inlinestaticprotected |
static float CLHEP::RandExpZiggurat::ziggurat_UNI |
( |
HepRandomEngine * |
anEngine | ) |
|
|
inlinestaticprotected |
float CLHEP::RandExpZiggurat::fe |
|
staticprotected |
float CLHEP::RandExpZiggurat::fn |
|
staticprotected |
unsigned long CLHEP::RandExpZiggurat::ke |
|
staticprotected |
unsigned long CLHEP::RandExpZiggurat::kn |
|
staticprotected |
float CLHEP::RandExpZiggurat::we |
|
staticprotected |
float CLHEP::RandExpZiggurat::wn |
|
staticprotected |
The documentation for this class was generated from the following files: