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

ScaledRandom Class Reference

#include <newran.h>

Inheritance diagram for ScaledRandom:

Inheritance graph
[legend]
Collaboration diagram for ScaledRandom:

Collaboration graph
[legend]

Public Member Functions

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

Protected Member Functions

 ScaledRandom (Random &rvx, Real sx)
void tDelete ()

Protected Attributes

Randomrv
Real s

Friends

ScaledRandomoperator * (Real, Random &)
ScaledRandomoperator * (Random &, Real)
ScaledRandomoperator/ (Random &, Real)

Constructor & Destructor Documentation

ScaledRandom::ScaledRandom Random rvx,
Real  sx
[inline, protected]
 

Definition at line 391 of file newran.h.

00391 : rv(&rvx), s(sx) {}


Member Function Documentation

ExtReal ScaledRandom::Mean  )  const [virtual]
 

Reimplemented from Random.

Reimplemented in ShiftedRandom, and ReverseShiftedRandom.

Definition at line 639 of file newran.cpp.

References Random::Mean(), rv, and s.

00639 { return rv->Mean() * s; }

Real ScaledRandom::Next  )  [virtual]
 

Reimplemented from Random.

Reimplemented in ShiftedRandom, and ReverseShiftedRandom.

Definition at line 637 of file newran.cpp.

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

00637 { return rv->Next() * s; }

void ScaledRandom::tDelete  )  [inline, protected, virtual]
 

Reimplemented from Random.

Definition at line 392 of file newran.h.

References tron.

00393    { 
00394    #ifdef MONITOR
00395       tron << "destructing ScaledRandom\n";
00396    #endif
00397            rv->tDelete(); delete this; 
00398    }

ExtReal ScaledRandom::Variance  )  const [virtual]
 

Reimplemented from Random.

Reimplemented in ShiftedRandom, and ReverseShiftedRandom.

Definition at line 641 of file newran.cpp.

References rv, s, and Random::Variance().

00641 { return rv->Variance() * (s*s); }


Friends And Related Function Documentation

ScaledRandom& operator * Random rv,
Real  s
[friend]
 

Definition at line 685 of file newran.cpp.

00686 {
00687    ScaledRandom* r = new ScaledRandom(rv, s);
00688    if (!r) ErrorNoSpace(); return *r;
00689 }

ScaledRandom& operator * Real  s,
Random rv
[friend]
 

Definition at line 703 of file newran.cpp.

00704 {
00705    ScaledRandom* r = new ScaledRandom(rv, s);
00706    if (!r) ErrorNoSpace(); return *r;
00707 }

ScaledRandom& operator/ Random rv,
Real  s
[friend]
 

Definition at line 709 of file newran.cpp.

00710 {
00711    ScaledRandom* r = new ScaledRandom(rv, 1.0/s);
00712    if (!r) ErrorNoSpace(); return *r;
00713 }


Field Documentation

Random* ScaledRandom::rv [protected]
 

Definition at line 390 of file newran.h.

Referenced by ReverseShiftedRandom::Mean(), ShiftedRandom::Mean(), Mean(), ReverseShiftedRandom::Next(), ShiftedRandom::Next(), Next(), ReverseShiftedRandom::Variance(), ShiftedRandom::Variance(), and Variance().

Real ScaledRandom::s [protected]
 

Definition at line 390 of file newran.h.

Referenced by ReverseShiftedRandom::Mean(), ShiftedRandom::Mean(), Mean(), ReverseShiftedRandom::Next(), ShiftedRandom::Next(), Next(), and Variance().


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