Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
Arcane::random::LinearCongruential< IntType, a, c, m, val > Class Template Reference

compile-time configurable linear congruential generator. More...

#include <arcane/core/random/LinearCongruential.h>

Collaboration diagram for Arcane::random::LinearCongruential< IntType, a, c, m, val >:

Public Types

typedef IntType result_type

Public Member Functions

result_type min () const
result_type max () const
 LinearCongruential (IntType x0=1)
void seed (IntType x0)
IntType getState () const
IntType operator() ()
bool validation (IntType x) const
bool operator== (const LinearCongruential &rhs) const
void checkSeed (IntType x)

Static Public Member Functions

static IntType apply (IntType x)

Static Public Attributes

static const bool has_fixed_range = true
static const result_type min_value = (c == 0 ? 1 : 0)
static const result_type max_value = m - 1
static const IntType multiplier = a
static const IntType increment = c
static const IntType modulus = m

Private Attributes

IntType _x

Detailed Description

template<typename IntType, IntType a, IntType c, IntType m, IntType val>
class Arcane::random::LinearCongruential< IntType, a, c, m, val >

compile-time configurable linear congruential generator.

Warning
This implementation is only valid for the values (a,c,m) corresponding to MinstdRand and MinstdRand0.

Definition at line 42 of file LinearCongruential.h.

Member Typedef Documentation

◆ result_type

template<typename IntType, IntType a, IntType c, IntType m, IntType val>
typedef IntType Arcane::random::LinearCongruential< IntType, a, c, m, val >::result_type

Definition at line 46 of file LinearCongruential.h.

Constructor & Destructor Documentation

◆ LinearCongruential()

template<typename IntType, IntType a, IntType c, IntType m, IntType val>
Arcane::random::LinearCongruential< IntType, a, c, m, val >::LinearCongruential ( IntType x0 = 1)
inlineexplicit

Definition at line 56 of file LinearCongruential.h.

Member Function Documentation

◆ apply()

template<typename IntType, IntType a, IntType c, IntType m, IntType val>
IntType Arcane::random::LinearCongruential< IntType, a, c, m, val >::apply ( IntType x)
inlinestatic

Definition at line 77 of file LinearCongruential.h.

◆ checkSeed()

template<typename IntType, IntType a, IntType c, IntType m, IntType val>
void Arcane::random::LinearCongruential< IntType, a, c, m, val >::checkSeed ( IntType x)
inline

Definition at line 87 of file LinearCongruential.h.

◆ getState()

template<typename IntType, IntType a, IntType c, IntType m, IntType val>
IntType Arcane::random::LinearCongruential< IntType, a, c, m, val >::getState ( ) const
inline

Definition at line 71 of file LinearCongruential.h.

◆ max()

template<typename IntType, IntType a, IntType c, IntType m, IntType val>
result_type Arcane::random::LinearCongruential< IntType, a, c, m, val >::max ( ) const
inline

Definition at line 55 of file LinearCongruential.h.

◆ min()

template<typename IntType, IntType a, IntType c, IntType m, IntType val>
result_type Arcane::random::LinearCongruential< IntType, a, c, m, val >::min ( ) const
inline

Definition at line 54 of file LinearCongruential.h.

◆ operator()()

template<typename IntType, IntType a, IntType c, IntType m, IntType val>
IntType Arcane::random::LinearCongruential< IntType, a, c, m, val >::operator() ( )
inline

Definition at line 72 of file LinearCongruential.h.

◆ operator==()

template<typename IntType, IntType a, IntType c, IntType m, IntType val>
bool Arcane::random::LinearCongruential< IntType, a, c, m, val >::operator== ( const LinearCongruential< IntType, a, c, m, val > & rhs) const
inline

Definition at line 82 of file LinearCongruential.h.

◆ seed()

template<typename IntType, IntType a, IntType c, IntType m, IntType val>
void Arcane::random::LinearCongruential< IntType, a, c, m, val >::seed ( IntType x0)
inline

Definition at line 64 of file LinearCongruential.h.

◆ validation()

template<typename IntType, IntType a, IntType c, IntType m, IntType val>
bool Arcane::random::LinearCongruential< IntType, a, c, m, val >::validation ( IntType x) const
inline

Definition at line 81 of file LinearCongruential.h.

Member Data Documentation

◆ _x

template<typename IntType, IntType a, IntType c, IntType m, IntType val>
IntType Arcane::random::LinearCongruential< IntType, a, c, m, val >::_x
private

Definition at line 95 of file LinearCongruential.h.

◆ has_fixed_range

template<typename IntType, IntType a, IntType c, IntType m, IntType val>
const bool Arcane::random::LinearCongruential< IntType, a, c, m, val >::has_fixed_range = true
static

Definition at line 47 of file LinearCongruential.h.

◆ increment

template<typename IntType, IntType a, IntType c, IntType m, IntType val>
const IntType Arcane::random::LinearCongruential< IntType, a, c, m, val >::increment = c
static

Definition at line 51 of file LinearCongruential.h.

◆ max_value

template<typename IntType, IntType a, IntType c, IntType m, IntType val>
const result_type Arcane::random::LinearCongruential< IntType, a, c, m, val >::max_value = m - 1
static

Definition at line 49 of file LinearCongruential.h.

◆ min_value

template<typename IntType, IntType a, IntType c, IntType m, IntType val>
const result_type Arcane::random::LinearCongruential< IntType, a, c, m, val >::min_value = (c == 0 ? 1 : 0)
static

Definition at line 48 of file LinearCongruential.h.

◆ modulus

template<typename IntType, IntType a, IntType c, IntType m, IntType val>
const IntType Arcane::random::LinearCongruential< IntType, a, c, m, val >::modulus = m
static

Definition at line 52 of file LinearCongruential.h.

◆ multiplier

template<typename IntType, IntType a, IntType c, IntType m, IntType val>
const IntType Arcane::random::LinearCongruential< IntType, a, c, m, val >::multiplier = a
static

Definition at line 50 of file LinearCongruential.h.


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