TTK
Loading...
Searching...
No Matches
MorseSmaleComplex.cpp
Go to the documentation of this file.
1#include <MorseSmaleComplex.h>
2
6
8 std::vector<std::vector<Separatrix>> &separatrices) const {
9
10 if(separatrices.empty())
11 return;
12
13 std::vector<size_t> partialSizes{0};
14 for(const auto &sep : separatrices) {
15 partialSizes.emplace_back(partialSizes.back() + sep.size());
16 }
17
18 separatrices[0].resize(partialSizes.back());
19
20#ifdef TTK_ENABLE_OPENMP
21#pragma omp parallel for num_threads(threadNumber_)
22#endif // TTK_ENABLE_OPENMP
23 for(size_t i = 1; i < separatrices.size(); ++i) {
24 for(size_t j = 0; j < separatrices[i].size(); ++j) {
25 const auto o = partialSizes[i] + j;
26 // flatten separatrices1 and separatricesGeometry1
27 separatrices[0][o].source_ = separatrices[i][j].source_;
28 separatrices[0][o].destination_ = separatrices[i][j].destination_;
29 separatrices[0][o].geometry_ = std::move(separatrices[i][j].geometry_);
30 }
31 }
32}
void setDebugMsgPrefix(const std::string &prefix)
Definition Debug.h:364
void flattenSeparatricesVectors(std::vector< std::vector< Separatrix > > &separatrices) const
Flatten the vectors of vectors into their first component.