uniform_01

View page source

Simulate a [0,1] Uniform Random Variate

Syntax

      # include <cmpad/speed/uniform_01.hpp>
      std::srand ( seed )
      cmpad::uniform_01 ( x )

Prototype

   void uniform_01(cmpad::vector<double>& x)

Purpose

This routine is used to create random values for speed testing.

seed

The argument seed specifies a seed for the uniform random number generator.

x

The input value of the elements of x does not matter. Upon return, the elements of x are set to values uniformly sampled over the interval [0,1].

Example

xam_uniform_01.cpp contains an example and test of this routine.