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

Public Types | Public Member Functions | Static Private Attributes
tvmet::util::Random< T, MIN, MAX > Class Template Reference

A simple random class. More...

#include <tvmet/util/Random.h>

List of all members.

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

Detailed Description

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

A simple random class.

> Random.h "tvmet/util/Random.h"

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());

Specialized Random class.


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]

References TVMET_CT_CONDITION.

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

References TVMET_CT_CONDITION.


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 [static, private]
 All Classes Namespaces Files Functions Variables Typedefs Enumerator Friends Defines

Author: