4 #include <noise/RandomNoiseSource.h>
15 template <
typename RealType>
57 std::string
const & seed,
155 {
return this->
rg.normalDistributionNext();}
162 template<
typename _RealType>
174 template <
typename RealType>
180 this->normalNoiseMean = mean;
181 this->normalNoiseStdev = stdev;
182 this->rg.computeNormalDistribution(mean, stdev);
188 template<
typename RealType>
190 out << static_cast<RandomNoiseSource<RealType>&>(ns);
191 out <<
"\t\tNormalNoiseSource:\n"
192 <<
"\t\t\tnormalNoiseMean = " << ns.
getMean() <<
"\n"
193 <<
"\t\t\tnormalNoiseStdev = " << ns.
getStdev() <<
"\n";
void build()
Common behavior for all NoiseSource constructors.
Definition: NoiseSource.h:85
Class for normal noise handling.
Definition: NormalNoiseSource.h:16
NormalNoiseSource(RealType normalNoiseMean=0.0, RealType normalNoiseStdev=1.0)
Create default NormalNoiseSource.
Definition: NormalNoiseSource.h:73
NormalNoiseSource(std::string const &seed, RealType normalNoiseMean=0.0, RealType normalNoiseStdev=1.0)
Create a NormalNoiseSource using received seed.
Definition: NormalNoiseSource.h:56
RealType normalNoiseStdev
the standard deviation for hte normal noise computation
Definition: NormalNoiseSource.h:27
NormalNoiseSource & setStdev(RealType stdev)
Set the current standard deviation for normal noise generation.
Definition: NormalNoiseSource.h:127
friend std::ostream & operator<<(std::ostream &out, NormalNoiseSource< _RealType > &ns)
Output stream behavior.
std::string getRandomNoiseType() override
Definition: NormalNoiseSource.h:144
RealType getStdev()
Obtain the current standard deviation for normal noise generation.
Definition: NormalNoiseSource.h:112
RealType getMean()
Obtain the current mean for normal noise generation.
Definition: NormalNoiseSource.h:91
NormalNoiseSource & setMean(RealType mean)
Set the current mean for normal noise generation.
Definition: NormalNoiseSource.h:106
RealType noiseFunction() override
Compute next normal nosie value from current random normal distribution.
Definition: NormalNoiseSource.h:154
NormalNoiseSource & configureNormalNoise(RealType mean, RealType stdev)
Configure normal noise.
Definition: NormalNoiseSource.h:176
NormalNoiseSource(RandomnessGenerator< RealType > const &rg, RealType normalNoiseMean=0.0, RealType normalNoiseStdev=1.0)
Create a NormalNoiseSource using received RandomnessGenerator.
Definition: NormalNoiseSource.h:38
RealType normalNoiseMean
The mean for the normal noise computation.
Definition: NormalNoiseSource.h:23
Abstract class for random noise handling.
Definition: RandomNoiseSource.h:16
RandomnessGenerator< RealType > rg
RandomnessGenerator to be used to generate random noise.
Definition: RandomNoiseSource.h:24
Class to generate random numbers.
Definition: RandomnessGenerator.h:34
void computeNormalDistribution(RealType mean, RealType stdev)
Compute a normal distribution using the specified real data type.
Definition: RandomnessGenerator.h:400