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

RepeatedRandom Class Reference

#include <newran.h>

Inheritance diagram for RepeatedRandom:

Inheritance graph
[legend]
Collaboration diagram for RepeatedRandom:

Collaboration graph
[legend]

Public Member Functions

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

Private Member Functions

void tDelete ()
 RepeatedRandom (Random &rvx, int nx)

Private Attributes

Randomrv
int n

Friends

class Random

Constructor & Destructor Documentation

RepeatedRandom::RepeatedRandom Random rvx,
int  nx
[inline, private]
 

Definition at line 463 of file newran.h.

00463 : rv(&rvx), n(nx) {}


Member Function Documentation

ExtReal RepeatedRandom::Mean  )  const [virtual]
 

Reimplemented from Random.

Definition at line 657 of file newran.cpp.

References Random::Mean(), n, Real, and rv.

00657 { return rv->Mean() * (Real)n; }

Real RepeatedRandom::Next  )  [virtual]
 

Reimplemented from Random.

Definition at line 809 of file newran.cpp.

References n, Random::Next(), Real, and rv.

00810    { Real sum=0.0; for (int i=0; i<n; i++) sum+=rv->Next(); return sum; }

void RepeatedRandom::tDelete  )  [inline, private, virtual]
 

Reimplemented from Random.

Definition at line 456 of file newran.h.

References tron.

00457    { 
00458    #ifdef MONITOR
00459       tron << "destructing RepeatedRandom\n";
00460    #endif
00461            rv->tDelete(); delete this; 
00462    }

ExtReal RepeatedRandom::Variance  )  const [virtual]
 

Reimplemented from Random.

Definition at line 659 of file newran.cpp.

References n, Real, rv, and Random::Variance().

00659 { return rv->Variance() * (Real)n; }


Friends And Related Function Documentation

friend class Random [friend]
 

Definition at line 469 of file newran.h.


Field Documentation

int RepeatedRandom::n [private]
 

Definition at line 455 of file newran.h.

Referenced by Mean(), Next(), and Variance().

Random* RepeatedRandom::rv [private]
 

Definition at line 455 of file newran.h.

Referenced by Mean(), Next(), and Variance().


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