random.hpp File Reference


Detailed Description

Simple random number generator.

Definition in file random.hpp.

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Functions

double Rand (long seed=0)
 Generate random numbers uniformly distributed from 0 to 1.
double RandNorm (double sigma)
 Generate normally distributed random numbers, zero mean and sqrt of variance sigma.
int ARand (int low, int hi)
 Return random integers between low and hi.
double ARand (double low, double hi)
 Return random doubles between low and hi.
double RandomWalk (double dt, double sigma, double xlast)
 Generate a random walk sequence, given sqrt variance sigma, time step dt and previous point xlast.
double RandExpCor (double dt, double sigma, double T, double xlast)
 Generate exponentially correlated random numbers, given sqrt variance sigma, time step dt, time constant T, and previous point xlast.


Function Documentation

double ARand double  low,
double  hi
 

Return random doubles between low and hi.

Seed the generator by calling Rand(seed) before this call.

Definition at line 135 of file random.cpp.

References Rand().

int ARand int  low,
int  hi
 

Return random integers between low and hi.

Seed the generator by calling Rand(seed) before this call.

Definition at line 123 of file random.cpp.

References Rand().

double Rand long  seed = 0  ) 
 

Generate random numbers uniformly distributed from 0 to 1.

Definition at line 43 of file random.cpp.

References imod, Mbig, and Mseed.

Referenced by ARand(), and RandNorm().

double RandExpCor double  dt,
double  sigma,
double  T,
double  xlast
 

Generate exponentially correlated random numbers, given sqrt variance sigma, time step dt, time constant T, and previous point xlast.

Definition at line 154 of file random.cpp.

References gpstk::exp(), and RandNorm().

double RandNorm double  sigma  ) 
 

Generate normally distributed random numbers, zero mean and sqrt of variance sigma.

Uses Box-Muller and Rand().

Definition at line 89 of file random.cpp.

References log, Rand(), and gpstk::sqrt().

Referenced by RandExpCor(), and RandomWalk().

double RandomWalk double  dt,
double  sigma,
double  xlast
 

Generate a random walk sequence, given sqrt variance sigma, time step dt and previous point xlast.

Definition at line 146 of file random.cpp.

References RandNorm().


Generated on Tue Feb 7 03:31:18 2012 for GPS ToolKit Software Library by  doxygen 1.3.9.1