Документ взят из кэша поисковой машины. Адрес оригинального документа : http://www.atnf.csiro.au/computing/software/casacore/casacore-1.2.0/doc/html/classcasa_1_1Binomial.html
Дата изменения: Unknown
Дата индексирования: Mon Feb 14 21:05:21 2011
Кодировка:

Поисковые слова: 3
casacore: casa::Binomial Class Reference
Public Member Functions | Private Attributes

casa::Binomial Class Reference
[BasicMath_module]

Binomial distribution. More...

#include <Random.h>

Inheritance diagram for casa::Binomial:
casa::Random

List of all members.

Public Member Functions

 Binomial (RNG *gen, uInt n=1, Double p=0.5)
 Construct a random number generator for a binomial distribution.
virtual ~Binomial ()
 The destructor is trivial.
virtual Double operator() ()
 Returns a value from the Binomial distribution.
uInt asInt ()
uInt n () const
 Functions that allow you to query and change the parameters of the binomial distribution.
void n (uInt newN)
void n (Double newN)
Double p () const
void p (Double newP)
virtual void setParameters (const Vector< Double > &parms)
 These function allow you to manipulate the parameters (n & p) described above through the base class.
virtual Vector< Doubleparameters () const
virtual Bool checkParameters (const Vector< Double > &parms) const

Private Attributes

uInt itsN
Double itsP

Detailed Description

Binomial distribution.

Synopsis

The binomial distribution models successfully drawing items from a pool. n is the number of items in the pool, and p, is the probability of each item being successfully drawn. The operator() functions returns an integral value indicating the number of items actually drawn from the pool. It is possible to get this same value as an integer using the asInt function.

It is assumed that n > 0 and 0 <= p <= 1 an AipsError exception thrown if it is not true. The remaining members allow you to read and set the parameters.

Example

Thrown Exceptions

To Do

Definition at line 581 of file Random.h.


Constructor & Destructor Documentation

casa::Binomial::Binomial ( RNG gen,
uInt  n = 1,
Double  p = 0.5 
)

Construct a random number generator for a binomial distribution.

The first argument is a class that produces random bits. This pointer is NOT taken over by this class and the user is responsible for deleting it. The second and third arguments are the parameters are the Binomial distribution as described in the synopsis.

virtual casa::Binomial::~Binomial (  )  [virtual]

The destructor is trivial.


Member Function Documentation

uInt casa::Binomial::asInt (  ) 
virtual Bool casa::Binomial::checkParameters ( const Vector< Double > &  parms  )  const [virtual]

Implements casa::Random.

void casa::Binomial::n ( Double  newN  ) 
void casa::Binomial::n ( uInt  newN  ) 
uInt casa::Binomial::n (  )  const [inline]

Functions that allow you to query and change the parameters of the binomial distribution.

Definition at line 624 of file Random.h.

References itsN.

virtual Double casa::Binomial::operator() (  )  [virtual]

Returns a value from the Binomial distribution.

The returned value is a non-negative integer and using the asInt function bypasses the conversion to a floating point number.

Implements casa::Random.

Double casa::Binomial::p (  )  const [inline]

Definition at line 628 of file Random.h.

References itsP.

void casa::Binomial::p ( Double  newP  ) 
virtual Vector<Double> casa::Binomial::parameters (  )  const [virtual]

Implements casa::Random.

virtual void casa::Binomial::setParameters ( const Vector< Double > &  parms  )  [virtual]

These function allow you to manipulate the parameters (n & p) described above through the base class.

The Vectors must always be of length two.

Implements casa::Random.


Member Data Documentation

Definition at line 620 of file Random.h.

Referenced by n().

Definition at line 621 of file Random.h.

Referenced by p().


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines