Interface for a random number generator.
More...
#include <arcane/core/IRandomNumberGenerator.h>
Interface for a random number generator.
Definition at line 202 of file IRandomNumberGenerator.h.
◆ emptySeed()
Method allowing retrieval of an empty seed of the correct size.
- Returns
- ByteUniqueArray The empty seed.
◆ generateRandomNumber() [1/2]
Method allowing generation of a random number using the seed passed as a parameter.
This method does not use the seed in memory but the seed provided as a parameter. If the seed provided as a parameter does not have the correct size, an error will be raised.
- Parameters
-
| seed | The seed. |
| leap | The leap to perform (0 = number n+1+0 / 1 = number n+1+1). |
- Returns
- Real The generated number (between 0 and 1).
◆ generateRandomNumber() [2/2]
| virtual Real Arcane::IRandomNumberGenerator::generateRandomNumber |
( |
Integer | leap = 0 | ) |
|
|
pure virtual |
Method allowing generation of a random number using the seed in memory.
- Parameters
-
| leap | The leap to perform (0 = number n+1+0 / 1 = number n+1+1). |
- Returns
- Real The generated number (between 0 and 1).
◆ generateRandomSeed() [1/2]
Method allowing generation of a "child" seed from a "parent" seed.
This method does not use the seed in memory but the seed provided as a parameter. If the seed provided as a parameter does not have the correct size, an error will be raised.
- Parameters
-
| parent_seed | The "parent" seed. |
| leap | The leap to perform (0 = seed n+1+0 / 1 = seed n+1+1). |
- Returns
- ByteUniqueArray The new seed generated from the "parent" seed.
◆ generateRandomSeed() [2/2]
Method allowing generation of a "child" seed from a "parent" seed.
- Parameters
-
| leap | The leap to perform (0 = seed n+1+0 / 1 = seed n+1+1). |
- Returns
- ByteUniqueArray The new seed generated from the seed in memory.
◆ initSeed() [1/2]
| virtual bool Arcane::IRandomNumberGenerator::initSeed |
( |
| ) |
|
|
pure virtual |
Method allowing initialization of the service.
With the seed optional (or the default seed if in singleton mode).
- Returns
- true If initialization was successful.
-
false If initialization did not occur.
◆ initSeed() [2/2]
| virtual bool Arcane::IRandomNumberGenerator::initSeed |
( |
ByteArrayView | seed | ) |
|
|
pure virtual |
Method allowing initialization of the service.
If the seed does not have the correct size, false will be returned.
- Parameters
-
- Returns
- true If initialization was successful.
-
false If initialization did not occur.
◆ isLeapNumberSupported()
| virtual bool Arcane::IRandomNumberGenerator::isLeapNumberSupported |
( |
| ) |
|
|
pure virtual |
Method allowing knowledge if leaps are allowed on the number generator.
- Returns
- true If yes.
-
false If no.
◆ isLeapSeedSupported()
| virtual bool Arcane::IRandomNumberGenerator::isLeapSeedSupported |
( |
| ) |
|
|
pure virtual |
Method allowing knowledge if leaps are allowed on the seed generator.
- Returns
- true If yes.
-
false If no.
◆ neededSizeOfSeed()
| virtual Integer Arcane::IRandomNumberGenerator::neededSizeOfSeed |
( |
| ) |
|
|
pure virtual |
Method allowing knowledge of the seed size required for the implementation.
- Returns
- Integer The required seed size (in bytes).
◆ viewSeed()
Method allowing retrieval of a constant view of the current seed.
- Returns
- ByteArrayView The seed.
The documentation for this class was generated from the following file: