#include <stdlib.h>
#include <math.h>
#include <nttw/global.h>
Go to the source code of this file.
Defines |
#define | RNG_MODULUS 2147483647 |
#define | MULTIPLIER 48271 |
#define | STREAMS 256 |
#define | DEFAULT 123456789 |
#define | RMSE(x) ( sqrt(x) ) |
#define | PSNR(x) ( 10.0*log10(255*255/(x)) ) |
Functions |
NTTW_DLL_SYM double | Random (void) |
| Returns 1 with probability p or 0 with probability 1 - p. Use n > 0 and 0.0 < p < 1.0.
|
NTTW_DLL_SYM double | Exponential (double m) |
| Returns an exponentially distributed positive real number. Use m > 0.0.
|
NTTW_DLL_SYM long | Poisson (double m) |
| Returns a Poisson distributed non-negative integer. Use m > 0.0.
|
NTTW_DLL_SYM double | Normal (double m, double s) |
| Returns a normal (Gaussian) distributed real number. Use m > 0.0 and s > 0.0.
|
NTTW_DLL_SYM double | mse (long *data1, long *data2, const size_t rows, const size_t cols) |
| Computes and returns the Mean Squared Error of two arrays.
|
Variables |
static long | seed [STREAMS] = {DEFAULT} |
static int | stream = 0 |
Define Documentation
#define DEFAULT 123456789 |
#define PSNR |
( |
|
x |
) |
( 10.0*log10(255*255/(x)) ) |
#define RMSE |
( |
|
x |
) |
( sqrt(x) ) |
#define RNG_MODULUS 2147483647 |
Copyright Information (python-cvxopt.copyright): RNGS Random Number Generation - Multiple Streams (Sep. 22, 1998) by Steve Park & Dave Geyer. See www.cs.wm.edu/~va/software/park/park.html. Software is in the public domain as was found out in an email correspondence with Virginia Torczon <va@cs.wm.edu> and Lawrence M. Leemis <leemis@MATH.WM.EDU> (Professor Steve Park passed away):
Dear Soeren,
Glad to have been of help. And I'm glad to learn from Larry that the software is, indeed, in the public domain.
Virginia
Definition at line 47 of file noise.h.
Function Documentation
Returns an exponentially distributed positive real number. Use m > 0.0.
Definition at line 24 of file noise.c.
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.
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.
Returns a Poisson distributed non-negative integer. Use m > 0.0.
Definition at line 34 of file noise.c.
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.
Variable Documentation
long seed[STREAMS] = {DEFAULT} [static] |