|
| Function | Gaussian normal distribution function. |
|
| Syntax C/C++ | #include <VFmath.h>
int VF_Gauss( fVector Y, fVector X, ui size, float Wid, float Cent, float C ); |
| C++ VecObj | #include <OptiVec.h>
int vector<T>::Gauss( const vector<T>& X, T Wid, const T& Cent, const T& C ); |
| Pascal/Delphi | uses VFmath;
function VF_Gauss( Y, X:fVector; size:UIntSize; Wid, Cent, C:Single ): IntBool; |
|
| Description | Yi = C / (Wid * sqrt(2*p)) * exp( -0.5*((Xi-Cent) / Wid)2 )
Wid = width of the distribution
Cent = center of the distribution
C is a scaling factor; for C = 1.0, the distribution is normalized.
For Wid = 0, the normal distribution is in fact a delta distribution with Y = C * INF at X = Cent and Y = 0 at all other values of X.
Since infinities are not supported, the existence of a point X = Cent will lead to a SING error in case Wid is zero. |
|
| Error handling | SING errors may occur only for a Wid of zero. They are handled with the default result set to ±HUGE_VAL. |
|
| Return value | FALSE (0), if no error occurred, otherwise TRUE (non-zero). |
|
|