TTK
Loading...
Searching...
No Matches
CellArray.cpp
Go to the documentation of this file.
1#include <CellArray.h>
2
3using namespace ttk;
4
5#ifdef TTK_CELL_ARRAY_LEGACY
6void CellArray::TranslateToFlatLayout(std::vector<LongSimplexId> &connectivity,
7 std::vector<LongSimplexId> &offset,
8 LongSimplexId *&singleArray) {
9 const size_t coSize = connectivity.size();
10 const size_t ofSize = offset.size();
11 const size_t totalSize = coSize + ofSize - 1;
12 singleArray = new LongSimplexId[totalSize];
13
14 size_t con = 0;
15 size_t single = 0;
16 for(size_t off = 0; off < ofSize - 1; off++) {
17 const LongSimplexId nbVerts = offset[off + 1] - offset[off];
18 singleArray[single++] = nbVerts;
19 for(int i = 0; i < nbVerts; i++) {
20 singleArray[single++] = connectivity[con++];
21 }
22 }
23}
24#endif
static void TranslateToFlatLayout(std::vector< LongSimplexId > &connectivity, std::vector< LongSimplexId > &offset, LongSimplexId *&singleArray)
The Topology ToolKit.
long long int LongSimplexId
Identifier type for simplices of any dimension.
Definition DataTypes.h:15