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

AddedRandom Class Reference

#include <newran.h>

Inheritance diagram for AddedRandom:

Inheritance graph
[legend]
Collaboration diagram for AddedRandom:

Collaboration graph
[legend]

Public Member Functions

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

Private Member Functions

 AddedRandom (Random &rv1x, Random &rv2x)

Friends

AddedRandomoperator+ (Random &, Random &)

Constructor & Destructor Documentation

AddedRandom::AddedRandom Random rv1x,
Random rv2x
[inline, private]
 

Definition at line 494 of file newran.h.

00494 : MultipliedRandom(rv1x, rv2x) {}


Member Function Documentation

ExtReal AddedRandom::Mean  )  const [virtual]
 

Reimplemented from MultipliedRandom.

Definition at line 753 of file newran.cpp.

References Random::Mean(), MultipliedRandom::rv1, and MultipliedRandom::rv2.

00753 { return rv1->Mean() + rv2->Mean() ; }

Real AddedRandom::Next  )  [virtual]
 

Reimplemented from MultipliedRandom.

Definition at line 751 of file newran.cpp.

References Random::Next(), Real, MultipliedRandom::rv1, and MultipliedRandom::rv2.

00751 { return rv1->Next() + rv2->Next() ; }

ExtReal AddedRandom::Variance  )  const [virtual]
 

Reimplemented from MultipliedRandom.

Definition at line 755 of file newran.cpp.

References MultipliedRandom::rv1, MultipliedRandom::rv2, and Random::Variance().

00756    { return rv1->Variance() + rv2->Variance() ; }


Friends And Related Function Documentation

AddedRandom& operator+ Random rv1,
Random rv2
[friend]
 

Definition at line 721 of file newran.cpp.

00722 {
00723    AddedRandom* r = new AddedRandom(rv1, rv2);
00724    if (!r) ErrorNoSpace(); return *r;
00725 }


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