#include "TUnuran.h"#include "TUnuranDiscrDist.h"#include "TH1.h"#include "TMath.h"#include "TF1.h"#include "TRandom3.h"#include "TApplication.h"#include "TCanvas.h"#include "TStopwatch.h"#include "TError.h"#include "Math/Functor.h"#include "Math/DistFunc.h"#include "Math/Util.h"#include <iostream>#include <iomanip>Go to the source code of this file.
Functions | |
| double | poisson_pmf (double *x, double *p) |
| double | binomial_pmf (double *x, double *p) |
| int | testUnuran (TUnuran &unr, double &time, TH1 *h1, const TH1 *href, bool weightHist=false) |
| int | testRootPoisson (double mu, double &time, TH1 *h2) |
| int | testRootBinomial (int m, double p, double &time, TH1 *h2) |
| int | testProbVector () |
| int | testPoisson () |
| int | testBinomial () |
| int | unuranDiscrete () |
| int | main (int argc, char **argv) |
Variables | |
| int | n = 1000000 |
| TCanvas * | c1 |
| int | icanv = 1 |
| bool | useRandomSeed = false |
Definition at line 52 of file unuranDiscrete.cxx.
References ROOT::Math::binomial_pdf(), and y.
Referenced by testBinomial().
| int main | ( | int | argc, | |
| char ** | argv | |||
| ) |
Definition at line 451 of file unuranDiscrete.cxx.
References TApplication::Run(), and unuranDiscrete().
Definition at line 46 of file unuranDiscrete.cxx.
References ROOT::Math::poisson_pdf(), and y.
Referenced by testPoisson().
| int testBinomial | ( | ) |
Definition at line 318 of file unuranDiscrete.cxx.
References binomial_pmf(), c1, TCanvas::cd(), ROOT::Math::gv_detail::dist(), TH1D::DrawCopy(), E, TH1::Fill(), gRandom, h2, i, icanv, TUnuran::Init(), TUnuran::InitBinomial(), k, kBlue, TUnuran::MethodName(), n, par, TUnuran::ReInitDiscrDist(), s, TUnuran::SampleDiscr(), TAttLine::SetLineColor(), testRootBinomial(), testUnuran(), TCanvas::Update(), and w.
| int testPoisson | ( | ) |
Definition at line 199 of file unuranDiscrete.cxx.
References c1, TCanvas::cd(), TFile::Close(), TH1D::DrawCopy(), E, f2, TH1::Fill(), gRandom, h2, i, icanv, TUnuran::Init(), TUnuran::InitPoisson(), k, kBlue, TUnuran::MethodName(), n, p, poisson_pmf(), TUnuran::ReInitDiscrDist(), s, TUnuran::SampleDiscr(), TAttLine::SetLineColor(), TUnuranDiscrDist::SetMode(), TUnuranDiscrDist::SetProbSum(), testRootPoisson(), testUnuran(), TCanvas::Update(), w, and TObject::Write().
| int testProbVector | ( | ) |
Definition at line 143 of file unuranDiscrete.cxx.
References c1, TCanvas::cd(), ROOT::Math::gv_detail::dist(), TH1::Draw(), TH1::GetSumOfWeights(), gRandom, h1, i, icanv, TUnuran::Init(), kBlue, p, TH1::Scale(), TH1D::SetBinContent(), TH1::SetBinError(), TAttLine::SetLineColor(), TH1::Sumw2(), testUnuran(), and TCanvas::Update().
Referenced by unuranDiscrete().
Definition at line 121 of file unuranDiscrete.cxx.
References TRandom::Binomial(), TH2::Fill(), gRandom, h2, i, n, s, and w.
Referenced by testBinomial().
Definition at line 100 of file unuranDiscrete.cxx.
References TH2::Fill(), gRandom, h2, i, n, TRandom::Poisson(), s, and w.
Referenced by testPoisson().
| int testUnuran | ( | TUnuran & | unr, | |
| double & | time, | |||
| TH1 * | h1, | |||
| const TH1 * | href, | |||
| bool | weightHist = false | |||
| ) |
Definition at line 59 of file unuranDiscrete.cxx.
References TH1::Chi2Test(), E, TH2::Fill(), h1, i, TUnuran::MethodName(), n, TH2D::Reset(), s, TUnuran::SampleDiscr(), w, and x.
Referenced by testBinomial(), testPoisson(), testProbVector(), unuranMulti2D(), and unuranMultiDim().
| int unuranDiscrete | ( | ) |
Definition at line 423 of file unuranDiscrete.cxx.
References c1, TPad::Divide(), gErrorIgnoreLevel, gRandom, TRandom::SetSeed(), testBinomial(), testPoisson(), testProbVector(), and useRandomSeed.
Referenced by main().
Definition at line 41 of file unuranDiscrete.cxx.
| int icanv = 1 |
Definition at line 42 of file unuranDiscrete.cxx.
Referenced by testBinomial(), testPoisson(), and testProbVector().
| int n = 1000000 |
Definition at line 39 of file unuranDiscrete.cxx.
| bool useRandomSeed = false |
Definition at line 44 of file unuranDiscrete.cxx.
Referenced by unuranDiscrete(), unuranDistr(), unuranMulti2D(), and unuranMultiDim().
1.5.1