6 std::vector<PersistencePair> &CTDiagram,
const SimplexId *offsets) {
8 printMsg(
"Progressive Persistence Diagram computation");
17 int computePersistenceDiagram,
const SimplexId *offsets) {
32#ifdef TTK_ENABLE_KAMIKAZE
33 if(vertexNumber == 0) {
34 this->
printErr(
"No points in triangulation");
45 const size_t maxNeigh = dim == 3 ? 14 : (dim == 2 ? 6 : 0);
47 std::vector<std::vector<SimplexId>> saddleCCMin{}, saddleCCMax{};
48 std::vector<std::vector<SimplexId>> vertexRepresentativesMin{},
49 vertexRepresentativesMax{};
50 std::vector<polarity> isUpToDateMin{}, isUpToDateMax{};
51 std::vector<polarity> toPropagateMin{}, toPropagateMax{};
52 std::vector<char> vertexTypes{};
54 if(computePersistenceDiagram) {
55 saddleCCMin.resize(vertexNumber);
56 saddleCCMax.resize(vertexNumber);
57 vertexRepresentativesMin.resize(vertexNumber);
58 vertexRepresentativesMax.resize(vertexNumber);
59 toPropagateMin.resize(vertexNumber, 0);
60 toPropagateMax.resize(vertexNumber, 0);
61 isUpToDateMin.resize(vertexNumber, 0);
62 isUpToDateMax.resize(vertexNumber, 0);
68 std::vector<uint8_t> vertexLink(vertexNumber);
70 std::vector<DynamicTree> link(vertexNumber);
71 std::vector<polarity> isNew(vertexNumber, 255);
72 std::vector<std::vector<std::pair<polarity, polarity>>> vertexLinkPolarity(
74 std::vector<polarity> toProcess(vertexNumber, 0), toReprocess{};
79 toReprocess.resize(vertexNumber, 0);
83 std::vector<Lock> vertLockMin(vertexNumber), vertLockMax(vertexNumber);
90 for(
SimplexId i = 0; i < vertexNumber; ++i) {
91 vertexLinkPolarity[i].reserve(maxNeigh);
92 link[i].alloc(maxNeigh);
94 printMsg(
"Pre-allocating data structures", 1,
102 std::vector<SimplexId> boundReps{};
105#ifdef TTK_ENABLE_OPENMP
106#pragma omp parallel for num_threads(threadNumber_)
108 for(
size_t i = 0; i < boundReps.size(); i++) {
109 if(boundReps[i] != -1) {
119 if(computePersistenceDiagram) {
120 initSaddleSeeds(isNew, vertexLinkPolarity, toPropagateMin, toPropagateMax,
121 toProcess, link, vertexLink, vertexLinkByBoundaryType,
122 saddleCCMin, saddleCCMax, offsets);
123 initPropagation(toPropagateMin, toPropagateMax, vertexRepresentativesMin,
124 vertexRepresentativesMax, saddleCCMin, saddleCCMax,
125 vertLockMin, vertLockMax, isUpToDateMin, isUpToDateMax,
130 CTDiagram_, offsets, vertexRepresentativesMin, vertexRepresentativesMax,
131 toPropagateMin, toPropagateMax);
134 vertexLink, vertexLinkByBoundaryType, vertexTypes,
143 > 0.9 * this->timeLimit_);
154 if(computePersistenceDiagram) {
156 toPropagateMax, toProcess, toReprocess, link,
157 vertexLink, vertexLinkByBoundaryType, saddleCCMin,
158 saddleCCMax, isUpToDateMin, isUpToDateMax, offsets);
160 vertexRepresentativesMin, vertexRepresentativesMax,
161 saddleCCMin, saddleCCMax, vertLockMin, vertLockMax,
162 isUpToDateMin, isUpToDateMax, offsets);
164 CTDiagram_, offsets, vertexRepresentativesMin, vertexRepresentativesMax,
165 toPropagateMin, toPropagateMax);
168 link, vertexLink, vertexLinkByBoundaryType,
169 vertexTypes, offsets);
172 const auto itDuration = tmIter.getElapsedTime();
173 const auto nextItDuration
183 this->
printMsg(
"current iteration", 1.0, itDuration, 1,
185 this->
printMsg(
"next iteration duration prediction", 1.0, nextItDuration, 1,
190 if(computePersistenceDiagram) {
196 if(computePersistenceDiagram) {
202 this->
isNew_ = std::move(isNew);
206 this->
link_ = std::move(link);
219 "Total", 1.0, timer.
getElapsedTime() - tm_allocation, this->threadNumber_);
229 "Resuming computation from resolution level "
236 std::vector<Lock> vertLockMin(vertexNumber), vertLockMax(vertexNumber);
238 std::vector<polarity> toPropagateMin{}, toPropagateMax{};
239 std::vector<polarity> isUpToDateMin{}, isUpToDateMax{};
241 if(computePersistenceDiagram) {
242 toPropagateMin.resize(vertexNumber, 0);
243 toPropagateMax.resize(vertexNumber, 0);
244 isUpToDateMin.resize(vertexNumber, 0);
245 isUpToDateMax.resize(vertexNumber, 0);
256 if(computePersistenceDiagram) {
264 isUpToDateMin, isUpToDateMax, offsets);
274 const auto itDuration = tmIter.getElapsedTime();
275 const auto nextItDuration
279 this->threadNumber_);
287 if(computePersistenceDiagram) {
304 std::vector<PersistencePair> &CTDiagram,
306 std::vector<std::vector<SimplexId>> &vertexRepresentativesMin,
307 std::vector<std::vector<SimplexId>> &vertexRepresentativesMax,
308 const std::vector<polarity> &toPropagateMin,
309 const std::vector<polarity> &toPropagateMax)
const {
312 std::vector<triplet> tripletsMax{}, tripletsMin{};
315 for(
SimplexId localId = 0; localId < nbDecVert; localId++) {
318 if(toPropagateMin[globalId]) {
321 if(toPropagateMax[globalId]) {
326 this->
printMsg(
"TRIPLETS", 1.0, timer.getElapsedTime(), this->threadNumber_,
329 double const tm_pairs = timer.getElapsedTime();
334 const auto tm_sort = timer.getElapsedTime();
338 typename std::remove_reference<
decltype(CTDiagram)>::type CTDiagramMin{},
341#ifdef TTK_ENABLE_OPENMP
342#pragma omp parallel sections num_threads(threadNumber_)
345#ifdef TTK_ENABLE_OPENMP
349 CTDiagramMin, vertexRepresentativesMax, tripletsMax, offsets,
true);
350#ifdef TTK_ENABLE_OPENMP
354 CTDiagramMax, vertexRepresentativesMin, tripletsMin, offsets,
false);
356 CTDiagram = std::move(CTDiagramMin);
357 CTDiagram.insert(CTDiagram.end(), CTDiagramMax.begin(), CTDiagramMax.end());
359 this->
printMsg(
"PAIRS", 1.0, timer.getElapsedTime() - tm_sort,
366 const bool splitTree)
const {
371 return offsets[a] < offsets[b];
381 return lt(s1, s2) != splitTree;
383 return lt(m1, m2) == splitTree;
390 std::vector<PersistencePair> &pairs,
391 std::vector<std::vector<SimplexId>> &vertexRepresentatives,
392 std::vector<triplet> &triplets,
394 const bool splitTree)
const {
401 return offsets[a] < offsets[b];
405 auto r = vertexRepresentatives[v][0];
408 r = vertexRepresentatives[v][0];
413 for(
const auto &t : triplets) {
426 pairs.emplace_back(s, r1, 2);
434 pairs.emplace_back(r1, s, 0);
437 vertexRepresentatives[std::get<1>(t)][0] = r2;
438 vertexRepresentatives[r1][0] = r2;
442 const std::string ptype = splitTree ?
"sad-max" :
"min-sad";
450 std::vector<std::pair<polarity, polarity>> &vlp,
455 vlp.resize(neighborNumber);
456 for(
SimplexId i = 0; i < neighborNumber; i++) {
459 const bool lower0 = offsets[neighborId0] < offsets[vertexId];
461 vlp[i] = std::make_pair(isUpper0, 0);
467 std::vector<std::pair<polarity, polarity>> &vlp,
479 link.
alloc(neighborNumber);
486 const auto &vl = vlbt[vertexLink];
487 for(
size_t edgeId = 0; edgeId < vl.size(); edgeId++) {
490 if(vlp[n0].first == vlp[n1].first) {
498 std::vector<polarity> &isNew,
499 std::vector<std::vector<std::pair<polarity, polarity>>> &vertexLinkPolarity,
500 std::vector<polarity> &toProcess,
501 std::vector<polarity> &toReprocess,
502 std::vector<DynamicTree> &link,
503 std::vector<uint8_t> &vertexLink,
505 std::vector<char> &vertexTypes,
512#ifdef TTK_ENABLE_OPENMP
513#pragma omp parallel for num_threads(threadNumber_)
515 for(
SimplexId localId = 0; localId < nDecVerts; localId++) {
518 if(isNew[globalId]) {
521 globalId, vertexLinkPolarity[globalId], offsets);
525 vertexLinkPolarity[globalId], offsets);
534#ifdef TTK_ENABLE_OPENMP
535#pragma omp parallel for num_threads(threadNumber_)
537 for(
int i = 0; i < nDecVerts; i++) {
540 if(isNew[globalId]) {
541 if(toProcess[globalId]) {
543 vertexLink[globalId], link[globalId],
544 vertexLinkByBoundaryType, offsets);
545 vertexTypes[globalId]
547 link[globalId], toReprocess[globalId]);
549 isNew[globalId] =
false;
552 if(toReprocess[globalId]) {
553 if(toProcess[globalId]) {
555 vertexLinkByBoundaryType[vertexLink[globalId]]);
559 vertexLink[globalId], link[globalId],
560 vertexLinkByBoundaryType, offsets);
561 toProcess[globalId] = 255;
563 vertexTypes[globalId]
565 link[globalId], toReprocess[globalId]);
566 toReprocess[globalId] = 0;
572 this->
printMsg(
"CRITICAL POINTS UPDATE", 1.0,
578 std::vector<polarity> &isNew,
579 std::vector<std::vector<std::pair<polarity, polarity>>> &vertexLinkPolarity,
580 std::vector<polarity> &toPropagateMin,
581 std::vector<polarity> &toPropagateMax,
582 std::vector<polarity> &toProcess,
583 std::vector<polarity> &toReprocess,
584 std::vector<DynamicTree> &link,
585 std::vector<uint8_t> &vertexLink,
587 std::vector<std::vector<SimplexId>> &saddleCCMin,
588 std::vector<std::vector<SimplexId>> &saddleCCMax,
589 std::vector<polarity> &isUpdatedMin,
590 std::vector<polarity> &isUpdatedMax,
597#ifdef TTK_ENABLE_OPENMP
598#pragma omp parallel for num_threads(threadNumber_)
600 for(
SimplexId localId = 0; localId < nDecVerts; localId++) {
603 if(isNew[globalId]) {
606 globalId, vertexLinkPolarity[globalId], offsets);
610 vertexLinkPolarity[globalId], offsets);
619#ifdef TTK_ENABLE_OPENMP
620#pragma omp parallel for num_threads(threadNumber_)
622 for(
int i = 0; i < nDecVerts; i++) {
625 if(isNew[globalId]) {
626 if(toProcess[globalId]) {
628 vertexLink[globalId], link[globalId],
629 vertexLinkByBoundaryType, offsets);
631 link[globalId], toPropagateMin, toPropagateMax,
632 saddleCCMin, saddleCCMax);
634 isNew[globalId] =
false;
637 if(toReprocess[globalId]) {
638 if(toProcess[globalId]) {
640 vertexLinkByBoundaryType[vertexLink[globalId]]);
644 vertexLink[globalId], link[globalId],
645 vertexLinkByBoundaryType, offsets);
646 toProcess[globalId] = 255;
649 link[globalId], toPropagateMin, toPropagateMax,
650 saddleCCMin, saddleCCMax);
651 toReprocess[globalId] = 0;
656 isUpdatedMin[globalId] = 0;
657 isUpdatedMax[globalId] = 0;
660 this->
printMsg(
"CRITICAL POINTS UPDATE", 1.0,
667 const std::vector<polarity> &isNew,
668 std::vector<polarity> &toProcess,
669 std::vector<polarity> &toReprocess,
670 std::vector<std::pair<polarity, polarity>> &vlp,
673 bool hasMonotonyChanged =
false;
676 for(
SimplexId i = 0; i < neighborNumber; i++) {
681 const bool lower = offsets[neighborId] < offsets[vertexId];
682 const polarity isUpper = lower ? 0 : 255;
683 const polarity isUpperOld = vlp[i].first;
685 if(isUpper != isUpperOld) {
686 hasMonotonyChanged =
true;
688 toReprocess[vertexId] = 255;
689 toProcess[neighborId] = 255;
692 for(
SimplexId j = 0; j < neighborNumberNew; j++) {
695 if(isNew[neighborIdNew])
696 toProcess[neighborIdNew] = 255;
702 return hasMonotonyChanged;
707 std::vector<Lock> &vertLock,
708 std::vector<polarity> &toPropagate,
709 std::vector<std::vector<SimplexId>> &vertexRepresentatives,
710 std::vector<std::vector<SimplexId>> &saddleCC,
711 std::vector<polarity> &isUpdated,
712 std::vector<SimplexId> &globalExtremum,
714 const bool splitTree)
const {
716 auto &toProp = toPropagate[vertexId];
717 auto &reps = vertexRepresentatives[vertexId];
718 auto &updated = isUpdated[vertexId];
721 return (offsets[a] > offsets[b]) == splitTree;
729 vertLock[vertexId].lock();
733 const auto &CC = saddleCC[vertexId];
735 reps.reserve(CC.size());
736 for(
size_t r = 0; r < CC.size(); r++) {
741 neighborId, vertLock, toPropagate, vertexRepresentatives, saddleCC,
742 isUpdated, globalExtremum, offsets, splitTree);
743 reps.emplace_back(ret);
746 if(reps.size() > 1) {
748 std::sort(reps.begin(), reps.end(), gt);
749 const auto last = std::unique(reps.begin(), reps.end());
750 reps.erase(last, reps.end());
755 vertLock[vertexId].unlock();
766 for(
SimplexId i = 0; i < neighborNumber; i++) {
769 if(gt(neighborId, maxNeighbor)) {
770 maxNeighbor = neighborId;
773 if(maxNeighbor != vertexId) {
775 vertexRepresentatives, saddleCC, isUpdated,
776 globalExtremum, offsets, splitTree);
778#ifdef TTK_ENABLE_OPENMP
779 const auto tid = omp_get_thread_num();
783 if(gt(vertexId, globalExtremum[tid])) {
784 globalExtremum[tid] = vertexId;
791 vertLock[vertexId].unlock();
798 std::vector<polarity> &isNew,
799 std::vector<std::vector<std::pair<polarity, polarity>>> &vertexLinkPolarity,
800 std::vector<polarity> &toProcess,
801 std::vector<polarity> &toReprocess,
802 std::vector<DynamicTree> &link,
803 std::vector<uint8_t> &vertexLink,
805 std::vector<char> &vertexTypes,
812#ifdef TTK_ENABLE_OPENMP
813#pragma omp parallel for num_threads(threadNumber_)
815 for(
size_t i = 0; i < nDecVerts; i++) {
819 vertexLink[globalId], link[globalId],
820 vertexLinkByBoundaryType, offsets);
821 vertexTypes[globalId]
823 link[globalId], toReprocess[globalId]);
824 toProcess[globalId] = 255;
828 this->
printMsg(
"initial critical types", 1.0, timer.getElapsedTime(),
834 std::vector<polarity> &isNew,
835 std::vector<std::vector<std::pair<polarity, polarity>>> &vertexLinkPolarity,
836 std::vector<polarity> &toPropagateMin,
837 std::vector<polarity> &toPropagateMax,
838 std::vector<polarity> &toProcess,
839 std::vector<DynamicTree> &link,
840 std::vector<uint8_t> &vertexLink,
842 std::vector<std::vector<SimplexId>> &saddleCCMin,
843 std::vector<std::vector<SimplexId>> &saddleCCMax,
850#ifdef TTK_ENABLE_OPENMP
851#pragma omp parallel for num_threads(threadNumber_)
853 for(
size_t i = 0; i < nDecVerts; i++) {
857 vertexLink[globalId], link[globalId],
858 vertexLinkByBoundaryType, offsets);
860 toPropagateMin, toPropagateMax, saddleCCMin,
862 toProcess[globalId] = 255;
866 this->
printMsg(
"initial critical types", 1.0, timer.getElapsedTime(),
872 std::vector<polarity> &toPropagateMin,
873 std::vector<polarity> &toPropagateMax,
874 std::vector<std::vector<SimplexId>> &vertexRepresentativesMin,
875 std::vector<std::vector<SimplexId>> &vertexRepresentativesMax,
876 std::vector<std::vector<SimplexId>> &saddleCCMin,
877 std::vector<std::vector<SimplexId>> &saddleCCMax,
878 std::vector<Lock> &vertLockMin,
879 std::vector<Lock> &vertLockMax,
880 std::vector<polarity> &isUpdatedMin,
881 std::vector<polarity> &isUpdatedMax,
890#ifdef TTK_ENABLE_OPENMP
891#pragma omp parallel for num_threads(threadNumber_)
893 for(
size_t i = 0; i < nDecVerts; i++) {
895 if(toPropagateMin[v]) {
897 vertexRepresentativesMin, saddleCCMin, isUpdatedMin,
898 globalMinThr, offsets,
false);
900 if(toPropagateMax[v]) {
902 vertexRepresentativesMax, saddleCCMax, isUpdatedMax,
903 globalMaxThr, offsets,
true);
908 return offsets[a] < offsets[b];
911 globalMin_ = *std::min_element(globalMinThr.begin(), globalMinThr.end(), lt);
912 globalMax_ = *std::max_element(globalMaxThr.begin(), globalMaxThr.end(), lt);
914 this->
printMsg(
"FIRSTPROPAGATION", 1.0, timer.getElapsedTime(),
920 std::vector<polarity> &toPropagateMin,
921 std::vector<polarity> &toPropagateMax,
922 std::vector<std::vector<SimplexId>> &vertexRepresentativesMin,
923 std::vector<std::vector<SimplexId>> &vertexRepresentativesMax,
924 std::vector<std::vector<SimplexId>> &saddleCCMin,
925 std::vector<std::vector<SimplexId>> &saddleCCMax,
926 std::vector<Lock> &vertLockMin,
927 std::vector<Lock> &vertLockMax,
928 std::vector<polarity> &isUpdatedMin,
929 std::vector<polarity> &isUpdatedMax,
939#ifdef TTK_ENABLE_OPENMP
940#pragma omp parallel for num_threads(threadNumber_)
942 for(
size_t i = 0; i < nDecVerts; i++) {
944 if(toPropagateMin[v]) {
946 vertexRepresentativesMin, saddleCCMin, isUpdatedMin,
947 globalMinThr, offsets,
false);
949 if(toPropagateMax[v]) {
951 vertexRepresentativesMax, saddleCCMax, isUpdatedMax,
952 globalMaxThr, offsets,
true);
957 return offsets[a] < offsets[b];
960 globalMin_ = *std::min_element(globalMinThr.begin(), globalMinThr.end(), lt);
961 globalMax_ = *std::max_element(globalMaxThr.begin(), globalMaxThr.end(), lt);
963 this->
printMsg(
"PROPAGATION UPDATE", 1.0, tm.getElapsedTime(),
970 std::vector<std::pair<polarity, polarity>> &vlp,
973 for(
size_t i = 0; i < vlp.size(); i++) {
976 const bool lower = offsets[neighborId] < offsets[vertexId];
977 const polarity isUpper = lower ? 0 : 255;
978 vlp[i] = std::make_pair(isUpper, 0);
984 std::vector<std::pair<polarity, polarity>> &vlp,
985 std::vector<std::pair<SimplexId, SimplexId>> &vl)
const {
987 std::vector<SimplexId> monotony_changes_list{};
989 for(
size_t neighborId = 0; neighborId < vlp.size(); neighborId++) {
990 const polarity isBroken = vlp[neighborId].second;
992 monotony_changes_list.emplace_back(neighborId);
1001 std::vector<std::vector<std::pair<SimplexId, SimplexId>>> edgesToInsertLater(
1003 std::vector<std::vector<std::pair<SimplexId, SimplexId>>> edgesToRemoveLater(
1006 for(
size_t e = 0; e < vl.size(); e++) {
1009 const polarity isBroken0 = vlp[n0].second;
1010 const polarity isBroken1 = vlp[n1].second;
1012 if(isBroken0 != 0 and isBroken1 == 0) {
1013 if(vlp[n0].first != vlp[n1].first) {
1014 edgesToInsertLater[n0].emplace_back(n0, n1);
1016 edgesToRemoveLater[n0].emplace_back(n0, n1);
1018 }
else if(isBroken0 == 0 and isBroken1 != 0) {
1019 if(vlp[n0].first != vlp[n1].first) {
1020 edgesToInsertLater[n1].emplace_back(n1, n0);
1022 edgesToRemoveLater[n1].emplace_back(n1, n0);
1028 for(
const auto brokenNode : monotony_changes_list) {
1029 vlp[brokenNode].first = ~vlp[brokenNode].first;
1030 vlp[brokenNode].second = 0;
1033 for(
const auto &edge : edgesToRemoveLater[brokenNode]) {
1037 if(!edgesToRemoveLater.empty()) {
1039 for(
const auto &edge : vl) {
1040 if(vlp[edge.first].first == vlp[edge.second].first) {
1047 for(
const auto brokenNode : monotony_changes_list) {
1048 for(
const auto &edge : edgesToInsertLater[brokenNode]) {
1055 const double currItDuration,
const size_t nCurrPairs)
const {
1061 return -0.21 + 0.77 / (
decimationLevel_ + 1) - 4.0 * nCurrPairs / nCurrVerts
1063 * (3.3 - 2.32 / nCurrPairs + 32.3 * nCurrPairs / nCurrVerts);
1069 this->
printMsg(
"Computation stopped at resolution level "
1071 this->decimationLevel_)));
1094 const std::vector<std::pair<polarity, polarity>> &vlp,
1098 const auto nbCC = link.
getNbCC();
1104 SimplexId downValence = 0, upValence = 0;
1106 std::vector<size_t> CCIds;
1107 CCIds.reserve(nbCC);
1109 for(
size_t i = 0; i < CCIds.size(); i++) {
1111 const polarity isUpper = vlp[neighbor].first;
1119 if(downValence == -1 && upValence == -1) {
1121 }
else if(downValence == 0 && upValence == 1) {
1123 }
else if(downValence == 1 && upValence == 0) {
1125 }
else if(downValence == 1 && upValence == 1) {
1132 bool isUpperOnBoundary =
false, isLowerOnBoundary =
false;
1133 const SimplexId neighborNumber = vlp.size();
1135 for(
int ineigh = 0; ineigh < neighborNumber; ineigh++) {
1139 if(vlp[ineigh].first) {
1140 isUpperOnBoundary =
true;
1142 isLowerOnBoundary =
true;
1147 if((isUpperOnBoundary) && (!isLowerOnBoundary)) {
1150 if((!isUpperOnBoundary) && (isLowerOnBoundary)) {
1160 if(dimensionality == 2) {
1161 if((downValence == 2 && upValence == 1)
1162 || (downValence == 1 && upValence == 2)
1163 || (downValence == 2 && upValence == 2)) {
1174 }
else if(dimensionality == 3) {
1175 if(downValence == 2 && upValence == 1) {
1177 }
else if(downValence == 1 && upValence == 2) {
1192 std::vector<PersistencePair> &diagram,
const SimplexId *
const offsets)
const {
1195 return offsets[a.
birth] < offsets[b.birth];
1198 std::sort(diagram.begin(), diagram.end(), cmp);
1202 std::vector<std::pair<SimplexId, char>> *criticalPoints,
1205 printMsg(
"Progressive Critical Points computation");
1210 criticalPoints->clear();
1211 criticalPoints->reserve(vertexNumber);
1212 for(
SimplexId i = 0; i < vertexNumber; i++) {
bool ImplicitTriangulationCRTP< Derived >::TTK_TRIANGULATION_INTERNAL isVertexOnBoundary(const SimplexId &vertexId) const
#define TTK_PSORT(NTHREADS,...)
Parallel sort macro.
int printErr(const std::string &msg, const debug::LineMode &lineMode=debug::LineMode::NEW, std::ostream &stream=std::cerr) const
Implements the Dynamic Tree data-structure (or ST-Tree)
void alloc(const std::size_t nbNodes)
bool insertEdge(DynTreeNode *const n1, DynTreeNode *const n2)
DynTreeNode * getNode(const std::size_t nid)
get the node with the id: nid
void removeEdge(DynTreeNode *const n)
remove the link btwn n and its parent
void retrieveNbCC(std::vector< size_t > &nbccIds) const
int startingDecimationLevel_
std::string resolutionInfoString()
MultiresTriangulation multiresTriangulation_
std::vector< PersistencePair > CTDiagram_
void buildVertexLinkByBoundary(const SimplexId vertexId, VLBoundaryType &vlbt) const
int stoppingDecimationLevel_
void getValencesFromLink(const SimplexId vertexId, const std::vector< std::pair< polarity, polarity > > &vlp, DynamicTree &link, std::vector< polarity > &toPropagateMin, std::vector< polarity > &toPropagateMax, std::vector< std::vector< SimplexId > > &saddleCCMin, std::vector< std::vector< SimplexId > > &saddleCCMax) const
void getTripletsFromSaddles(const SimplexId vertexId, std::vector< triplet > &triplets, const std::vector< std::vector< SimplexId > > &vertexReps) const
std::vector< std::vector< SimplexId > > saddleCCMin_
void sortTriplets(std::vector< triplet > &triplets, const SimplexId *const offsets, const bool splitTree) const
std::vector< polarity > toReprocess_
std::vector< std::vector< std::pair< polarity, polarity > > > vertexLinkPolarity_
void updateDynamicLink(DynamicTree &link, std::vector< std::pair< polarity, polarity > > &vlp, std::vector< std::pair< SimplexId, SimplexId > > &vl) const
std::vector< std::vector< SimplexId > > vertexRepresentativesMin_
std::vector< char > vertexTypes_
std::vector< polarity > isNew_
int executeCPProgressive(int computePersistenceDiagram, const SimplexId *inputOffsets)
ttk::SimplexId propagateFromSaddles(const SimplexId vertexId, std::vector< Lock > &vertLock, std::vector< polarity > &toPropagate, std::vector< std::vector< SimplexId > > &vertexRepresentatives, std::vector< std::vector< SimplexId > > &saddleCC, std::vector< polarity > &isUpdated, std::vector< SimplexId > &globalExtremum, const SimplexId *const offsets, const bool splitTree) const
std::vector< uint8_t > vertexLink_
void initSaddleSeeds(std::vector< polarity > &isNew, std::vector< std::vector< std::pair< polarity, polarity > > > &vertexLinkPolarity, std::vector< polarity > &toPropagateMin, std::vector< polarity > &toPropagateMax, std::vector< polarity > &toProcess, std::vector< DynamicTree > &link, std::vector< uint8_t > &vertexLink, VLBoundaryType &vertexLinkByBoundaryType, std::vector< std::vector< SimplexId > > &saddleCCMin, std::vector< std::vector< SimplexId > > &saddleCCMax, const SimplexId *const offsets) const
void initCriticalPoints(std::vector< polarity > &isNew, std::vector< std::vector< std::pair< polarity, polarity > > > &vertexLinkPolarity, std::vector< polarity > &toProcess, std::vector< polarity > &toReprocess, std::vector< DynamicTree > &link, std::vector< uint8_t > &vertexLink, VLBoundaryType &vertexLinkByBoundaryType, std::vector< char > &vertexTypes, const SimplexId *const offsets) const
void buildVertexLinkPolarity(const SimplexId vertexId, std::vector< std::pair< polarity, polarity > > &vlp, const SimplexId *const offsets) const
std::vector< polarity > toProcess_
void initDynamicLink(const SimplexId &vertexId, std::vector< std::pair< polarity, polarity > > &vlp, uint8_t &vertexLink, DynamicTree &link, VLBoundaryType &vlbt, const SimplexId *const offsets) const
void computePersistencePairsFromSaddles(std::vector< PersistencePair > &CTDiagram, const SimplexId *const offsets, std::vector< std::vector< SimplexId > > &vertexRepresentativesMin, std::vector< std::vector< SimplexId > > &vertexRepresentativesMax, const std::vector< polarity > &toPropagateMin, const std::vector< polarity > &toPropagateMax) const
char getCriticalTypeFromLink(const SimplexId globalId, const std::vector< std::pair< polarity, polarity > > &vlp, DynamicTree &link, polarity &reprocess) const
void initPropagation(std::vector< polarity > &toPropagateMin, std::vector< polarity > &toPropagateMax, std::vector< std::vector< SimplexId > > &vertexRepresentativesMin, std::vector< std::vector< SimplexId > > &vertexRepresentativesMax, std::vector< std::vector< SimplexId > > &saddleCCMin, std::vector< std::vector< SimplexId > > &saddleCCMax, std::vector< Lock > &vertLockMin, std::vector< Lock > &vertLockMax, std::vector< polarity > &isUpdatedMin, std::vector< polarity > &isUpdatedMax, const SimplexId *const offsets) const
bool getMonotonyChangeByOldPointCP(const SimplexId vertexId, const std::vector< polarity > &isNew, std::vector< polarity > &toProcess, std::vector< polarity > &toReprocess, std::vector< std::pair< polarity, polarity > > &vlp, const SimplexId *const offsets) const
void updatePropagation(std::vector< polarity > &toPropagateMin, std::vector< polarity > &toPropagateMax, std::vector< std::vector< SimplexId > > &vertexRepresentativesMin, std::vector< std::vector< SimplexId > > &vertexRepresentativesMax, std::vector< std::vector< SimplexId > > &saddleCCMin, std::vector< std::vector< SimplexId > > &saddleCCMax, std::vector< Lock > &vertLockMin, std::vector< Lock > &vertLockMax, std::vector< polarity > &isUpdatedMin, std::vector< polarity > &isUpdatedMax, const SimplexId *const offsets) const
int computeProgressivePD(std::vector< PersistencePair > &CTDiagram, const SimplexId *offsets)
std::vector< std::vector< SimplexId > > saddleCCMax_
std::vector< std::vector< SimplexId > > vertexRepresentativesMax_
void sortPersistenceDiagram2(std::vector< PersistencePair > &diagram, const SimplexId *const offsets) const
int resumeProgressive(int computePersistenceDiagram, const SimplexId *offsets)
void updateSaddleSeeds(std::vector< polarity > &isNew, std::vector< std::vector< std::pair< polarity, polarity > > > &vertexLinkPolarity, std::vector< polarity > &toPropagateMin, std::vector< polarity > &toPropagateMax, std::vector< polarity > &toProcess, std::vector< polarity > &toReprocess, std::vector< DynamicTree > &link, std::vector< uint8_t > &vertexLink, VLBoundaryType &vertexLinkByBoundaryType, std::vector< std::vector< SimplexId > > &saddleCCMin, std::vector< std::vector< SimplexId > > &saddleCCMax, std::vector< polarity > &isUpdatedMin, std::vector< polarity > &isUpdatedMax, const SimplexId *const offsets) const
double predictNextIterationDuration(const double currItDuration, const size_t nCurrPairs) const
void clearResumableState()
std::vector< DynamicTree > link_
VLBoundaryType vertexLinkByBoundaryType_
void updateLinkPolarity(const SimplexId vertexId, std::vector< std::pair< polarity, polarity > > &vlp, const SimplexId *const offsets) const
void stopComputationIf(const bool b)
void updateCriticalPoints(std::vector< polarity > &isNew, std::vector< std::vector< std::pair< polarity, polarity > > > &vertexLinkPolarity, std::vector< polarity > &toProcess, std::vector< polarity > &toReprocess, std::vector< DynamicTree > &link, std::vector< uint8_t > &vertexLink, VLBoundaryType &vertexLinkByBoundaryType, std::vector< char > &vertexTypes, const SimplexId *const offsets) const
void tripletsToPersistencePairs(std::vector< PersistencePair > &pairs, std::vector< std::vector< SimplexId > > &vertexRepresentatives, std::vector< triplet > &triplets, const SimplexId *const offsets, const bool splitTree) const
int computeProgressiveCP(std::vector< std::pair< SimplexId, char > > *criticalPoints, const SimplexId *offsets)
std::array< std::vector< std::pair< SimplexId, SimplexId > >, nLink_ > VLBoundaryType
int SimplexId
Identifier type for simplices of any dimension.
std::tuple< ttk::SimplexId, ttk::SimplexId, ttk::SimplexId > triplet
Persistence pair type (with persistence in double)
void evert()
Make this node the root of its tree.
printMsg(debug::output::BOLD+" | | | | | . \\ | | (__| | / __/| |_| / __/| (_) |"+debug::output::ENDCOLOR, debug::Priority::PERFORMANCE, debug::LineMode::NEW, stream)