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

SubtractedRandom Class Reference

#include <newran.h>

Inheritance diagram for SubtractedRandom:

Inheritance graph
[legend]
Collaboration diagram for SubtractedRandom:

Collaboration graph
[legend]

Public Member Functions

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

Private Member Functions

 SubtractedRandom (Random &rv1x, Random &rv2x)

Friends

SubtractedRandomoperator- (Random &, Random &)

Constructor & Destructor Documentation

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

Definition at line 517 of file newran.h.

00518       : MultipliedRandom(rv1x, rv2x) {}


Member Function Documentation

ExtReal SubtractedRandom::Mean  )  const [virtual]
 

Reimplemented from MultipliedRandom.

Definition at line 774 of file newran.cpp.

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

00774 { return rv1->Mean() - rv2->Mean() ; }

Real SubtractedRandom::Next  )  [virtual]
 

Reimplemented from MultipliedRandom.

Definition at line 772 of file newran.cpp.

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

00772 { return rv1->Next() - rv2->Next() ; }

ExtReal SubtractedRandom::Variance  )  const [virtual]
 

Reimplemented from MultipliedRandom.

Definition at line 776 of file newran.cpp.

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

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


Friends And Related Function Documentation

SubtractedRandom& operator- Random rv1,
Random rv2
[friend]
 

Definition at line 739 of file newran.cpp.

00740 {
00741    SubtractedRandom* r = new SubtractedRandom(rv1, rv2);
00742    if (!r) ErrorNoSpace(); return *r;
00743 }


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