library of assembled shared sources

http://lass.cocamware.com

lass::num::RandomStandard Class Reference
[Random]

Uses the C standard library function rand(). More...

#include <random.h>


Public Types

typedef int TValue
 type of return value.

Public Member Functions

const TValue operator() () const
 draw a random number
const TValue operator() (TValue supremum) const
 draw a random number remapped to range [0, supremum)
template<typename OutputIterator >
OutputIterator getState (OutputIterator first) const
template<typename InputIterator >
void setState (InputIterator first, InputIterator last)

Static Public Attributes

static const TValue max = RAND_MAX
 maximum return value.


Detailed Description

Uses the C standard library function rand().

Note:
this one isn't thread safe since state is stored externally.

Definition at line 71 of file random.h.


Member Typedef Documentation

type of return value.

Definition at line 74 of file random.h.


Member Function Documentation

const RandomStandard::TValue lass::num::RandomStandard::operator() (  )  const [inline]

draw a random number

Definition at line 60 of file random.inl.

const RandomStandard::TValue lass::num::RandomStandard::operator() ( TValue  supremum  )  const [inline]

draw a random number remapped to range [0, supremum)

Deprecated:
this is A VERY BAD WAY TO DO IT!

Definition at line 70 of file random.inl.

template<typename OutputIterator >
OutputIterator lass::num::RandomStandard::getState ( OutputIterator  first  )  const [inline]

Definition at line 78 of file random.inl.

template<typename InputIterator >
void lass::num::RandomStandard::setState ( InputIterator  first,
InputIterator  last 
) [inline]

Definition at line 86 of file random.inl.

References LASS_ASSERT.


Field Documentation

maximum return value.

Definition at line 75 of file random.h.


The documentation for this class was generated from the following files:

Generated on Mon Nov 10 14:22:10 2008 for Library of Assembled Shared Sources by doxygen 1.5.7.1
SourceForge.net Logo