ARTS  2.3.1285(git:92a29ea9-dirty)
Rand< rand_type > Class Template Reference

Random number class. More...

#include <test_utils.h>

Public Member Functions

 Rand (rand_type lo, rand_type hi)
 
rand_type operator() () const
 

Private Attributes

rand_type low
 Random Index class. More...
 
rand_type range
 

Detailed Description

template<class rand_type>
class Rand< rand_type >

Random number class.

Uses rand() to generate a pseudo-random integer and converts it to rand_type and maps it to the range [lo, hi]. The current calendar time at construction is used to seed the generator.

Definition at line 41 of file test_utils.h.

Constructor & Destructor Documentation

◆ Rand()

template<class rand_type>
Rand< rand_type >::Rand ( rand_type  lo,
rand_type  hi 
)
inline

Definition at line 43 of file test_utils.h.

Member Function Documentation

◆ operator()()

template<class rand_type>
rand_type Rand< rand_type >::operator() ( ) const
inline

Definition at line 45 of file test_utils.h.

References Rand< rand_type >::low, r, and Rand< rand_type >::range.

Member Data Documentation

◆ low

template<class rand_type>
rand_type Rand< rand_type >::low
private

Random Index class.

Template specialization for values of type Index to avoid rounding problems.

Definition at line 57 of file test_utils.h.

Referenced by Rand< rand_type >::operator()(), and Rand< Index >::operator()().

◆ range

template<class rand_type>
rand_type Rand< rand_type >::range
private

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