1%feature("docstring") OT::RandomGenerator
2"Uniform random generator.
3
4Refer to :ref:`uniform_random_generator`.
5
6The random generator of uniform(0,1) samples is based on the DSFTM
7(Double precision SIMD oriented Fast Mersenne Twister) algorithm."
8
9// ---------------------------------------------------------------------
10
11%feature("docstring") OT::RandomGenerator::GetState
12"Get the state of the random generator.
13
14Returns
15-------
16particularState : :class:`~openturns.RandomGeneratorState`
17    State of the random generator."
18
19// ---------------------------------------------------------------------
20
21%feature("docstring") OT::RandomGenerator::SetState
22"Set the state of the random generator.
23
24Parameters
25----------
26particularState : :class:`~openturns.RandomGeneratorState`
27    State of the random generator.
28
29Notes
30-----
31This method fixes the entire state of the random generator algorithm
32thanks the specification of the entire state *particularState* usually
33previously obtained thanks to the :meth:`GetState` method."
34
35// ---------------------------------------------------------------------
36
37%feature("docstring") OT::RandomGenerator::Generate
38"Generate a pseudo-random vector.
39
40Parameters
41----------
42size : positive int
43    Number of realizations required. When not given, by default it is equal to
44    1.
45
46Returns
47-------
48numbers : float, :class:`~openturns.Point`
49    Pseudo-random numbers uniformly distributed over :math:`[0, 1[`.
50
51Examples
52--------
53>>> import openturns as ot
54>>> ot.RandomGenerator.SetSeed(0)
55>>> print('%.6f' % ot.RandomGenerator.Generate())
560.629877
57>>> print(ot.RandomGenerator.Generate(2))
58[0.882805,0.135276]"
59
60// ---------------------------------------------------------------------
61
62%feature("docstring") OT::RandomGenerator::IntegerGenerate
63"Generate a pseudo-random integer.
64
65:Available usages:
66    IntegerGenerate(*n*)
67
68    IntegerGenerate(*size, n*)
69
70Parameters
71----------
72n : positive int
73    Upper bound of the interval where the pseudo-random integers are.
74size : positive int
75    Number of integers to generate. When not given, by default it is equal to
76    1.
77
78Returns
79-------
80integer : int, :class:`~openturns.UnsignedIntegerCollection`
81    Pseudo-random integers uniformly distributed over :math:`[0,...,n-1]`.
82
83Examples
84--------
85>>> import openturns as ot
86>>> ot.RandomGenerator.SetSeed(0)
87>>> print(ot.RandomGenerator.IntegerGenerate(30))
8824
89>>> print(ot.RandomGenerator.IntegerGenerate(5, 30))
90[26,21,21,22,26]"
91
92// ---------------------------------------------------------------------
93
94%feature("docstring") OT::RandomGenerator::SetSeed
95"Set the seed of the random generator.
96
97Parameters
98----------
99n : int :math:`\in [0, 2^{32}-1]`
100
101Notes
102-----
103This method fixes a particular state of the random generator algorithm
104thanks to the seed :math:`n`. The seed of the random generator is automatically
105initialized to 0 when a session is launched."
106