00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef CEYLAN_RANDOM_GENERATOR_FROM_PDF_H_
00028 #define CEYLAN_RANDOM_GENERATOR_FROM_PDF_H_
00029
00030
00031 #include "CeylanRandomGenerator.h"
00032
00033
00034 #include <string>
00035
00036
00037
00038 namespace Ceylan
00039 {
00040
00041
00042 namespace Maths
00043 {
00044
00045
00046 namespace Random
00047 {
00048
00049
00050
00051
00052 class WhiteNoiseGenerator ;
00053
00054
00055
00068 class CEYLAN_DLL RandomGeneratorFromPDF : public RandomGenerator
00069 {
00070
00071
00072 public:
00073
00074
00096 RandomGeneratorFromPDF(
00097 const ProbabilityFunction & pdf,
00098 Sample lowerLimit, Sample upperLimit,
00099 Seed aSeed = DefaultSeed ) ;
00100
00101
00102
00104 virtual ~RandomGeneratorFromPDF() throw() ;
00105
00106
00107
00109 virtual RandomValue getNewValue() ;
00110
00111
00112
00114 virtual void reset( Seed neeSeed ) ;
00115
00116
00117
00126 virtual const std::string displayProbabilities() const ;
00127
00128
00129
00142 virtual const std::string toString(
00143 VerbosityLevels level = high ) const ;
00144
00145
00146
00147
00148 protected:
00149
00150
00151
00157 virtual void preCompute() ;
00158
00159
00160
00162 ProbabilityFunction const * _pdf ;
00163
00164
00165
00167 WhiteNoiseGenerator * _whiteNoiseGenerator ;
00168
00169
00170
00176 Probability * _probabilitiesTable ;
00177
00178
00179
00185 Sample * _sampleRangesTable ;
00186
00187
00188 } ;
00189
00190
00191 }
00192
00193 }
00194
00195 }
00196
00197
00198
00199 #endif // CEYLAN_RANDOM_GENERATOR_FROM_PDF_H_
00200