ROOT » MATH » UNURAN » TUnuran

class TUnuran

Function Members (Methods)

public:
~TUnuran()
TRandom*GetRandom()
boolInit(const string& distr, const string& method)
boolInit(const TUnuranContDist& distr, const string& method = "auto")
boolInit(const TUnuranMultiContDist& distr, const string& method = "hitro")
boolInit(const TUnuranDiscrDist& distr, const string& method = "auto")
boolInit(const TUnuranEmpDist& distr, const string& method = "empk")
boolInitBinomial(unsigned int ntot, double prob, const string& method = "dstd")
boolInitPoisson(double mu, const string& method = "dstd")
const string&MethodName() const
boolReInitDiscrDist(unsigned int npar, double* params)
doubleSample()
intSampleDiscr()
boolSampleMulti(double* x)
boolSetLogLevel(unsigned int iflag = 1)
boolSetLogStream()
voidSetRandom(TRandom* r)
voidSetSeed(unsigned int seed)
TUnuran(TRandom* r = 0, unsigned int log = 0)
private:
TUnuran&operator=(const TUnuran& rhs)
TUnuran(const TUnuran&)

Data Members

protected:
auto_ptr<TUnuranBaseDist>fDistpointer for distribution wrapper
UNUR_GEN*fGenpointer to the UnuRan C generator struct
stringfMethodstring representing the method
TRandom*fRngpointer to ROOT random number generator
UNUR_DISTR*fUdistrpointer to the UnuRan C distribution struct
UNUR_URNG*fUrngpointer to Unuran C random generator struct

Class Charts

Inheritance Inherited Members Includes Libraries
Class Charts

Function documentation

TUnuran(TRandom* r = 0, unsigned int log = 0)
 constructor implementation with a ROOT random generator
 if no generator is given the ROOT default is used
~TUnuran()
 Destructor implementation
TUnuran(const TUnuran& )
 Implementation of copy constructor.
bool Init(const std::string & dist, const std::string & method)
 initialize with a string
bool Init(const TUnuranContDist& distr, const string& method = "auto")
 initialization with a distribution and and generator
 the distribution object is copied in and managed by this class
 use auto_ptr to manage previously existing distribution objects
bool Init(const TUnuranMultiContDist& distr, const string& method = "hitro")
  initialization with a distribution and method
 the distribution object is copied in and managed by this class
 use auto_ptr to manage previously existing distribution objects
bool Init(const TUnuranDiscrDist& distr, const string& method = "auto")
   initialization with a distribution and and generator
 the distribution object is copied in and managed by this class
 use auto_ptr to manage previously existing distribution objects
bool Init(const TUnuranEmpDist& distr, const string& method = "empk")
   initialization with a distribution and and generator
 the distribution object is copied in and managed by this class
 use auto_ptr to manage previously existing distribution objects
bool SetRandomGenerator()
 set an external random generator
bool SetContDistribution(const TUnuranContDist& dist)
 internal method to set in unuran the function pointer for a continuous univariate distribution
bool SetMultiDistribution(const TUnuranMultiContDist& dist)
 internal method to set in unuran the function pointer for a multivariate distribution
bool SetEmpiricalDistribution(const TUnuranEmpDist& dist)
bool SetDiscreteDistribution(const TUnuranDiscrDist& dist)
 internal method to set in unuran the function pointer for a discrete univariate distribution
bool SetMethodAndInit()
int SampleDiscr()
 sample one-dimensional distribution
double Sample()
 sample one-dimensional distribution
bool SampleMulti(double* x)
 sample multidimensional distribution
void SetSeed(unsigned int seed)
bool SetLogLevel(unsigned int iflag = 1)
bool InitPoisson(double mu, const string& method = "dstd")
 initializaton for a Poisson
bool InitBinomial(unsigned int ntot, double prob, const string& method = "dstd")
 initializaton for a Binomial
bool ReInitDiscrDist(unsigned int npar, double* params)
 re-initialization of UNURAN without freeing and creating a new fGen object
 works only for pre-defined distribution by changing their parameters
void SetRandom(TRandom* r)
      set the random engine.
      Must be called before init to have effect

TRandom * GetRandom()
      return instance of the random engine used

bool SetLogStream()
      set stream for log and error (not yet implemented)

{ return false;}
const std::string & MethodName() const
      used Unuran method

{ return fMethod; }