Classes | Public Member Functions | Static Public Member Functions | Static Protected Member Functions | Protected Attributes | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | List of all members
CLHEP::MixMaxRng Class Reference

#include "/cvmfs/nova.opensciencegrid.org/externals/geant4/v4_10_4_p02ba/source/geant4.10.04.p02/source/externals/clhep/include/CLHEP/Random/MixMaxRng.h"

Inheritance diagram for CLHEP::MixMaxRng:
CLHEP::HepRandomEngine

Classes

struct  rng_state_st
 

Public Member Functions

 MixMaxRng (std::istream &is)
 
 MixMaxRng ()
 
 MixMaxRng (long seed)
 
 MixMaxRng (int rowIndex, int colIndex)
 
 ~MixMaxRng ()
 
 MixMaxRng (const MixMaxRng &rng)
 
MixMaxRngoperator= (const MixMaxRng &rng)
 
double flat ()
 
void flatArray (const int size, double *vect)
 
void setSeed (long seed, int dum=0)
 
void setSeeds (const long *seeds, int seedNum=0)
 
void saveStatus (const char filename[]="MixMaxRngState.conf") const
 
void restoreStatus (const char filename[]="MixMaxRngState.conf")
 
void showStatus () const
 
 operator unsigned int ()
 
virtual std::ostream & put (std::ostream &os) const
 
virtual std::istream & get (std::istream &is)
 
virtual std::istream & getState (std::istream &is)
 
std::string name () const
 
std::vector< unsigned long > put () const
 
bool get (const std::vector< unsigned long > &v)
 
bool getState (const std::vector< unsigned long > &v)
 
bool operator== (const HepRandomEngine &engine)
 
bool operator!= (const HepRandomEngine &engine)
 
long getSeed () const
 
const long * getSeeds () const
 
virtual operator double ()
 
virtual operator float ()
 

Static Public Member Functions

static std::string beginTag ()
 
static std::string engineName ()
 
static HepRandomEnginenewEngine (std::istream &is)
 
static HepRandomEnginenewEngine (const std::vector< unsigned long > &v)
 

Static Protected Member Functions

static double exponent_bit_32 ()
 
static double mantissa_bit_12 ()
 
static double mantissa_bit_24 ()
 
static double mantissa_bit_32 ()
 
static double twoToMinus_32 ()
 
static double twoToMinus_48 ()
 
static double twoToMinus_49 ()
 
static double twoToMinus_53 ()
 
static double nearlyTwoToMinus_54 ()
 
static bool checkFile (std::istream &file, const std::string &filename, const std::string &classname, const std::string &methodname)
 

Protected Attributes

long theSeed
 
const long * theSeeds
 

Private Types

typedef struct rng_state_st rng_state_t
 

Private Member Functions

void seed_uniquestream (myID_t clusterID, myID_t machineID, myID_t runID, myID_t streamID)
 
void seed_spbox (myuint_t)
 
void print_state () const
 
myuint_t precalc ()
 
myuint_t get_next ()
 
double get_next_float ()
 
MixMaxRng Branch ()
 
void BranchInplace (int id)
 
 MixMaxRng (myID_t clusterID, myID_t machineID, myID_t runID, myID_t streamID)
 
void seed64 (myuint_t seedval)
 
double generate (int i)
 
double iterate ()
 
double get_next_float_packbits ()
 
double convert1double (myuint_t u)
 
myuint_t MOD_MULSPEC (myuint_t k)
 
myuint_t MULWU (myuint_t k)
 
void seed_vielbein (unsigned int i)
 
myuint_t iterate_raw_vec (myuint_t *Y, myuint_t sumtotOld)
 
myuint_t apply_bigskip (myuint_t *Vout, myuint_t *Vin, myID_t clusterID, myID_t machineID, myID_t runID, myID_t streamID)
 
myuint_t modadd (myuint_t foo, myuint_t bar)
 
myuint_t fmodmulM61 (myuint_t cum, myuint_t s, myuint_t a)
 

Static Private Member Functions

static constexpr int rng_get_N ()
 
static constexpr long long int rng_get_SPECIAL ()
 
static constexpr int rng_get_SPECIALMUL ()
 

