00001
00002
00003 #include "PhysicsTools/StatPatternRecognition/interface/SprExperiment.hh"
00004 #include "PhysicsTools/StatPatternRecognition/interface/SprRandomNumber.hh"
00005
00006 #include <sys/time.h>
00007
00008 using namespace std;
00009
00010 int SprRandomNumber::timeSeed(int seed)
00011 {
00012 if( seed < 0 ) {
00013 struct timeval tp;
00014 gettimeofday(&tp, 0);
00015 return tp.tv_usec;
00016 }
00017 return seed;
00018 }
00019
00020 void SprRandomNumber::init(int seed)
00021 {
00022 theRanluxEngine_.setSeed(this->timeSeed(seed));
00023 }
00024
00025 void SprRandomNumber::sequence(double* seq, int npts)
00026 {
00027
00028
00029 theRanluxEngine_.flatArray(npts, seq);
00030 }