#include <random.h>
Public Member Functions | |
| LatRanGen () | |
| ~LatRanGen () | |
| void | Initialize () |
| IFloat | Urand (FermionFieldDimension frm_dim=FOUR_D) |
| Get a uniform random number. | |
| IFloat | Urand (Float high, Float low, FermionFieldDimension frm_dim=FOUR_D) |
| IFloat | Grand (FermionFieldDimension frm_dim=FOUR_D) |
| Get a gaussian random number. | |
| IFloat | Lrand () |
| Get a uniform random number which is the same on all nodes. | |
| void | SetSigma (IFloat sigma) |
| Sets the variance of the distribution. | |
| void | SetInterval (IFloat high, IFloat low) |
| Sets the interval over which the uniform distribution is defined. | |
| void | AssignGenerator (int x, int y, int z, int t, int s=0) |
| Specifies which hypercube RNG to use. | |
| void | AssignGenerator (const int *coor) |
| Specifies which hypercube RNG to use. | |
| void | AssignGenerator (int i) |
| Specifies which hypercube RNG to use. | |
| int | StateSize () const |
| Size of the RNG state (per hypercube). | |
| void | SetState (const unsigned int *, FermionFieldDimension frm_dim=FIVE_D) |
| Assign the state to a selected RNG. | |
| void | SetStates (unsigned int **, FermionFieldDimension frm_dim=FIVE_D) |
| Assign the state of all RNGs. | |
| int | NStates (FermionFieldDimension frm_dim=FIVE_D) const |
| Get the total number of states. | |
| void | GetState (unsigned int *, FermionFieldDimension frm_dim=FIVE_D) const |
| Retrieve the state of a single RNG. | |
| void | GetStates (unsigned int **, FermionFieldDimension frm_dim=FIVE_D) const |
| Retrieve the state of all RNGs. | |
| bool | Read (const char *filename, int concur_io_num=0) |
| Save the RNGs to a file (due to multi-type class members, not only supports read/write on same platform). | |
| bool | Write (const char *filename, int concur_io_num=0) |
| void | setParallel () |
| void | setSerial () |
| int | parIO () const |
| bool | good () const |
| void | Shift () |
| void | setLogDir (const char *LogDir) |
This class contains a uniform and a gaussian RNG for each 2^4 hypercube on the lattice. To ensure cross-platform reproducibility, these RNGs should be used, not the ones defined in the classes from which this inherits.
Definition at line 276 of file random.h.
|
|
|
|
|
|
|
|
Specifies which hypercube RNG to use. For a given lattice site, this identifies and assigns the corresponding hypercube RNG.
Definition at line 452 of file random.C. References cps::GJP, and cps::GlobalJobParameter::SnodeSites(). |
|
|
Specifies which hypercube RNG to use. For a given lattice site, this identifies and assigns the corresponding hypercube RNG.
Definition at line 438 of file random.C. References AssignGenerator(). |
|
||||||||||||||||||||||||
|
Specifies which hypercube RNG to use. For a given lattice site, this identifies and assigns the corresponding hypercube RNG.
Definition at line 409 of file random.C. References cps::GJP, cps::GlobalJobParameter::SnodeSites(), cps::GlobalJobParameter::TnodeSites(), cps::GlobalJobParameter::XnodeSites(), cps::GlobalJobParameter::YnodeSites(), and cps::GlobalJobParameter::ZnodeSites(). Referenced by AssignGenerator(), cps::Lattice::MetropolisAccept(), cps::QPropWRand::QPropWRand(), cps::Lattice::RandGaussAntiHermMatrix(), cps::Lattice::RandGaussVector(), cps::AlgRandomGauge::run(), cps::AlgOverRelax::run(), cps::AlgNoise::run(), cps::AlgGheatBath::run(), and cps::Lattice::SetGfieldDisOrd(). |
|
||||||||||||
|
Retrieve the state of a single RNG.
Definition at line 508 of file random.C. References cps::UGrandomGenerator::StoreSeeds(). |
|
||||||||||||
|
Retrieve the state of all RNGs.
Definition at line 562 of file random.C. References cps::UGrandomGenerator::StoreSeeds(). Referenced by cps::LRGState::GetStates(). |
|
|
|
|
|
Get a gaussian random number.
Definition at line 360 of file random.C. References cps::UGrandomGenerator::Grand(), and cps::IFloat. Referenced by cps::QPropWRand::QPropWRand(), cps::Lattice::RandGaussAntiHermMatrix(), cps::Lattice::RandGaussVector(), and cps::AlgNoise::run(). |
|
|
|
Get a uniform random number which is the same on all nodes.
Definition at line 475 of file random.C. References cps::Float, cps::GJP, cps::glb_sum_five(), cps::IFloat, cps::GlobalJobParameter::Snodes(), cps::GlobalJobParameter::Tnodes(), cps::UGrandomGenerator::Urand(), cps::GlobalJobParameter::Xnodes(), cps::GlobalJobParameter::Ynodes(), and cps::GlobalJobParameter::Znodes(). |
|
|
Get the total number of states.
Definition at line 535 of file random.C. Referenced by cps::LRGState::LRGState(), cps::AlgHmcRHMC::~AlgHmcRHMC(), and cps::LRGState::~LRGState(). |
|
|
|
|
||||||||||||
|
Save the RNGs to a file (due to multi-type class members, not only supports read/write on same platform).
Definition at line 573 of file random.C. References cps::QioControl::good(), parIO(), cps::LatRngRead::read(), cps::QioControl::setLogDir(), cps::LatRngIO::setParallel(), and cps::LatRngIO::setSerial(). |
|
||||||||||||
|
Sets the interval over which the uniform distribution is defined. The parameters are set for the RNGs on all hypercubes.
Definition at line 378 of file random.C. Referenced by cps::m_rand(), cps::Lattice::MetropolisAccept(), cps::AlgGheatBath::NoCheckerBoardRun(), cps::AlgGheatBath::NodeCheckerBoardRun(), cps::QPropWRand::QPropWRand(), cps::AlgRandomGauge::run(), cps::AlgOverRelax::run(), cps::AlgNoise::run(), cps::AlgGheatBath::run(), cps::Lattice::SetGfieldDisOrd(), and cps::WspectQuark::WspectQuark(). |
|
|
|
|
|
|
|
|
Definition at line 356 of file random.h. References cps::Verbose::Flow(), and cps::VRB. |
|
|
Sets the variance of the distribution. The parameters are set for the RNGs on all hypercubes. The mean is zero.
Definition at line 390 of file random.C. Referenced by cps::QPropWRand::QPropWRand(), cps::Lattice::RandGaussAntiHermMatrix(), cps::Lattice::RandGaussVector(), and cps::AlgNoise::run(). |
|
||||||||||||
|
Assign the state to a selected RNG.
Definition at line 521 of file random.C. References cps::RandomGenerator::RestoreSeeds(). |
|
||||||||||||
|
Assign the state of all RNGs.
Definition at line 547 of file random.C. References cps::RandomGenerator::RestoreSeeds(). Referenced by cps::LRGState::SetStates(). |
|
|
Definition at line 597 of file random.C. References cps::GDS, and cps::GlobalDataShift::Shift(). Referenced by cps::AlgHmcRHMC::run(). |
|
|
Size of the RNG state (per hypercube).
Definition at line 493 of file random.C. References cps::RandomGenerator::StateSize(). Referenced by cps::LRGState::LRGState(). |
|
||||||||||||||||
|
Definition at line 345 of file random.C. References cps::IFloat, and cps::UGrandomGenerator::Urand(). |
|
|
Get a uniform random number.
Definition at line 336 of file random.C. References cps::IFloat, and cps::UGrandomGenerator::Urand(). Referenced by cps::cmhb_kernel(), cps::m_rand(), cps::metropolis_kernel(), cps::Lattice::MetropolisAccept(), cps::QPropWRand::QPropWRand(), cps::AlgRandomGauge::run(), cps::AlgNoise::run(), cps::Lattice::SetGfieldDisOrd(), and cps::WspectQuark::WspectQuark(). |
|
||||||||||||
|
Definition at line 585 of file random.C. References cps::QioControl::good(), parIO(), cps::Verbose::Result(), cps::QioControl::setLogDir(), cps::LatRngIO::setParallel(), cps::LatRngIO::setSerial(), cps::VRB, and cps::LatRngWrite::write(). |
1.3.9.1