Private Attributes

rng_state_t S
 

Static Private Attributes

static const int N = 17
 
static constexpr long long int SPECIAL = ((N==17)? 0 : ((N==240)? 487013230256099140ULL:0) )
 
static constexpr long long int SPECIALMUL = ((N==17)? 36: ((N==240)? 51 :53) )
 
static constexpr int BITS =61
 
static constexpr myuint_t M61 =2305843009213693951ULL
 
static constexpr double INV_M61 =0.43368086899420177360298E-18
 
static constexpr unsigned int VECTOR_STATE_SIZE = 2*N+4
 

Detailed Description

Definition at line 49 of file MixMaxRng.h.

Member Typedef Documentation

Definition at line 178 of file MixMaxRng.h.

Constructor & Destructor Documentation

CLHEP::MixMaxRng::MixMaxRng ( std::istream &  is)
CLHEP::MixMaxRng::MixMaxRng ( )

Referenced by get_next_float().

CLHEP::MixMaxRng::MixMaxRng ( long  seed)
CLHEP::MixMaxRng::MixMaxRng ( int  rowIndex,
int  colIndex 
)
CLHEP::MixMaxRng::~MixMaxRng ( )
CLHEP::MixMaxRng::MixMaxRng ( const MixMaxRng rng)
CLHEP::MixMaxRng::MixMaxRng ( myID_t  clusterID,
myID_t  machineID,
myID_t  runID,
myID_t  streamID 
)
private

Member Function Documentation

myuint_t CLHEP::MixMaxRng::apply_bigskip ( myuint_t Vout,
myuint_t Vin,
myID_t  clusterID,
myID_t  machineID,
myID_t  runID,
myID_t  streamID 
)
private

Referenced by convert1double().

static std::string CLHEP::MixMaxRng::beginTag ( )
static

Referenced by flat().

MixMaxRng CLHEP::MixMaxRng::Branch ( )
private

Referenced by get_next_float().

void CLHEP::MixMaxRng::BranchInplace ( int  id)
private

Referenced by get_next_float().

static bool CLHEP::HepRandomEngine::checkFile ( std::istream &  file,
const std::string filename,
const std::string classname,
const std::string methodname 
)
staticprotectedinherited
double CLHEP::MixMaxRng::convert1double ( myuint_t  u)
inlineprivate

Definition at line 145 of file MixMaxRng.h.

References a, apply_bigskip(), b, CLHEP::bar, d, fmodmulM61(), iterate_raw_vec(), MOD_MULSPEC(), modadd(), MULWU(), one(), seed_vielbein(), tmp, and Y.

146  {
147  const double one = 1;
148  const myuint_t onemask = *(myuint_t*)&one;
149  myuint_t tmp = (u>>9) | onemask; // bits between 52 and 62 dont affect the result!
150  double d = *(double*)&tmp;
151  return d-1.0;
152  }
unsigned long long int myuint_t
Definition: MixMaxRng.h:47
Float_t tmp
Definition: plot.C:36
Float_t d
Definition: plot.C:236
auto one()
Definition: PMNS.cxx:49
static std::string CLHEP::MixMaxRng::engineName ( )
static

Referenced by name().

static double CLHEP::HepRandomEngine::exponent_bit_32 ( )
inlinestaticprotectedinherited
double CLHEP::MixMaxRng::flat ( )
inlinevirtual
void CLHEP::MixMaxRng::flatArray ( const int  size,
double *  vect 
)
virtual

Implements CLHEP::HepRandomEngine.

Referenced by flat().

myuint_t CLHEP::MixMaxRng::fmodmulM61 ( myuint_t  cum,
myuint_t  s,
myuint_t  a 
)
private

Referenced by convert1double().

double CLHEP::MixMaxRng::generate ( int  i)
private

Referenced by flat(), and seed64().

virtual std::istream& CLHEP::MixMaxRng::get ( std::istream &  is)
virtual

Reimplemented from CLHEP::HepRandomEngine.

bool CLHEP::MixMaxRng::get ( const std::vector< unsigned long > &  v)
virtual

Reimplemented from CLHEP::HepRandomEngine.

