Go to the previous, next section.

CNDiracTab -- Distribution from Table of CDF

SYNOPSIS

#include <CNCL/DiracTab.h>

TYPE

CN_DIRACTAB

BASE CLASSES

CNRandom

DERIVED CLASSES

None

RELATED CLASSES

CNRNG

DESCRIPTION

CNDiracTab generates random numbers according to a table with the distribution function.

Constructors:

CNDiracTab();
CNDiracTab(CNParam *param);
CNDiracTab(CNDiracTabEntry *tab, long length, CNRNG *gen);
Initializes a CNDiracTab distribution with a base random number generator gen and a table tab with length length.

Example:

CNDiracTabEntry datafield[] = {{ 0.1, 2 },{ 0.3, 4 }, { 0.6, 6 }};
CNDiracTab example(datafield, 3, &generator);

In addition to the member functions required by CNCL, CNDiracTab provides:

virtual double operator() ();
Draws a random number.

Go to the previous, next section.