DIPlib Documentation - ©1995-2017 Quantitative Imaging Group, Delft University of Technology.

UniformRandomVariable

Uniform random variable generator

SYNOPSIS

#include "dip_noise.h"

dip_Error dip_UniformRandomVariable ( random, lowerBound, upperBound, output)

FUNCTION

Generate an uniform distributed random variable. See RandomVariable for more information on the random number generator.

ARGUMENTS

Data typeNameDescription
dip_Random *randomPointer to a random value structure
dip_floatlowerBoundLower bound of the uniform distribution the variable is drawn from
dip_floatupperBoundUpper bound of the uniform distribution the variable is drawn from
dip_float*outputoutput

EXAMPLE

Get a uniform random variable as follows:

   dip_Random random;
   dip_float lower, upper, value;

   lower = -1.0;
   upper = 1.0;
   DIPXJ( dip_RandomSeed( &random, 0 ));
   DIPXJ( dip_UniformRandomVariable( &random, lower, upper,  &value ));

SEE ALSO

RandomVariable, RandomSeed, RandomSeedVector, GaussianRandomVariable, PoissonRandomVariable, BinaryRandomVariable