myuint_t CLHEP::MixMaxRng::get_next ( )
private
double CLHEP::MixMaxRng::get_next_float ( )
inlineprivate

Definition at line 128 of file MixMaxRng.h.

References Branch(), BranchInplace(), get_next_float_packbits(), and MixMaxRng().

128 { return get_next_float_packbits(); }
double get_next_float_packbits()
double CLHEP::MixMaxRng::get_next_float_packbits ( )
private

Referenced by get_next_float(), and seed64().

long CLHEP::HepRandomEngine::getSeed ( ) const
inlineinherited

Definition at line 113 of file RandomEngine.h.

References CLHEP::HepRandomEngine::theSeed.

113 { return theSeed; }
const long* CLHEP::HepRandomEngine::getSeeds ( ) const
inlineinherited

Definition at line 116 of file RandomEngine.h.

References check_time_usage::float, makeTrainCVSamples::int, and CLHEP::HepRandomEngine::theSeeds.

116 { return theSeeds; }
virtual std::istream& CLHEP::MixMaxRng::getState ( std::istream &  is)
virtual

Reimplemented from CLHEP::HepRandomEngine.

Referenced by flat(), and name().

bool CLHEP::MixMaxRng::getState ( const std::vector< unsigned long > &  v)
virtual

Reimplemented from CLHEP::HepRandomEngine.

double CLHEP::MixMaxRng::iterate ( )
private

Referenced by flat(), and seed64().

myuint_t CLHEP::MixMaxRng::iterate_raw_vec ( myuint_t Y,
myuint_t  sumtotOld 
)
private

Referenced by convert1double().

static double CLHEP::HepRandomEngine::mantissa_bit_12 ( )
inlinestaticprotectedinherited
static double CLHEP::HepRandomEngine::mantissa_bit_24 ( )
inlinestaticprotectedinherited
static double CLHEP::HepRandomEngine::mantissa_bit_32 ( )
inlinestaticprotectedinherited
myuint_t CLHEP::MixMaxRng::MOD_MULSPEC ( myuint_t  k)
private

Referenced by convert1double().

myuint_t CLHEP::MixMaxRng::modadd ( myuint_t  foo,
myuint_t  bar 
)
private

Referenced by convert1double().

myuint_t CLHEP::MixMaxRng::MULWU ( myuint_t  k)
private

Referenced by convert1double().

std::string CLHEP::MixMaxRng::name ( ) const
inlinevirtual
static double CLHEP::HepRandomEngine::nearlyTwoToMinus_54 ( )
inlinestaticprotectedinherited
static HepRandomEngine* CLHEP::HepRandomEngine::newEngine ( std::istream &  is)
staticinherited
static HepRandomEngine* CLHEP::HepRandomEngine::newEngine ( const std::vector< unsigned long > &  v)
staticinherited
virtual CLHEP::HepRandomEngine::operator double ( )
virtualinherited
virtual CLHEP::HepRandomEngine::operator float ( )
virtualinherited
CLHEP::MixMaxRng::operator unsigned int ( )
virtual

Reimplemented from CLHEP::HepRandomEngine.

bool CLHEP::HepRandomEngine::operator!= ( const HepRandomEngine engine)
inlineinherited
MixMaxRng& CLHEP::MixMaxRng::operator= ( const MixMaxRng rng)
bool CLHEP::HepRandomEngine::operator== ( const HepRandomEngine engine)
inlineinherited
myuint_t CLHEP::MixMaxRng::precalc ( )
private
void CLHEP::MixMaxRng::print_state ( ) const
private
virtual std::ostream& CLHEP::MixMaxRng::put ( std::ostream &  os) const
virtual

Reimplemented from CLHEP::HepRandomEngine.

std::vector<unsigned long> CLHEP::MixMaxRng::put ( ) const
virtual

Reimplemented from CLHEP::HepRandomEngine.

Referenced by flat(), and name().

void CLHEP::MixMaxRng::restoreStatus ( const char  filename[] = "MixMaxRngState.conf")
virtual

Implements CLHEP::HepRandomEngine.

Referenced by flat().

