CLHEP VERSION Reference Documentation
CLHEP Home Page CLHEP Documentation CLHEP Bug Reports |
#include "CLHEP/Random/Randomize.h"
#include "CLHEP/Random/NonRandomEngine.h"
#include "CLHEP/Random/defs.h"
#include <iostream>
#include <iomanip>
#include <vector>
Go to the source code of this file.
Macros | |
#define | CLEAN_OUTPUT |
#define | TEST_ORIGINAL_SAVE |
#define | TEST_ENGINE_NAMES |
#define | TEST_INSTANCE_METHODS |
#define | TEST_SHARED_ENGINES |
#define | TEST_STATIC_SAVE |
#define | TEST_SAVE_STATIC_STATES |
#define | TEST_ANONYMOUS_ENGINE_RESTORE |
#define | TEST_ANONYMOUS_RESTORE_STATICS |
#define | TEST_VECTOR_ENGINE_RESTORE |
Functions | |
std::ofstream | output ("ranRestoreTest.cout") |
bool | equals01 (const std::vector< double > &ab) |
bool | equals (double a, double b) |
int | saveStepX () |
int | restoreStepX () |
int | BsaveStepX () |
int | BrestoreStepX () |
int | saveStep () |
int | restoreStep () |
int | BsaveStep () |
int | BrestoreStep () |
template<class E , class D > | |
int | fileNotThere () |
template<class E > | |
int | fileNotThereEngine () |
int | missingFile () |
template<class E , class D > | |
int | saveEngine (const char *filename) |
template<class E , class D > | |
int | checkSaveEngine (const char *filename) |
template<class E > | |
int | checkEngineName (const std::string &name) |
template<class E , class D > | |
int | checkEngine () |
template<class E > | |
int | checkEngineInstanceSave (E &e) |
template<class E , class D > | |
int | checkSaveDistribution (D &d, int nth) |
template<class E > | |
int | checkRandGeneralDistribution (RandGeneral &d, int nth) |
template<class E > | |
int | checkDistributions () |
template<class E , class D1 , class D2 > | |
int | checkSharingDistributions (D1 &d1, D2 &d2, int n1, int n2) |
template<class E > | |
int | checkSharing () |
std::vector< double > | aSequence (int n) |
template<class D > | |
int | staticSave (int n) |
template<class D > | |
int | staticSaveShootBit (int n) |
void | randomizeStatics (int n) |
std::vector< double > | captureStatics () |
void | saveStatics (std::string filename) |
void | restoreStatics (std::string filename) |
template<class E > | |
void | anonymousRestore1 (int n, std::vector< double > &v) |
template<> | |
void | anonymousRestore1< NonRandomEngine > (int n, std::vector< double > &v) |
template<class E > | |
int | anonymousRestore2 (const std::vector< double > &v) |
template<class E > | |
int | anonymousRestore (int n) |
template<class E > | |
int | anonymousRestoreStatics1 () |
template<class E1 , class E2 > | |
int | anonymousRestoreStatics () |
template<class E > | |
std::vector< unsigned long > | vectorRestore1 (int n, std::vector< double > &v) |
template<> | |
std::vector< unsigned long > | vectorRestore1< NonRandomEngine > (int n, std::vector< double > &v) |
template<class E > | |
int | vectorRestore2 (const std::vector< unsigned long > state, const std::vector< double > &v) |
template<class E > | |
int | vectorRestore (int n) |
int | main () |
Variables | |
double | remembered_r2 |
double | remembered_r1005 |
double | remembered_r1006 |
double | remembered_r1007 |
#define CLEAN_OUTPUT |
Definition at line 11 of file ranRestoreTest.cc.
#define TEST_ANONYMOUS_ENGINE_RESTORE |
Definition at line 30 of file ranRestoreTest.cc.
#define TEST_ANONYMOUS_RESTORE_STATICS |
Definition at line 31 of file ranRestoreTest.cc.
#define TEST_ENGINE_NAMES |
Definition at line 25 of file ranRestoreTest.cc.
#define TEST_INSTANCE_METHODS |
Definition at line 26 of file ranRestoreTest.cc.
#define TEST_ORIGINAL_SAVE |
Definition at line 20 of file ranRestoreTest.cc.
#define TEST_SAVE_STATIC_STATES |
Definition at line 29 of file ranRestoreTest.cc.
#define TEST_SHARED_ENGINES |
Definition at line 27 of file ranRestoreTest.cc.
#define TEST_STATIC_SAVE |
Definition at line 28 of file ranRestoreTest.cc.
#define TEST_VECTOR_ENGINE_RESTORE |
Definition at line 32 of file ranRestoreTest.cc.
int anonymousRestore | ( | int | n | ) |
Definition at line 1047 of file ranRestoreTest.cc.
References CLHEP::detail::n.
void anonymousRestore1 | ( | int | n, |
std::vector< double > & | v | ||
) |
Definition at line 986 of file ranRestoreTest.cc.
References CLHEP::detail::n, and output().
void anonymousRestore1< NonRandomEngine > | ( | int | n, |
std::vector< double > & | v | ||
) |
Definition at line 1002 of file ranRestoreTest.cc.
References aSequence(), CLHEP::NonRandomEngine::engineName(), CLHEP::NonRandomEngine::flat(), CLHEP::detail::n, output(), and CLHEP::NonRandomEngine::setRandomSequence().
int anonymousRestore2 | ( | const std::vector< double > & | v | ) |
Definition at line 1022 of file ranRestoreTest.cc.
References a, CLHEP::HepRandomEngine::newEngine(), and output().
int anonymousRestoreStatics | ( | ) |
Definition at line 1088 of file ranRestoreTest.cc.
References captureStatics(), equals(), CLHEP::HepRandomEngine::flat(), CLHEP::HepRandomEngine::name(), output(), randomizeStatics(), restoreStatics(), saveStatics(), and CLHEP::HepRandom::setTheEngine().
int anonymousRestoreStatics1 | ( | ) |
Definition at line 1056 of file ranRestoreTest.cc.
References captureStatics(), CLHEP::HepRandomEngine::name(), output(), randomizeStatics(), restoreStatics(), saveStatics(), and CLHEP::HepRandom::setTheEngine().
std::vector<double> aSequence | ( | int | n | ) |
Definition at line 722 of file ranRestoreTest.cc.
References f(), and CLHEP::detail::n.
Referenced by anonymousRestore1< NonRandomEngine >(), and main().
int BrestoreStep | ( | ) |
Definition at line 218 of file ranRestoreTest.cc.
References output(), remembered_r1005, remembered_r1006, remembered_r1007, remembered_r2, CLHEP::RandFlat::restoreEngineStatus(), and CLHEP::RandFlat::shootBit().
Referenced by main().
int BrestoreStepX | ( | ) |
Definition at line 125 of file ranRestoreTest.cc.
References output(), remembered_r1005, remembered_r2, CLHEP::HepRandom::restoreEngineStatus(), and CLHEP::RandFlat::shootBit().
Referenced by main().
int BsaveStep | ( | ) |
Definition at line 192 of file ranRestoreTest.cc.
References output(), remembered_r1005, remembered_r1006, remembered_r1007, remembered_r2, CLHEP::RandFlat::saveEngineStatus(), and CLHEP::RandFlat::shootBit().
Referenced by main().
int BsaveStepX | ( | ) |
Definition at line 103 of file ranRestoreTest.cc.
References output(), remembered_r1005, remembered_r2, CLHEP::HepRandom::saveEngineStatus(), CLHEP::RandFlat::shoot(), and CLHEP::RandFlat::shootBit().
Referenced by main().
std::vector<double> captureStatics | ( | ) |
Definition at line 945 of file ranRestoreTest.cc.
References CLHEP::RandBinomial::shoot(), CLHEP::RandChiSquare::shoot(), CLHEP::RandExponential::shoot(), CLHEP::RandFlat::shoot(), CLHEP::RandGamma::shoot(), CLHEP::RandGauss::shoot(), CLHEP::RandGaussQ::shoot(), CLHEP::RandGaussT::shoot(), CLHEP::RandLandau::shoot(), CLHEP::RandSkewNormal::shoot(), CLHEP::RandStudentT::shoot(), CLHEP::RandBreitWigner::shoot(), CLHEP::RandPoisson::shoot(), CLHEP::RandPoissonQ::shoot(), CLHEP::RandPoissonT::shoot(), CLHEP::RandBit::shootBit(), and CLHEP::RandFlat::shootBit().
Referenced by anonymousRestoreStatics(), anonymousRestoreStatics1(), and main().
int checkDistributions | ( | ) |
Definition at line 535 of file ranRestoreTest.cc.
int checkEngine | ( | ) |
Definition at line 388 of file ranRestoreTest.cc.
int checkEngineInstanceSave | ( | E & | e | ) |
Definition at line 400 of file ranRestoreTest.cc.
References equals(), and output().
Referenced by main().
int checkEngineName | ( | const std::string & | name | ) |
Definition at line 370 of file ranRestoreTest.cc.
References output().
int checkRandGeneralDistribution | ( | RandGeneral & | d, |
int | nth | ||
) |
Definition at line 482 of file ranRestoreTest.cc.
References CLHEP::RandGeneral::engine(), equals(), CLHEP::RandGeneral::name(), CLHEP::HepRandomEngine::name(), and output().
int checkSaveDistribution | ( | D & | d, |
int | nth | ||
) |
Definition at line 430 of file ranRestoreTest.cc.
int checkSaveEngine | ( | const char * | filename | ) |
Definition at line 334 of file ranRestoreTest.cc.
References equals().
int checkSharing | ( | ) |
Definition at line 704 of file ranRestoreTest.cc.
int checkSharingDistributions | ( | D1 & | d1, |
D2 & | d2, | ||
int | n1, | ||
int | n2 | ||
) |
Definition at line 628 of file ranRestoreTest.cc.
Definition at line 56 of file ranRestoreTest.cc.
References a, b, and equals01().
Referenced by anonymousRestoreStatics(), checkEngineInstanceSave(), checkRandGeneralDistribution(), checkSaveDistribution(), checkSaveEngine(), checkSharingDistributions(), restoreStep(), and restoreStepX().
bool equals01 | ( | const std::vector< double > & | ab | ) |
Definition at line 53 of file ranRestoreTest.cc.
Referenced by equals().
int fileNotThere | ( | ) |
Definition at line 260 of file ranRestoreTest.cc.
References output().
int fileNotThereEngine | ( | ) |
Definition at line 274 of file ranRestoreTest.cc.
int main | ( | ) |
Definition at line 1242 of file ranRestoreTest.cc.
References aSequence(), BrestoreStep(), BrestoreStepX(), BsaveStep(), BsaveStepX(), captureStatics(), checkEngineInstanceSave(), CLHEP::HepRandom::getTheEngine(), missingFile(), CLHEP::HepRandomEngine::name(), output(), randomizeStatics(), restoreStatics(), restoreStep(), restoreStepX(), saveStatics(), saveStep(), saveStepX(), CLHEP::NonRandomEngine::setRandomSequence(), and CLHEP::RandGaussQ::shoot().
int missingFile | ( | ) |
Definition at line 295 of file ranRestoreTest.cc.
Referenced by main().
std::ofstream output | ( | "ranRestoreTest.cout" | ) |
Referenced by anonymousRestore1(), anonymousRestore1< NonRandomEngine >(), anonymousRestore2(), anonymousRestoreStatics(), anonymousRestoreStatics1(), BrestoreStep(), BrestoreStepX(), BsaveStep(), BsaveStepX(), check_sequence(), checkEngineInstanceSave(), checkEngineName(), checkRandGeneralDistribution(), checkSaveDistribution(), checkSharingDistributions(), compareSamples(), fileNotThere(), main(), restoreStep(), restoreStepX(), saveStep(), saveStepX(), staticSave(), staticSaveShootBit(), valid_range(), vectorRestore1(), and vectorRestore2().
void randomizeStatics | ( | int | n | ) |
Definition at line 922 of file ranRestoreTest.cc.
References CLHEP::detail::n, CLHEP::RandBinomial::shoot(), CLHEP::RandChiSquare::shoot(), CLHEP::RandExponential::shoot(), CLHEP::RandFlat::shoot(), CLHEP::RandGamma::shoot(), CLHEP::RandGauss::shoot(), CLHEP::RandGaussQ::shoot(), CLHEP::RandGaussT::shoot(), CLHEP::RandLandau::shoot(), CLHEP::RandSkewNormal::shoot(), CLHEP::RandStudentT::shoot(), CLHEP::RandBreitWigner::shoot(), CLHEP::RandPoisson::shoot(), CLHEP::RandPoissonQ::shoot(), CLHEP::RandPoissonT::shoot(), CLHEP::RandBit::shootBit(), and CLHEP::RandFlat::shootBit().
Referenced by anonymousRestoreStatics(), anonymousRestoreStatics1(), and main().
void restoreStatics | ( | std::string | filename | ) |
Definition at line 978 of file ranRestoreTest.cc.
References CLHEP::HepRandom::restoreStaticRandomStates().
Referenced by anonymousRestoreStatics(), anonymousRestoreStatics1(), and main().
int restoreStep | ( | ) |
Definition at line 167 of file ranRestoreTest.cc.
References equals(), output(), remembered_r1005, remembered_r2, CLHEP::RandGauss::restoreEngineStatus(), and CLHEP::RandGauss::shoot().
Referenced by main().
int restoreStepX | ( | ) |
Definition at line 83 of file ranRestoreTest.cc.
References equals(), output(), remembered_r1005, remembered_r2, CLHEP::HepRandom::restoreEngineStatus(), and CLHEP::RandGauss::shoot().
Referenced by main().
int saveEngine | ( | const char * | filename | ) |
Definition at line 315 of file ranRestoreTest.cc.
void saveStatics | ( | std::string | filename | ) |
Definition at line 970 of file ranRestoreTest.cc.
References CLHEP::HepRandom::saveStaticRandomStates().
Referenced by anonymousRestoreStatics(), anonymousRestoreStatics1(), and main().
int saveStep | ( | ) |
Definition at line 147 of file ranRestoreTest.cc.
References output(), remembered_r1005, remembered_r2, CLHEP::RandGauss::saveEngineStatus(), and CLHEP::RandGauss::shoot().
Referenced by main().
int saveStepX | ( | ) |
Definition at line 64 of file ranRestoreTest.cc.
References output(), remembered_r1005, remembered_r2, CLHEP::HepRandom::saveEngineStatus(), and CLHEP::RandGauss::shoot().
Referenced by main().
int staticSave | ( | int | n | ) |
Definition at line 735 of file ranRestoreTest.cc.
References CLHEP::detail::n, and output().
int staticSaveShootBit | ( | int | n | ) |
Definition at line 809 of file ranRestoreTest.cc.
References CLHEP::detail::n, and output().
int vectorRestore | ( | int | n | ) |
Definition at line 1229 of file ranRestoreTest.cc.
References CLHEP::detail::n.
std::vector<unsigned long> vectorRestore1 | ( | int | n, |
std::vector< double > & | v | ||
) |
Definition at line 1155 of file ranRestoreTest.cc.
References CLHEP::detail::n, and output().
std::vector<unsigned long> vectorRestore1< NonRandomEngine > | ( | int | n, |
std::vector< double > & | v | ||
) |
Definition at line 1155 of file ranRestoreTest.cc.
int vectorRestore2 | ( | const std::vector< unsigned long > | state, |
const std::vector< double > & | v | ||
) |
Definition at line 1190 of file ranRestoreTest.cc.
References a, CLHEP::HepRandomEngine::newEngine(), and output().
double remembered_r1005 |
Definition at line 48 of file ranRestoreTest.cc.
Referenced by BrestoreStep(), BrestoreStepX(), BsaveStep(), BsaveStepX(), restoreStep(), restoreStepX(), saveStep(), and saveStepX().
double remembered_r1006 |
Definition at line 49 of file ranRestoreTest.cc.
Referenced by BrestoreStep(), and BsaveStep().
double remembered_r1007 |
Definition at line 50 of file ranRestoreTest.cc.
Referenced by BrestoreStep(), and BsaveStep().
double remembered_r2 |
Definition at line 47 of file ranRestoreTest.cc.
Referenced by BrestoreStep(), BrestoreStepX(), BsaveStep(), BsaveStepX(), restoreStep(), restoreStepX(), saveStep(), and saveStepX().