#include <ProbaHolder.h>
Collaboration diagram for DiscreteProba:
Public Member Functions | |
DiscreteProba (void) | |
~DiscreteProba (void) | |
void | Setup (vector< double > &aP, const int an, const int aNr=10000) |
const int | Next (void) |
Data Fields | |
Real * | P |
int | n |
int | Nr |
Random * | rand |
Normal | nn |
Real * | a |
Real | count |
Real | maxn |
Real | minn |
Private Member Functions | |
void | Reset (void) |
Private Attributes | |
int | at |
|
Definition at line 109 of file ProbaHolder.h. References a, at, count, maxn, minn, P, and rand.
|
|
Definition at line 114 of file ProbaHolder.h.
|
|
Definition at line 145 of file ProbaHolder.h. References a, at, Nr, P, and Real.
|
|
Definition at line 164 of file ProbaHolder.h. References a, at, P, and rand. Referenced by Setup(), and ~DiscreteProba().
|
|
Generates a discrete sample according to the P of occurence determined by aP and for the upper boundary an. The sample will generates aNr numbers that will be converted to discrete Probability Definition at line 125 of file ProbaHolder.h. References a, count, maxn, minn, n, Random::Next(), Nr, P, rand, Real, and Reset(). Referenced by PDiscrete::Setup().
00126 { 00127 Nr = aNr; 00128 Reset(); 00129 count = an - 0.001; 00130 P = new Real[ an ]; 00131 for( int j = 0 ; j < an ; j++ ) 00132 P[j] = aP[j]; 00133 n = an; 00134 00135 a = new Real[ aNr ]; 00136 rand = new DiscreteGen( n , P ); 00137 maxn = minn = a[0] = rand->Next(); 00138 for( int i = 1 ; i < aNr ; i++ ) 00139 { 00140 a[i] = rand->Next(); 00141 minn = min( minn , a[i] ); 00142 maxn = max( maxn , a[i] ); 00143 } 00144 } |
|
Definition at line 106 of file ProbaHolder.h. Referenced by DiscreteProba(), Next(), Reset(), and Setup(). |
|
Definition at line 163 of file ProbaHolder.h. Referenced by DiscreteProba(), Next(), and Reset(). |
|
Definition at line 106 of file ProbaHolder.h. Referenced by DiscreteProba(), and Setup(). |
|
Definition at line 107 of file ProbaHolder.h. Referenced by DiscreteProba(), and Setup(). |
|
Definition at line 107 of file ProbaHolder.h. Referenced by DiscreteProba(), and Setup(). |
|
Definition at line 102 of file ProbaHolder.h. Referenced by Setup(). |
|
Definition at line 104 of file ProbaHolder.h. |
|
Definition at line 102 of file ProbaHolder.h. |
|
Definition at line 101 of file ProbaHolder.h. Referenced by DiscreteProba(), Next(), Reset(), and Setup(). |
|
Definition at line 103 of file ProbaHolder.h. Referenced by DiscreteProba(), Reset(), and Setup(). |