/*
 * MTRandomEngine.cc
 *
 *  Created on: Aug 18, 2009
 *      Author: mertens
 */

#include "PndMTRandomEngine.hh"
#include <boost/random/mersenne_twister.hpp>
#include <boost/random/uniform_real.hpp>
#include <boost/random/variate_generator.hpp>

PndMTRandomEngine::PndMTRandomEngine(const unsigned long int& seed, const double& min, const double& max)
: fEngine(static_cast<unsigned long int>(seed)), fRealDist(min, max), fBoostRealDist(fEngine, fRealDist)
{
}

inline void PndMTRandomEngine::seed(const unsigned long int& seed)
{
	fEngine.seed(static_cast<unsigned long int>(seed));
}

inline double PndMTRandomEngine::random()
{
	return fBoostRealDist();
}