static constexpr int CLHEP::MixMaxRng::rng_get_N ( )
staticprivate
static constexpr long long int CLHEP::MixMaxRng::rng_get_SPECIAL ( )
staticprivate
static constexpr int CLHEP::MixMaxRng::rng_get_SPECIALMUL ( )
staticprivate
void CLHEP::MixMaxRng::saveStatus ( const char  filename[] = "MixMaxRngState.conf") const
virtual

Implements CLHEP::HepRandomEngine.

Referenced by flat().

void CLHEP::MixMaxRng::seed64 ( myuint_t  seedval)
inlineprivate

Definition at line 135 of file MixMaxRng.h.

References generate(), get_next_float_packbits(), MECModelEnuComparisons::i, iterate(), and seed_uniquestream().

135 { seed_uniquestream( 0, 0, (myID_t)(seedval>>32), (myID_t)seedval ); } // seed with one 64-bit seed
unsigned long int myID_t
Definition: MixMaxRng.h:46
void seed_uniquestream(myID_t clusterID, myID_t machineID, myID_t runID, myID_t streamID)
void CLHEP::MixMaxRng::seed_spbox ( myuint_t  )
private
void CLHEP::MixMaxRng::seed_uniquestream ( myID_t  clusterID,
myID_t  machineID,
myID_t  runID,
myID_t  streamID 
)
private

Referenced by seed64().

void CLHEP::MixMaxRng::seed_vielbein ( unsigned int  i)
private

Referenced by convert1double().

void CLHEP::MixMaxRng::setSeed ( long  seed,
int  dum = 0 
)
virtual

Implements CLHEP::HepRandomEngine.

Referenced by flat().

void CLHEP::MixMaxRng::setSeeds ( const long *  seeds,
int  seedNum = 0 
)
virtual

Implements CLHEP::HepRandomEngine.

Referenced by flat().

void CLHEP::MixMaxRng::showStatus ( ) const
virtual

Implements CLHEP::HepRandomEngine.

Referenced by flat().

static double CLHEP::HepRandomEngine::twoToMinus_32 ( )
inlinestaticprotectedinherited
static double CLHEP::HepRandomEngine::twoToMinus_48 ( )
inlinestaticprotectedinherited
static double CLHEP::HepRandomEngine::twoToMinus_49 ( )
inlinestaticprotectedinherited
static double CLHEP::HepRandomEngine::twoToMinus_53 ( )
inlinestaticprotectedinherited

Member Data Documentation

constexpr int CLHEP::MixMaxRng::BITS =61
staticprivate

Definition at line 113 of file MixMaxRng.h.

constexpr double CLHEP::MixMaxRng::INV_M61 =0.43368086899420177360298E-18
staticprivate

Definition at line 115 of file MixMaxRng.h.

constexpr myuint_t CLHEP::MixMaxRng::M61 =2305843009213693951ULL
staticprivate

Definition at line 114 of file MixMaxRng.h.

const int CLHEP::MixMaxRng::N = 17
staticprivate

Definition at line 51 of file MixMaxRng.h.

rng_state_t CLHEP::MixMaxRng::S
private

Definition at line 179 of file MixMaxRng.h.

Referenced by flat().

constexpr long long int CLHEP::MixMaxRng::SPECIAL = ((N==17)? 0 : ((N==240)? 487013230256099140ULL:0) )
staticprivate

Definition at line 110 of file MixMaxRng.h.

constexpr long long int CLHEP::MixMaxRng::SPECIALMUL = ((N==17)? 36: ((N==240)? 51 :53) )
staticprivate

Definition at line 111 of file MixMaxRng.h.

long CLHEP::HepRandomEngine::theSeed
protectedinherited

Definition at line 143 of file RandomEngine.h.

Referenced by CLHEP::HepRandomEngine::getSeed().

const long* CLHEP::HepRandomEngine::theSeeds
protectedinherited

Definition at line 144 of file RandomEngine.h.

Referenced by CLHEP::HepRandomEngine::getSeeds().

constexpr unsigned int CLHEP::MixMaxRng::VECTOR_STATE_SIZE = 2*N+4
staticprivate

Definition at line 116 of file MixMaxRng.h.


The documentation for this class was generated from the following file: