Main Page | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals

Poisson1 Class Reference

Inheritance diagram for Poisson1:

Inheritance graph
[legend]
Collaboration diagram for Poisson1:

Collaboration graph
[legend]

Public Member Functions

 Poisson1 (Real)
Real Density (Real) const
Real Next ()
ExtReal Mean () const
ExtReal Variance () const

Private Attributes

Real mu
Real ln_mu

Constructor & Destructor Documentation

Poisson1::Poisson1 Real   ) 
 

Definition at line 416 of file newran.cpp.

References ln_mu, and mu.

00416                            : AsymGen(mux)      // Constructor
00417 { mu=mux; ln_mu=log(mu); }


Member Function Documentation

Real Poisson1::Density Real   )  const [virtual]
 

Reimplemented from Random.

Definition at line 419 of file newran.cpp.

References ln_gamma(), and Real.

00420 {
00421    if (x < 0.0) return 0.0;
00422    double ix = floor(x);                         // use integer part
00423    double l = ln_mu * ix - mu - ln_gamma(1.0 + ix);
00424    return  (l < -40.0) ? 0.0 : exp(l);
00425 }

ExtReal Poisson1::Mean  )  const [inline, virtual]
 

Reimplemented from AsymGen.

Definition at line 42 of file newran.cpp.

00042 { return mu; }

Real Poisson1::Next  )  [inline, virtual]
 

Reimplemented from AsymGen.

Definition at line 41 of file newran.cpp.

References AsymGen::Next(), and Real.

00041 { return floor(AsymGen::Next()); }

ExtReal Poisson1::Variance  )  const [inline, virtual]
 

Reimplemented from AsymGen.

Definition at line 43 of file newran.cpp.

00043 { return mu; }


Field Documentation

Real Poisson1::ln_mu [private]
 

Definition at line 37 of file newran.cpp.

Referenced by Poisson1().

Real Poisson1::mu [private]
 

Definition at line 37 of file newran.cpp.

Referenced by Poisson1().


The documentation for this class was generated from the following file:
Generated on Fri Dec 5 04:06:31 2003 for Borqueror by doxygen 1.3.3