Functions

K:/Projects/scplusplus/gpl_releases/frtw/src/noise.c File Reference

#include <math.h>
#include "noise.h"
Include dependency graph for noise.c:

Go to the source code of this file.

Functions

double Random (void)
 Returns 1 with probability p or 0 with probability 1 - p. Use n > 0 and 0.0 < p < 1.0.
double Exponential (double m)
 Returns an exponentially distributed positive real number. Use m > 0.0.
long Poisson (double m)
 Returns a Poisson distributed non-negative integer. Use m > 0.0.
double Normal (double m, double s)
 Returns a normal (Gaussian) distributed real number. Use m > 0.0 and s > 0.0.
double mse (long *data1, long *data2, const size_t rows, const size_t cols)
 Computes and returns the Mean Squared Error of two arrays.

Function Documentation

double Exponential ( double  m  ) 

Returns an exponentially distributed positive real number. Use m > 0.0.

Definition at line 24 of file noise.c.

double mse ( long *  data1,
long *  data2,
const size_t  rows,
const size_t  cols 
)

Computes and returns the Mean Squared Error of two arrays.

Definition at line 82 of file noise.c.

double Normal ( double  m,
double  s 
)

Returns a normal (Gaussian) distributed real number. Use m > 0.0 and s > 0.0.

Uses a very accurate approximation of the normal idf due to Odeh & Evans, J. Applied Statistics, 1974, vol 23, pp 96-97.

Definition at line 51 of file noise.c.

long Poisson ( double  m  ) 

Returns a Poisson distributed non-negative integer. Use m > 0.0.

Definition at line 34 of file noise.c.

double Random ( void   ) 

Returns 1 with probability p or 0 with probability 1 - p. Use n > 0 and 0.0 < p < 1.0.

Definition at line 5 of file noise.c.