gslmm::pascal Class Reference
[Distributions]

#include <gslmm/random/pascal.hh>

Inheritance diagram for gslmm::pascal:

Inheritance graph
[legend]
Collaboration diagram for gslmm::pascal:

Collaboration graph
[legend]
List of all members.

Detailed Description

Pascal distribution interface class.

This is the same as gslmm::negative_binomal, except $ n$ is an integer.

The Pascal PDF is

\[ p(k) = {(n + k - 1)! \over k! (n - 1)! } p^n (1-p)^k \]

for $ k \geq 0$

Examples:

random/distribution-test.cc.


Public Member Functions

 pascal (double p, size_t n, generator &r)
virtual ~pascal ()
virtual return_type sample ()
virtual double pdf (const return_type &k)

Protected Types

typedef distribution< size_t > base_type

Protected Attributes

double _p
size_t _n


Member Typedef Documentation

typedef distribution<size_t> gslmm::pascal::base_type [protected]
 

The base type.


Constructor & Destructor Documentation

gslmm::pascal::pascal double  p,
size_t  n,
generator r
[inline]
 

Constructor.

Parameters:
p The probability parameter
n The number parameter
r The random number generator

virtual gslmm::pascal::~pascal  )  [inline, virtual]
 

Destructor.


Member Function Documentation

virtual double gslmm::pascal::pdf const return_type k  )  [inline, virtual]
 

See also:
gslmm::distribution<Return,Arg>::pdf

virtual return_type gslmm::pascal::sample  )  [inline, virtual]
 

Sample the distribution.

Returns:
The sample.

Implements gslmm::distribution< size_t >.


Member Data Documentation

size_t gslmm::pascal::_n [protected]
 

Parameter n of the distribution.

double gslmm::pascal::_p [protected]
 

Probability of the distribution.


The documentation for this class was generated from the following file:
Top of page Last update Tue May 9 10:11:33 2006
Christian Holm
Created by DoxyGen 1.4.6