#include <newran.h>
Inheritance diagram for MixedRandom:


Public Member Functions | |
| char * | Name () |
| MixedRandom (int, Real *, Random **) | |
| MixedRandom (AddedSelectedRandom &) | |
| virtual | ~MixedRandom () |
| Real | Next () |
| ExtReal | Mean () const |
| ExtReal | Variance () const |
Private Member Functions | |
| void | operator= (const MixedRandom &) |
| void | Build (Real *) |
Private Attributes | |
| int | n |
| DiscreteGen * | dg |
| Random ** | rv |
| ExtReal | mean |
| ExtReal | var |
|
||||||||||||||||
|
Definition at line 812 of file newran.cpp. References Build(), ErrorNoSpace(), n, and rv.
|
|
|
Definition at line 820 of file newran.cpp. References Build(), ErrorNoSpace(), AddedSelectedRandom::load(), n, AddedSelectedRandom::nelems(), Real, and rv.
|
|
|
Definition at line 845 of file newran.cpp. References dg, n, rv, and Random::tDelete().
|
|
|
Definition at line 829 of file newran.cpp. References dg, ErrorNoSpace(), mean, n, rv, square(), and var. Referenced by MixedRandom().
00830 {
00831 int i;
00832 dg=new DiscreteGen(n,probs);
00833 if (!dg) ErrorNoSpace();
00834 mean=0.0; var=0.0;
00835 for (i=0; i<n; i++) mean = mean + (rv[i])->Mean()*probs[i];
00836 for (i=0; i<n; i++)
00837 {
00838 ExtReal sigsq=(rv[i])->Variance();
00839 ExtReal mudif=(rv[i])->Mean()-mean;
00840 var = var + (sigsq+square(mudif))*probs[i];
00841 }
00842
00843 }
|
|
|
Reimplemented from Random. Definition at line 641 of file newran.h.
00641 { return mean; }
|
|
|
Reimplemented from Random. Definition at line 922 of file newran.cpp.
00922 { return "MixedRandom"; }
|
|
|
Reimplemented from Random. Definition at line 851 of file newran.cpp. References dg, DiscreteGen::Next(), Real, and rv.
|
|
|
Definition at line 628 of file newran.h.
00628 {} // private so can't access
|
|
|
Reimplemented from Random. Definition at line 642 of file newran.h.
00642 { return var; }
|
|
|
Definition at line 630 of file newran.h. Referenced by Build(), Next(), and ~MixedRandom(). |
|
|
Definition at line 632 of file newran.h. Referenced by Build(). |
|
|
Definition at line 629 of file newran.h. Referenced by Build(), MixedRandom(), and ~MixedRandom(). |
|
|
Definition at line 631 of file newran.h. Referenced by Build(), MixedRandom(), Next(), and ~MixedRandom(). |
|
|
Definition at line 632 of file newran.h. Referenced by Build(). |
1.3.3