Changeset View
Changeset View
Standalone View
Standalone View
src/EvtGenBase/EvtRandom.cpp
Show All 26 Lines | |||||
#include <iostream> | #include <iostream> | ||||
#include <math.h> | #include <math.h> | ||||
#include <stdio.h> | #include <stdio.h> | ||||
#include <stdlib.h> | #include <stdlib.h> | ||||
using std::endl; | using std::endl; | ||||
EvtRandomEngine* EvtRandom::_randomEngine = 0; | EvtRandomEngine* EvtRandom::_randomEngine = nullptr; | ||||
void EvtRandom::setRandomEngine( EvtRandomEngine* randomEngine ) | void EvtRandom::setRandomEngine( EvtRandomEngine* randomEngine ) | ||||
{ | { | ||||
_randomEngine = randomEngine; | _randomEngine = randomEngine; | ||||
} | } | ||||
double EvtRandom::random() | double EvtRandom::random() | ||||
{ | { | ||||
if ( _randomEngine == 0 ) { | if ( _randomEngine == nullptr ) { | ||||
EvtGenReport( EVTGEN_ERROR, "EvtGen" ) | EvtGenReport( EVTGEN_ERROR, "EvtGen" ) | ||||
<< "No random engine available in " | << "No random engine available in " | ||||
<< "EvtRandom::random()." << endl; | << "EvtRandom::random()." << endl; | ||||
::abort(); | ::abort(); | ||||
} | } | ||||
return _randomEngine->random(); | return _randomEngine->random(); | ||||
} | } | ||||
Show All 31 Lines |