Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
Arcane::random::TMrg32k3a< RealType, val > Class Template Reference

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

Collaboration diagram for Arcane::random::TMrg32k3a< RealType, val >:

Public Types

typedef RealType result_type
typedef RealType state_type

Public Member Functions

 TMrg32k3a (Int32 x0=1)
 Constructor initializing the seed array from the value x0. The seed(x0) method is called.
 TMrg32k3a (state_type *state)
 Constructor initializing the seed array from the state array. state must be an array of six elements.
void seed (Int32 x0)
 Initialization of the seed array from the value x0. The seed array of this generator consists of six elements.
RealType getState (Integer i) const
 Method that returns the generator state for index i. The complete state of the generator is given by the index values i ranging between 0 and 5 ( 0 < i <=5 ).
RealType operator() ()
 Overloading of the () operator which returns the pseudo random value of the generator. The generator state is modified.
result_type min () const
 Returns the minimum possible value of a sequence.
result_type max () const
 Returns the maximum possible value of a sequence.
bool validation (RealType x) const
 Validation function (I'm not sure what it's for!).
bool operator== (const TMrg32k3a &rhs) const
 Overloading of the == operator.

Static Public Member Functions

static RealType apply (state_type *state)
 Returns the pseudo-random value from the state. The generator state state must consist of six elements.

Static Public Attributes

static const bool has_fixed_range = true
static const Int32 min_value = 0
static const Int32 max_value = 1

Private Attributes

state_type _state [6]

Detailed Description

template<typename RealType, Int32 val>
class Arcane::random::TMrg32k3a< RealType, val >

Class template TMrg32k3a. It allows defining classes of Mrg32k3a type generators. The pseudo-random numbers generated are of type RealType. The generator state is characterized by six values of type RealType and can be managed internally by the private member _state[i] where 0<i<=5.

The generation of a sequence of pseudo-random numbers is performed:

  • either by successive calls to the operator (). In this case, the seed can be initialized by the different seed methods or when calling the constructor. The generator state is managed internally via the private member _state[i] (0<i<=5). Its components i are accessible via the getState(i) method.
  • or by calling the apply(value) method. The generator state is managed outside the class. The seed and getState methods are meaningless in this usage.

Definition at line 49 of file TMrg32k3a.h.

Member Typedef Documentation

◆ result_type

template<typename RealType, Int32 val>
typedef RealType Arcane::random::TMrg32k3a< RealType, val >::result_type

Definition at line 53 of file TMrg32k3a.h.

◆ state_type

template<typename RealType, Int32 val>
typedef RealType Arcane::random::TMrg32k3a< RealType, val >::state_type

Definition at line 54 of file TMrg32k3a.h.

Constructor & Destructor Documentation

◆ TMrg32k3a() [1/2]

template<typename RealType, Int32 val>
Arcane::random::TMrg32k3a< RealType, val >::TMrg32k3a ( Int32 x0 = 1)
inlineexplicit

Constructor initializing the seed array from the value x0. The seed(x0) method is called.

Author
Patrick Rathouit
Date
28/07/2006

Definition at line 68 of file TMrg32k3a.h.

◆ TMrg32k3a() [2/2]

template<typename RealType, Int32 val>
Arcane::random::TMrg32k3a< RealType, val >::TMrg32k3a ( state_type * state)
inlineexplicit

Constructor initializing the seed array from the state array. state must be an array of six elements.

Author
Patrick Rathouit
Date
28/07/2006

Definition at line 82 of file TMrg32k3a.h.

Member Function Documentation

◆ apply()

template<typename RealType, Int32 val>
RealType Arcane::random::TMrg32k3a< RealType, val >::apply ( state_type * state)
inlinestatic

Returns the pseudo-random value from the state. The generator state state must consist of six elements.

Author
Patrick Rathouit
Date
28/07/2006

Definition at line 145 of file TMrg32k3a.h.

Referenced by Arcane::random::TMrg32k3a< Real, 0 >::operator()().

Here is the caller graph for this function:

◆ getState()

template<typename RealType, Int32 val>
RealType Arcane::random::TMrg32k3a< RealType, val >::getState ( Integer i) const
inline

Method that returns the generator state for index i. The complete state of the generator is given by the index values i ranging between 0 and 5 ( 0 < i <=5 ).

Author
Patrick Rathouit
Date
28/07/2006

Definition at line 118 of file TMrg32k3a.h.

◆ max()

template<typename RealType, Int32 val>
result_type Arcane::random::TMrg32k3a< RealType, val >::max ( ) const
inline

Returns the maximum possible value of a sequence.

Author
Patrick Rathouit
Date
28/07/2006

Definition at line 191 of file TMrg32k3a.h.

◆ min()

template<typename RealType, Int32 val>
result_type Arcane::random::TMrg32k3a< RealType, val >::min ( ) const
inline

Returns the minimum possible value of a sequence.

Author
Patrick Rathouit
Date
28/07/2006

Definition at line 181 of file TMrg32k3a.h.

◆ operator()()

template<typename RealType, Int32 val>
RealType Arcane::random::TMrg32k3a< RealType, val >::operator() ( )
inline

Overloading of the () operator which returns the pseudo random value of the generator. The generator state is modified.

Author
Patrick Rathouit
Date
28/07/2006

Definition at line 129 of file TMrg32k3a.h.

◆ operator==()

template<typename RealType, Int32 val>
bool Arcane::random::TMrg32k3a< RealType, val >::operator== ( const TMrg32k3a< RealType, val > & rhs) const
inline

Overloading of the == operator.

Author
Patrick Rathouit
Date
28/07/2006

Definition at line 211 of file TMrg32k3a.h.

◆ seed()

template<typename RealType, Int32 val>
void Arcane::random::TMrg32k3a< RealType, val >::seed ( Int32 x0)
inline

Initialization of the seed array from the value x0. The seed array of this generator consists of six elements.

Author
Patrick Rathouit
Date
28/07/2006

Definition at line 97 of file TMrg32k3a.h.

Referenced by Arcane::random::TMrg32k3a< Real, 0 >::TMrg32k3a().

Here is the caller graph for this function:

◆ validation()

template<typename RealType, Int32 val>
bool Arcane::random::TMrg32k3a< RealType, val >::validation ( RealType x) const
inline

Validation function (I'm not sure what it's for!).

Author
Patrick Rathouit
Date
28/07/2006

Definition at line 201 of file TMrg32k3a.h.

Member Data Documentation

◆ _state

template<typename RealType, Int32 val>
state_type Arcane::random::TMrg32k3a< RealType, val >::_state[6]
private

Definition at line 218 of file TMrg32k3a.h.

◆ has_fixed_range

template<typename RealType, Int32 val>
const bool Arcane::random::TMrg32k3a< RealType, val >::has_fixed_range = true
static

Definition at line 55 of file TMrg32k3a.h.

◆ max_value

template<typename RealType, Int32 val>
const Int32 Arcane::random::TMrg32k3a< RealType, val >::max_value = 1
static

Definition at line 57 of file TMrg32k3a.h.

◆ min_value

template<typename RealType, Int32 val>
const Int32 Arcane::random::TMrg32k3a< RealType, val >::min_value = 0
static

Definition at line 56 of file TMrg32k3a.h.


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