All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
util::GaussianTransformer< T > Class Template Reference

Transforms a standard normal number into one on a different normal distribution. More...

#include <FastAndPoorGauss.h>

Public Types

using Data_t = T
 Type of data to deal with. More...
 

Public Member Functions

 GaussianTransformer (T mean, T stddev)
 Constructor: selects the mean and standard deviation. More...
 
Data_t mean () const
 Returns the mean of the target Gaussian distribution. More...
 
Data_t stdDev () const
 Returns the standard deviation of the target Gaussian distribution. More...
 
Data_t transform (Data_t const z) const
 Transforms normal value z into the target distribution. More...
 
Data_t operator() (Data_t const z) const
 

Static Public Member Functions

static Data_t transform (Data_t const z, Data_t const mean, Data_t const stddev)
 Transforms normal value z into one distributed with mean and stddev. More...
 

Private Attributes

Data_t const fMean = Data_t{ 0.0 }
 
Data_t const fStdDev = Data_t{ 1.0 }
 

Detailed Description

template<typename T>
class util::GaussianTransformer< T >

Transforms a standard normal number into one on a different normal distribution.

Template Parameters
Ttype of the data

This functor applies the simple mapping of a standard normal variable with mean 0 and standard deviation 1 into one with arbitrary mean and standard deviation: $ x = \mu + \sigma z $.

Definition at line 49 of file FastAndPoorGauss.h.

Member Typedef Documentation

template<typename T>
using util::GaussianTransformer< T >::Data_t = T

Type of data to deal with.

Definition at line 139 of file FastAndPoorGauss.h.

Constructor & Destructor Documentation

template<typename T>
util::GaussianTransformer< T >::GaussianTransformer ( mean,
stddev 
)
inline

Constructor: selects the mean and standard deviation.

Definition at line 142 of file FastAndPoorGauss.h.

142 : fMean(mean), fStdDev(stddev) {}
Data_t mean() const
Returns the mean of the target Gaussian distribution.

Member Function Documentation

template<typename T>
Data_t util::GaussianTransformer< T >::mean ( ) const
inline

Returns the mean of the target Gaussian distribution.

Definition at line 152 of file FastAndPoorGauss.h.

152 { return fMean; }
template<typename T>
Data_t util::GaussianTransformer< T >::operator() ( Data_t const  z) const
inline

Definition at line 148 of file FastAndPoorGauss.h.

148 { return transform(z); }
process_name opflash particleana ie ie ie z
Data_t transform(Data_t const z) const
Transforms normal value z into the target distribution.
template<typename T>
Data_t util::GaussianTransformer< T >::stdDev ( ) const
inline

Returns the standard deviation of the target Gaussian distribution.

Definition at line 155 of file FastAndPoorGauss.h.

155 { return fStdDev; }
template<typename T>
Data_t util::GaussianTransformer< T >::transform ( Data_t const  z) const
inline

Transforms normal value z into the target distribution.

Definition at line 146 of file FastAndPoorGauss.h.

147  { return transform(z, mean(), stdDev()); }
process_name opflash particleana ie ie ie z
Data_t mean() const
Returns the mean of the target Gaussian distribution.
Data_t transform(Data_t const z) const
Transforms normal value z into the target distribution.
Data_t stdDev() const
Returns the standard deviation of the target Gaussian distribution.
template<typename T>
static Data_t util::GaussianTransformer< T >::transform ( Data_t const  z,
Data_t const  mean,
Data_t const  stddev 
)
inlinestatic

Transforms normal value z into one distributed with mean and stddev.

Definition at line 159 of file FastAndPoorGauss.h.

160  { return mean + z * stddev; }
process_name opflash particleana ie ie ie z
Data_t mean() const
Returns the mean of the target Gaussian distribution.

Member Data Documentation

template<typename T>
Data_t const util::GaussianTransformer< T >::fMean = Data_t{ 0.0 }
private

Definition at line 164 of file FastAndPoorGauss.h.

template<typename T>
Data_t const util::GaussianTransformer< T >::fStdDev = Data_t{ 1.0 }
private

Definition at line 165 of file FastAndPoorGauss.h.


The documentation for this class was generated from the following file: