Loading [MathJax]/extensions/tex2jax.js
Photon Engine
2.0.0-beta
A physically based renderer.
Toggle main menu visibility
Home
Components
Main Page
Related Pages
Namespaces
Namespace List
Namespace Members
All
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
a
b
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
u
v
w
x
Variables
a
b
c
d
e
f
g
h
k
m
p
r
s
t
u
x
y
z
Typedefs
a
b
c
d
e
f
h
i
k
l
m
p
q
r
s
t
v
Enumerations
e
Enumerator
Concepts
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
a
b
c
d
e
f
g
i
k
l
m
n
o
p
r
s
t
u
v
w
x
y
Typedefs
a
b
c
d
e
f
i
k
m
n
o
p
r
s
t
v
w
Enumerations
Related Symbols
Files
File List
File Members
All
b
c
f
i
k
m
p
s
Functions
Typedefs
Macros
▼
Photon Engine
Home
Components
►
Engine
►
Engine Directories
Bibliography
►
Namespaces
►
Concepts
►
Classes
▼
Files
▼
File List
Documentation
►
Include
▼
Source
►
Actor
►
Api
►
Common
►
Core
►
DataIO
►
EngineEnv
►
Frame
▼
Math
►
Algorithm
►
Color
►
Function
►
General
►
Geometry
►
Physics
▼
Random
►
Quasi
DeterministicSeeder.cpp
►
DeterministicSeeder.h
►
Pcg32.h
►
Pcg64DXSM.h
Random.cpp
►
Random.h
Random.ipp
►
sample.h
►
shuffle.h
►
TMt19937.h
►
TPwcDistribution1D.h
TPwcDistribution1D.ipp
►
TPwcDistribution2D.h
TPwcDistribution2D.ipp
►
TUniformRandomBitGenerator.h
►
TUrbg32x2.h
►
Solver
►
Transform
►
constant.h
►
hash.h
►
hash.ipp
►
math.cpp
►
math.h
►
math.ipp
math_common.h
►
math_exceptions.h
►
math_fwd.h
►
math_table.h
►
Real.h
►
TArithmeticArray.h
TArithmeticArray.ipp
►
TFraction.h
►
time.h
►
TMatrix2.h
TMatrix2.ipp
►
TMatrix3.h
TMatrix3.ipp
►
TMatrix4.h
TMatrix4.ipp
►
TOrthonormalBasis3.h
TOrthonormalBasis3.ipp
►
TQuaternion.h
TQuaternion.ipp
►
TVector2.h
TVector2.ipp
►
TVector3.h
TVector3.ipp
►
TVector4.h
TVector4.ipp
►
SDL
►
Utility
►
World
►
File Members
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
Concepts
Loading...
Searching...
No Matches
TMt19937.h
Go to the documentation of this file.
1
#pragma once
2
3
#include "
Math/Random/TUniformRandomBitGenerator.h
"
4
5
#include <Common/primitive_type.h>
6
7
#include <random>
8
#include <type_traits>
9
10
namespace
ph::math
11
{
12
15
template
<
typename
Bits>
16
class
TMt19937
final :
public
TUniformRandomBitGenerator
<TMt19937<Bits>, Bits>
17
{
18
static_assert
(std::is_same_v<Bits, uint32> || std::is_same_v<Bits, uint64>,
19
"Supports only `uint32` and `uint64` bits types."
);
20
21
public
:
22
PH_DEFINE_INLINE_RULE_OF_5_MEMBERS
(
TMt19937
);
23
24
explicit
TMt19937
(Bits seed);
25
26
Bits
impl_generate
();
27
void
impl_jumpAhead
(uint64 distance);
28
29
private
:
30
// There are 32 & 64 bit versions, select the one based on `BitsT`
31
using
StdGeneratorType = std::conditional_t<std::is_same_v<Bits, uint32>,
32
std::mt19937, std::mt19937_64>;
33
34
StdGeneratorType m_generator;
35
};
16
class
TMt19937
final :
public
TUniformRandomBitGenerator
<TMt19937<Bits>, Bits> {
…
};
36
37
template
<
typename
Bits>
38
inline
TMt19937<Bits>::TMt19937
(
const
Bits seed)
39
: m_generator(seed)
40
{}
38
inline
TMt19937<Bits>::TMt19937
(
const
Bits seed) {
…
}
41
42
template
<
typename
Bits>
43
inline
Bits
TMt19937<Bits>::impl_generate
()
44
{
45
return
static_cast<
Bits
>
(m_generator());
46
}
43
inline
Bits
TMt19937<Bits>::impl_generate
() {
…
}
47
48
template
<
typename
Bits>
49
inline
void
TMt19937<Bits>::impl_jumpAhead
(
const
uint64 distance)
50
{
51
m_generator.discard(distance);
52
}
49
inline
void
TMt19937<Bits>::impl_jumpAhead
(
const
uint64 distance) {
…
}
53
54
}
// end namespace ph::math
TUniformRandomBitGenerator.h
ph::math::TMt19937
Standard Mersenne Twister generator.
Definition
TMt19937.h:17
ph::math::TMt19937::impl_jumpAhead
void impl_jumpAhead(uint64 distance)
Definition
TMt19937.h:49
ph::math::TMt19937::impl_generate
Bits impl_generate()
Definition
TMt19937.h:43
ph::math::TMt19937::PH_DEFINE_INLINE_RULE_OF_5_MEMBERS
PH_DEFINE_INLINE_RULE_OF_5_MEMBERS(TMt19937)
ph::math::TMt19937::TMt19937
TMt19937(Bits seed)
Definition
TMt19937.h:38
ph::math::TUniformRandomBitGenerator
Definition
TUniformRandomBitGenerator.h:30
ph::math
Math functions and utilities.
Definition
TransformInfo.h:10
Source
Math
Random
TMt19937.h
Generated by
1.11.0