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
ArrayLinkedList.h
Go to the documentation of this file.
1
13
14
#include <array>
15
#include <list>
16
17
#pragma once
18
19
namespace
ttk
{
20
template
<
typename
datatype,
int
size>
21
class
ArrayLinkedList
{
22
public
:
23
std::list<std::array<datatype, size>>
list_
;
24
int
numberOfElements_
;
25
// In order to prevent false sharing when creating a
26
// std::vector of ArrayLinkedList objects (one element
27
// of the std::vector for each thread), it is necessary
28
// that one ArrayLinkedList object be bigger than one cache
29
// line. Here, we assume a cache line to be 64 bytes.
30
std::array<unsigned char, 32>
padding_
{};
31
ArrayLinkedList
()
32
:
list_
(std::list<std::array<datatype, size>>({})),
numberOfElements_
(0) {
33
}
31
ArrayLinkedList
() {
…
}
34
35
datatype *
addArrayElement
(datatype element) {
36
numberOfElements_
=
numberOfElements_
% size;
37
if
(
numberOfElements_
== 0) {
38
this->
list_
.push_back(std::array<datatype, size>({}));
39
}
40
this->
list_
.back().at(
numberOfElements_
) = element;
41
this->
numberOfElements_
++;
42
return
&(this->
list_
.back().at(
numberOfElements_
- 1));
43
}
35
datatype *
addArrayElement
(datatype element) {
…
}
44
};
21
class
ArrayLinkedList
{
…
};
45
}
// namespace ttk
ttk::ArrayLinkedList
This class describes a dynamic size data structure for thread safe computation. It is a linked list o...
Definition
ArrayLinkedList.h:21
ttk::ArrayLinkedList::addArrayElement
datatype * addArrayElement(datatype element)
Definition
ArrayLinkedList.h:35
ttk::ArrayLinkedList::list_
std::list< std::array< datatype, size > > list_
Definition
ArrayLinkedList.h:23
ttk::ArrayLinkedList::ArrayLinkedList
ArrayLinkedList()
Definition
ArrayLinkedList.h:31
ttk::ArrayLinkedList::numberOfElements_
int numberOfElements_
Definition
ArrayLinkedList.h:24
ttk::ArrayLinkedList::padding_
std::array< unsigned char, 32 > padding_
Definition
ArrayLinkedList.h:30
ttk
The Topology ToolKit.
Definition
AbstractTriangulation.h:51
Generated on Thu Sep 26 2024 06:50:17 for TTK by
1.9.8