SourceForge Logo Tiny Vector Matrix library using Expression Templates Sourceforge Project Page

tvmet::util::Random< T, MIN, MAX > Class Template Reference

#include <tvmet/util/Random.h>

List of all members.


Detailed Description

template<class T, int MIN = 0, int MAX = 100>
class tvmet::util::Random< T, MIN, MAX >

A simple random class.

On each access this class returns a new random number using std::rand(). The range generated is templated by MIN and MAX.

Example:
 #include <algorithm>

 tvmet::Random<int, 0, 100>       random;

 std::generate(m1.begin(), m1.end(), random());


Public Types

typedef T value_type
typedef std::complex< T > value_type

Public Member Functions

 Random ()
value_type operator() ()
 Random ()
value_type operator() ()

Static Private Attributes

static unsigned int s_seed


Member Typedef Documentation

template<class T, int MIN = 0, int MAX = 100>
typedef T tvmet::util::Random< T, MIN, MAX >::value_type

template<class T, int MIN = 0, int MAX = 100>
typedef std::complex<T> tvmet::util::Random< T, MIN, MAX >::value_type


Constructor & Destructor Documentation

template<class T, int MIN = 0, int MAX = 100>
tvmet::util::Random< T, MIN, MAX >::Random (  )  [inline]

template<class T, int MIN = 0, int MAX = 100>
tvmet::util::Random< T, MIN, MAX >::Random (  )  [inline]


Member Function Documentation

template<class T, int MIN = 0, int MAX = 100>
value_type tvmet::util::Random< T, MIN, MAX >::operator() (  )  [inline]

template<class T, int MIN = 0, int MAX = 100>
value_type tvmet::util::Random< T, MIN, MAX >::operator() (  )  [inline]


Member Data Documentation

template<class T, int MIN = 0, int MAX = 100>
unsigned int tvmet::util::Random< T, MIN, MAX >::s_seed [inline, static, private]


Author: