#include "TUnuranContDist.h"
#include "TF1.h"
#include <cassert>
ClassImp(TUnuranContDist)
TUnuranContDist::TUnuranContDist (TF1 * pdf, TF1 * deriv, bool isLogPdf ) :
fPdf(pdf),
fDPdf(deriv),
fCdf(0),
fXmin(1.),
fXmax(-1.),
fMode(0),
fArea(0),
fIsLogPdf(isLogPdf),
fHasDomain(0),
fHasMode(0),
fHasArea(0)
{
}
TUnuranContDist::TUnuranContDist(const TUnuranContDist & rhs) :
TUnuranBaseDist()
{
operator=(rhs);
}
TUnuranContDist & TUnuranContDist::operator = (const TUnuranContDist &rhs)
{
if (this == &rhs) return *this;
fPdf = rhs.fPdf;
fDPdf = rhs.fDPdf;
fCdf = rhs.fCdf;
fXmin = rhs.fXmin;
fXmax = rhs.fXmax;
fMode = rhs.fMode;
fArea = rhs.fArea;
fIsLogPdf = rhs.fIsLogPdf;
fHasDomain = rhs.fHasDomain;
fHasMode = rhs.fHasMode;
fHasArea = rhs.fHasArea;
return *this;
}
double TUnuranContDist::Pdf ( double x) const {
assert(fPdf != 0);
fX[0] = x;
fPdf->InitArgs(fX,(double*)0);
return fPdf->EvalPar(fX);
}
double TUnuranContDist::DPdf( double x) const {
if (fDPdf != 0) {
fX[0] = x;
fDPdf->InitArgs(fX,(double*)0);
return fDPdf->EvalPar(fX);
}
assert(fPdf != 0);
return fPdf->Derivative(x);
}
double TUnuranContDist::Cdf(double x) const {
assert (fCdf != 0);
fX[0] = x;
fCdf->InitArgs(fX,(double*)0);
return fCdf->EvalPar(fX);
}
Last change: Fri Oct 31 16:21:14 2008
Last generated: 2008-10-31 16:21
This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.