ViennaSHE 1.3.0
Free open-source semiconductor device simulator using spherical harmonics expansions techniques.
viennashe::math::std_rand_generator< ValueT > Class Template Reference

A pseudo-random number generator implementation based on std::rand() More...

#include <random.hpp>

Inheritance diagram for viennashe::math::std_rand_generator< ValueT >:
viennashe::math::rand_generator_base< double >

Public Member Functions

void seed (unsigned int s)
 Sets the seed of the pseudo-random number generator (std::srand) More...
 
ValueT operator() ()
 Calls std::rand divides by RAND_MAX and casts to ValueT. More...
 
- Public Member Functions inherited from viennashe::math::rand_generator_base< double >
virtual ~rand_generator_base ()
 
virtual double operator() ()=0
 The basic random number generator interface (virtual abstract) More...
 

Detailed Description

template<typename ValueT = double>
class viennashe::math::std_rand_generator< ValueT >

A pseudo-random number generator implementation based on std::rand()

Definition at line 53 of file random.hpp.

Member Function Documentation

◆ operator()()

template<typename ValueT = double>
ValueT viennashe::math::std_rand_generator< ValueT >::operator() ( )
inlinevirtual

Calls std::rand divides by RAND_MAX and casts to ValueT.

Returns
A pseudo-random number in [0,1]

Implements viennashe::math::rand_generator_base< double >.

Definition at line 66 of file random.hpp.

◆ seed()

template<typename ValueT = double>
void viennashe::math::std_rand_generator< ValueT >::seed ( unsigned int  s)
inline

Sets the seed of the pseudo-random number generator (std::srand)

Parameters
sThe seed to get reproduceable sequences of numbers

Definition at line 60 of file random.hpp.


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