22 #ifndef __GenerateGauss_hh__
23 #define __GenerateGauss_hh__
40 static void Gauss1DSigma(
const double &sigma,
const double &ratio,
44 static void Gauss1DSize(
const unsigned size,
const double &ratio,
46 const bool normalize=
true);
49 static void Gauss1D(
const unsigned size,
const double &sigma,
53 static void Gauss2DSigma(
const double &sigma,
const double &ratio,
57 static void Gauss2DSize(
const unsigned size,
const double &ratio,
59 const bool normalize=
true);
62 static void Gauss2D(
const unsigned size,
const double &sigma,
69 inline static void Sigma2Size_(
const double &sigma,
const double &ratio,
71 { size = (unsigned)ceil(2.0*sqrt(-2.0*sigma*sigma*log(ratio))+1.0); }
76 inline static void Size2Sigma_(
const unsigned size,
const double &ratio,
78 {
const double dx=(double)(size-1)*0.5; sigma=sqrt(-dx*dx*0.5/log(ratio)); }
86 #endif // __GenerateGauss_hh__
class for column vectors with arbitrary size
static void Gauss1DSigma(const double &sigma, const double &ratio, BIAS::Vector< T > &result, const bool normalize=true)
compute one and two dimensional gauss normal distribution
static void Size2Sigma_(const unsigned size, const double &ratio, double &sigma)
Given a size and fixed ratio between biggest and smallest entry of the discrete gauss distribution...
static void Gauss2DSigma(const double &sigma, const double &ratio, BIAS::Matrix< T > &result, const bool normalize=true)
static void Gauss1D(const unsigned size, const double &sigma, BIAS::Vector< T > &result, const bool normalize=true)
static void Gauss2DSize(const unsigned size, const double &ratio, BIAS::Matrix< T > &result, double &sigma, const bool normalize=true)
static void Gauss2D(const unsigned size, const double &sigma, BIAS::Matrix< T > &result, const bool normalize=true)
matrix class with arbitrary size, indexing is row major.
static void Sigma2Size_(const double &sigma, const double &ratio, unsigned &size)
Given a sigma and fixed ratio between biggest and smallest entry of the discrete gauss distribution...
static void Gauss1DSize(const unsigned size, const double &ratio, BIAS::Vector< T > &result, double &sigma, const bool normalize=true)