Woolz Image Processing
Version 1.8.3
|
Files | |
file | AlgRand.c |
Provides functions which produce pseudo-random values. | |
file | AlgRandZig.c |
The Gaussian distribution random number generator is based on the Ziggurat method for generating random variables as used in the GNU scientific library. For details of the Ziggurat method see: George Marsaglia, Wai Wan Tsang The Ziggurat Method for Generating Random Variables, Journal of Statistical Software, vol. 5 (2000), no. 8 (http://www.jstatsoft.org/v05/i08/). | |
file | AlgShuffle.c |
Functions for randomly permuting data. | |
Functions | |
void | AlgRandSeed (long seed) |
Seeds the pseudo-random number generators. More... | |
double | AlgRandUniform (void) |
Produces a pseudo-random value from a uniform distribution over the interval [0.0, 1.0]. More... | |
double | AlgRandNormal (double mu, double sigma) |
Produces a pseudo-random value from a normal distribution over the interval [-1.0, 1.0]. More... | |
double | AlgRandZigNormal (double mu, double sigma) |
Generates a random double from a gaussian distribution the Ziggurat method. The distribution generated by this function is not quite as smooth as that generated by AlgRandNormal() but the time taken is a factor of ten smaller. More... | |
AlgError | AlgShuffleIdx (int nShuffle, int *shuffle, int seed) |
Inserts indicies into the given array which can be used to shuffle data. The permuted indicies are in the range [0-(nShuffle-1)] with a random order. This shuffling algorithm is based on a published paper! Dursenfeld R. "Random Permutation" CACM July 1964 No 7 p420. More... | |
void AlgRandSeed | ( | long | seed | ) |
Seeds the pseudo-random number generators.
seed | Given seed value. |
Referenced by WlzBasisFnTransformRandom(), WlzGaussNoise(), and WlzGreySetRange().
double AlgRandUniform | ( | void | ) |
Produces a pseudo-random value from a uniform distribution over the interval [0.0, 1.0].
Referenced by AlgRandNormal(), AlgRandZigNormal(), WlzBasisFnTransformRandom(), WlzPointsDither(), WlzPointsFromDomObj(), and WlzValueDitherI().
double AlgRandNormal | ( | double | mu, |
double | sigma | ||
) |
Produces a pseudo-random value from a normal distribution over the interval [-1.0, 1.0].
mu | Mean of distribution. |
sigma | Standard deviation of distribution. |
References AlgRandUniform().
Referenced by WlzGaussNoise().
double AlgRandZigNormal | ( | double | mu, |
double | sigma | ||
) |
Generates a random double from a gaussian distribution the Ziggurat method. The distribution generated by this function is not quite as smooth as that generated by AlgRandNormal() but the time taken is a factor of ten smaller.
mu | Mean of distribution. |
sigma | Standard deviation of distribution. |
References AlgRandUniform().
Referenced by WlzGreySetRange().
AlgError AlgShuffleIdx | ( | int | nShuffle, |
int * | shuffle, | ||
int | seed | ||
) |
Inserts indicies into the given array which can be used to shuffle data. The permuted indicies are in the range [0-(nShuffle-1)] with a random order. This shuffling algorithm is based on a published paper! Dursenfeld R. "Random Permutation" CACM July 1964 No 7 p420.
nShuffle | Number of permuted indicies to insert into in shuffle. |
shuffle | Array into which shuffled indicies are placed. |
seed | Seed fro random permutation. |
References ALG_ERR_FUNC, and ALG_ERR_NONE.
Referenced by WlzBasisFnTransformRandom(), WlzPointsFromDomObj(), WlzSnapFit(), and WlzVerticesBuildTree().