TTK
Toggle main menu visibility
Main Page
Topics
Namespaces
Namespace List
Namespace Members
All
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
r
s
t
u
v
w
y
z
Functions
a
c
d
f
g
i
l
m
o
p
r
s
t
u
v
z
Variables
b
c
d
e
f
g
i
l
m
o
p
r
s
u
v
w
y
Typedefs
b
c
d
e
g
i
l
m
n
o
p
r
s
t
u
v
Enumerations
Enumerator
a
b
c
f
g
h
j
l
m
n
o
p
s
v
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
z
~
Variables
_
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
Typedefs
c
e
g
i
k
n
p
q
r
s
t
v
w
Enumerations
b
c
d
e
f
m
p
r
s
t
v
Related Symbols
Files
File List
File Members
All
_
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
r
s
t
u
v
w
Functions
a
b
c
d
e
f
g
h
i
j
m
n
p
r
s
t
v
w
Variables
Typedefs
Enumerations
Enumerator
Macros
b
c
d
e
f
g
h
i
m
o
p
r
s
t
u
v
w
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Modules
Pages
Loading...
Searching...
No Matches
core
base
common
Shuffle.h
Go to the documentation of this file.
1
#include <cstdlib>
2
#include <vector>
3
4
namespace
ttk
{
12
template
<
typename
T,
typename
U>
13
void
shuffle
(std::vector<T> &toShuffle, U &&rng) {
14
for
(
size_t
i = toShuffle.size() - 1; i >= 1; i--) {
15
const
auto
j = rng() % i;
16
std::swap(toShuffle[i], toShuffle[j]);
17
}
18
}
13
void
shuffle
(std::vector<T> &toShuffle, U &&rng) {
…
}
19
}
// namespace ttk
ttk
The Topology ToolKit.
Definition
AbstractTriangulation.h:51
ttk::shuffle
void shuffle(std::vector< T > &toShuffle, U &&rng)
Platform-independent alternative to std::shuffle implementing the Fisher-Yates shuffle algorithm.
Definition
Shuffle.h:13
Generated on Thu Sep 26 2024 06:50:17 for TTK by
1.9.8