30 template <
typename scalarType>
32 const auto &nbVertices =
scalars_->size;
34 if(
scalars_->sortedVertices.size() !=
static_cast<size_t>(nbVertices)) {
35 scalars_->sortedVertices.resize(nbVertices);
38#ifdef TTK_ENABLE_OPENMP
39#pragma omp parallel for
41 for(
SimplexId i = 0; i < nbVertices; i++) {
52 template <
typename scalarType>
56 std::list<std::vector<std::pair<SimplexId, bool>>> &storage) {
59 if(!
params_->simplifyThreshold) {
63 const bool DEBUG =
false;
70 std::vector<std::tuple<SimplexId, SimplexId, scalarType, bool>> pairs;
71 computePersistencePairs<scalarType>(pairs);
74 std::cout <<
"pairs : ( threshold : " <<
params_->simplifyThreshold
76 for(
const auto &p : pairs) {
77 const SimplexId &thisOriginVert = std::get<0>(p);
78 const SimplexId &thisEndVert = std::get<1>(p);
79 const scalarType &thisPersist = std::get<2>(p);
80 const bool thisNeedUp = std::get<3>(p);
81 std::cout << thisOriginVert <<
" - " << thisEndVert <<
" : "
83 std::cout <<
" ( " << thisNeedUp <<
" )" << std::endl;
85 std::cout << std::endl;
94 return simplifyTree<scalarType>(posSeed0, posSeed1, storage, pairs);
99 template <
typename scalarType,
typename triangulationType>
103 std::list<std::vector<std::pair<SimplexId, bool>>> &storage,
104 const triangulationType &mesh) {
107 if(!
params_->simplifyThreshold) {
116 auto isLowerComp = [&](
const idNode &n1,
const idNode &n2) {
122 std::vector<idNode> sortedNodes(nbNode);
123 iota(sortedNodes.begin(), sortedNodes.end(), 0);
137 std::vector<std::tuple<SimplexId, SimplexId, scalarType, bool>> pairsJT;
138 std::vector<std::tuple<SimplexId, SimplexId, scalarType, bool>> pairsST;
140 recoverMTPairs<scalarType>(sortedNodes, pairsJT, pairsST, mesh);
149 = [](
const std::tuple<SimplexId, SimplexId, scalarType, bool> &a,
150 const std::tuple<SimplexId, SimplexId, scalarType, bool> &b) {
152 return std::get<2>(a) < std::get<2>(b);
155 std::vector<std::tuple<SimplexId, SimplexId, scalarType, bool>>
157 size_t sizePJT = pairsJT.size(), sizePST = pairsST.size();
159 sortedPairs.reserve(sizePJT + sizePST);
161 sortedPairs.insert(sortedPairs.end(), pairsJT.begin(), pairsJT.end());
162 sortedPairs.insert(sortedPairs.end(), pairsST.begin(), pairsST.end());
168 this->
threadNumber_, sortedPairs.begin(), sortedPairs.end(), pairComp);
170 auto last = unique(sortedPairs.begin(), sortedPairs.end());
171 sortedPairs.erase(last, sortedPairs.end());
180 return simplifyTree<scalarType>(posSeed0, posSeed1, storage, sortedPairs);
184 template <
typename scalarType>
188 std::list<std::vector<std::pair<SimplexId, bool>>> &storage,
189 const std::vector<std::tuple<SimplexId, SimplexId, scalarType, bool>>
195 std::vector<ExtendedUnionFind> storageUF(nbNode, 0);
196 std::vector<ExtendedUnionFind *> subtreeUF(nbNode,
nullptr);
199 std::vector<std::pair<idSuperArc, idSuperArc>> valenceOffset(
200 nbNode, std::make_pair(0, 0));
203 const bool DEBUG =
false;
206 std::cout <<
"Impact simplify on tree btwn : " << posSeed0 <<
" and "
207 << posSeed1 << std::endl;
215 std::queue<std::tuple<idNode, bool>> node2see;
218 for(
const auto &pp : sortedPairs) {
219 if(std::get<2>(pp) <
params_->simplifyThreshold) {
220 const SimplexId &thisOriginVert = std::get<0>(pp);
221 const SimplexId &thisEndVert = std::get<1>(pp);
224 if(
scalars_->sosOffsets[thisOriginVert] <= posSeed0
225 ||
scalars_->sosOffsets[thisOriginVert] >= posSeed1
226 ||
scalars_->sosOffsets[thisEndVert] <= posSeed0
227 ||
scalars_->sosOffsets[thisEndVert] >= posSeed1) {
231 node2see.emplace(thisOriginId, std::get<3>(pp));
233 subtreeUF[thisOriginId] = &storageUF[thisOriginId];
236 std::cout <<
"willSee " <<
printNode(thisOriginId) << std::endl;
251 while(!node2see.empty()) {
255 std::tie(curNodeId, needToGoUp) = node2see.front();
260 std::cout <<
"process : " <<
printNode(curNodeId) << std::endl;
268 mergingArcId = newUpArc(curNodeId, subtreeUF);
269 parentNodeId =
getSuperArc(mergingArcId)->getUpNodeId();
270 ++valenceOffset[curNodeId].second;
271 ++valenceOffset[parentNodeId].first;
273 mergingArcId = newDownArc(curNodeId, subtreeUF);
274 parentNodeId =
getSuperArc(mergingArcId)->getDownNodeId();
275 ++valenceOffset[curNodeId].first;
276 ++valenceOffset[parentNodeId].second;
279 markThisArc(subtreeUF, curNodeId, mergingArcId, parentNodeId);
284 if(valenceOffset[parentNodeId].first
285 + valenceOffset[parentNodeId].second + 1
286 ==
getNode(parentNodeId)->getValence()) {
289 parentNodeId, valenceOffset[parentNodeId].second + 1 ==
291 getNode(parentNodeId)->getUpValence());
293 std::cout <<
" add to see " <<
printNode(parentNodeId) << std::endl;
303 std::cout <<
"node subtrees before creating receptarc " << std::endl;
304 for(
idNode nid = 0; nid < nbNode; nid++) {
307 <<
" is in subtree rooted :";
308 const idNode &root = -subtreeUF[nid]->find()->getData() - 1;
310 const SimplexId &segmSize = subtreeUF[nid]->find()->getOrigin();
311 std::cout <<
" with segmentation of " << segmSize << std::endl;
323 for(
const auto &pp : sortedPairs) {
324 if(std::get<2>(pp) <
params_->simplifyThreshold) {
325 const SimplexId &thisOriginVert = std::get<0>(pp);
326 const SimplexId &thisEndVert = std::get<1>(pp);
330 if(
scalars_->sosOffsets[thisOriginVert] <= posSeed0
331 ||
scalars_->sosOffsets[thisOriginVert] >= posSeed1
332 ||
scalars_->sosOffsets[thisEndVert] <= posSeed0
333 ||
scalars_->sosOffsets[thisEndVert] >= posSeed1) {
337 if(subtreeUF[thisOriginId]->find()->getData() < 0) {
340 = -subtreeUF[thisOriginId]->find()->getData() - 1;
345 const std::tuple<idNode, idNode, SimplexId> &receptArc
347 subtreeRoot, receptArcId, subtreeUF, valenceOffset);
350 const bool overlapB =
355 const bool overlapA =
361 =
makeSuperArc(std::get<0>(receptArc), std::get<1>(receptArc),
362 overlapB, overlapA,
nullptr, -1);
372 subtreeUF[thisOriginId]->find()->setData(receptArcId);
374 ->makeAllocGlobal(std::get<2>(receptArc), storage);
377 std::cout <<
"create arc : " <<
printArc(receptArcId)
378 <<
" with segm : " << std::get<2>(receptArc)
398 for(
idSuperArc arc = 0; arc < nbArcs; arc++) {
406 std::cout <<
" parallel merge in " <<
printArc(receptacleArcId)
408 std::cout <<
" arc " <<
printArc(arc)
413 ->addSegmentationGlobal(
419 if(!(subtreeUF[downNode] && subtreeUF[upNode]))
422 if(subtreeUF[downNode] && subtreeUF[upNode]
423 && subtreeUF[downNode]->find() != subtreeUF[upNode]->find()) {
425 std::cout <<
"Arc between 2 degenerate with mergin "
427 std::cout <<
"below recept : "
428 <<
printArc(subtreeUF[downNode]->find()->getData());
429 std::cout << std::endl;
430 std::cout <<
"Above recept : "
431 <<
printArc(subtreeUF[upNode]->find()->getData())
433 std::cout << std::endl;
440 ? subtreeUF[upNode]->find()
441 : subtreeUF[downNode]->
find();
446 std::cout <<
"merge in " <<
printArc(receptacleArcId) << std::endl;
447 std::cout <<
" arc " <<
printArc(arc)
449 std::cout << std::endl;
455 ->addSegmentationGlobal(
getSuperArc(arc)->getVertList(),
459 ->addSegmentationGlobal(
getNode(downNode)->getVertexId());
462 ->addSegmentationGlobal(
getNode(upNode)->getVertexId());
471 if(!
getNode(downNode)->getNumberOfUpSuperArcs())
473 if(!
getNode(upNode)->getNumberOfDownSuperArcs())
485 template <
typename scalarType,
typename triangulationType>
487 std::vector<std::tuple<SimplexId, SimplexId, scalarType>> &pairs,
488 const triangulationType &mesh) {
489#ifndef TTK_ENABLE_KAMIKAZE
502 addPair<scalarType>(pairs, curVert, termVert, mesh);
506 = [](
const std::tuple<SimplexId, SimplexId, scalarType> &a,
507 const std::tuple<SimplexId, SimplexId, scalarType> &b) {
508 return std::get<2>(a) < std::get<2>(b);
511 sort(pairs.begin(), pairs.end(), pair_sort);
516 template <
typename scalarType,
typename triangulationType>
518 std::vector<std::tuple<SimplexId, SimplexId, scalarType, bool>> &pairs,
519 const triangulationType &mesh) {
522#ifndef TTK_ENABLE_KAMIKAZE
528 std::cout <<
"WARNING, computePersistencePairs is made to be called on "
529 <<
"Join or Split Tree" << std::endl;
545 = [](
const std::tuple<SimplexId, SimplexId, scalarType, bool> &a,
546 const std::tuple<SimplexId, SimplexId, scalarType, bool> &b) {
547 return std::get<2>(a) < std::get<2>(b);
550 sort(pairs.begin(), pairs.end(), pair_sort);
555 template <
typename scalarType,
typename triangulationType>
557 const std::vector<idNode> &sortedNodes,
558 std::vector<std::tuple<SimplexId, SimplexId, scalarType, bool>> &pairsJT,
559 std::vector<std::tuple<SimplexId, SimplexId, scalarType, bool>> &pairsST,
560 const triangulationType &mesh) {
563 std::vector<ExtendedUnionFind> storage_JoinUF(nbNode, 0);
564 std::vector<ExtendedUnionFind> storage_SplitUF(nbNode, 0);
566 std::vector<ExtendedUnionFind *> vect_JoinUF(nbNode,
nullptr);
567 std::vector<ExtendedUnionFind *> vect_SplitUF(nbNode,
nullptr);
569#ifdef TTK_ENABLE_OPENMP
570#pragma omp parallel sections num_threads(2)
573#ifdef TTK_ENABLE_OPENMP
579 std::map<SimplexId, SimplexId> pendingMinMax;
581 for(
auto it = sortedNodes.cbegin(); it != sortedNodes.cend(); ++it) {
591 vect_JoinUF[n] = &storage_JoinUF[n];
592 vect_JoinUF[n]->setOrigin(v);
637 pairsJT, neighUF->
getOrigin(), v, mesh,
true);
638 pendingMinMax.erase(neighUF->
getOrigin());
651 vect_JoinUF[n] = merge->
find();
657 pendingMinMax[further] = v;
663 for(
const auto &pair_vert : pendingMinMax) {
668 pairsJT, pair_vert.first, pair_vert.second, mesh,
true);
673#ifdef TTK_ENABLE_OPENMP
679 std::map<SimplexId, SimplexId> pendingMinMax;
681 for(
auto it = sortedNodes.crbegin(); it != sortedNodes.crend();
692 vect_SplitUF[n] = &storage_SplitUF[n];
693 vect_SplitUF[n]->setOrigin(v);
744 pairsST, neighUF->
getOrigin(), v, mesh,
false);
746 pendingMinMax.erase(neighUF->
getOrigin());
761 vect_SplitUF[n] = merge->
find();
764 pendingMinMax[further] = v;
771 for(
const auto &pair_vert : pendingMinMax) {
773 pairsST, pair_vert.first, pair_vert.second, mesh,
false);
783 template <
typename scalarType,
typename triangulationType>
784 void MergeTree::addPair(
785 std::vector<std::tuple<SimplexId, SimplexId, scalarType, bool>> &pairs,
788 const triangulationType &mesh,
793 std::abs(
static_cast<double>(getValue<scalarType>(orig)
794 - getValue<scalarType>(term))),
797 float coordOrig[3], coordTerm[3], span;
798 mesh->getVertexPoint(orig, coordOrig[0], coordOrig[1], coordOrig[2]);
799 mesh->getVertexPoint(term, coordTerm[0], coordTerm[1], coordTerm[2]);
801 pairs.emplace_back(orig, term, span, goUp);
805 template <
typename scalarType,
typename triangulationType>
806 void MergeTree::addPair(
807 std::vector<std::tuple<SimplexId, SimplexId, scalarType>> &pairs,
810 const triangulationType &mesh) {
814 std::abs(
static_cast<double>(getValue<scalarType>(orig)
815 - getValue<scalarType>(term))));
817 float coordOrig[3], coordTerm[3], span;
818 mesh->getVertexPoint(orig, coordOrig[0], coordOrig[1], coordOrig[2]);
819 mesh->getVertexPoint(term, coordTerm[0], coordTerm[1], coordTerm[2]);
821 pairs.emplace_back(orig, term, span);
825 template <
typename triangulationType>
827 const std::vector<SimplexId> &overlapBefore,
828 const std::vector<SimplexId> &overlapAfter,
833 const triangulationType &mesh) {
861 const SimplexId beforeStart = (isJT) ? 0 : overlapBefore.size() - 1;
862 const SimplexId beforeEnd = (isJT) ? overlapBefore.size() : -1;
865 const SimplexId afterStart = (isJT) ? 0 : overlapAfter.size() - 1;
866 const SimplexId afterEnd = (isJT) ? overlapAfter.size() : -1;
870#ifdef TTK_ENABLE_OPENMP
874 std::stringstream msg;
876 msg <<
", isJT : " << isJT;
878 msg <<
"before : " << std::abs(beforeEnd - beforeStart);
879 msg <<
", main : " << std::abs(mainEnd - mainStart);
880 msg <<
", after : " << std::abs(afterEnd - afterStart);
882 msg << std::abs(beforeEnd - beforeStart)
883 + std::abs(mainEnd - mainStart)
884 + std::abs(afterEnd - afterStart);
896 for(sortedNode = beforeStart; sortedNode != beforeEnd;
897 sortedNode += step) {
898 const SimplexId currentVertex = overlapBefore[sortedNode];
899 const bool overlapB = isJT;
900 const bool overlapA = !isJT;
902 currentVertex, vect_baseUF, overlapB, overlapA, mesh, timerBegin);
912 for(sortedNode = mainStart; sortedNode != mainEnd; sortedNode += step) {
915 currentVertex, vect_baseUF,
false,
false, mesh, timerBegin);
925 for(sortedNode = afterStart; sortedNode != afterEnd; sortedNode += step) {
926 const SimplexId currentVertex = overlapAfter[sortedNode];
927 const bool overlapB = !isJT;
928 const bool overlapA = isJT;
930 currentVertex, vect_baseUF, overlapB, overlapA, mesh, timerBegin);
953 if(!mesh->getVertexNeighborNumber(corrVertex)) {
956 tmp_sa = (
idSuperArc)((vect_baseUF[corrVertex])->find()->getData());
957 origin = (
idSuperArc)((vect_baseUF[corrVertex])->find()->getOrigin());
1003 template <
typename triangulationType>
1005 std::vector<ExtendedUnionFind *> &vect_baseUF,
1006 const bool overlapB,
1007 const bool overlapA,
1008 const triangulationType &mesh,
1010 std::vector<ExtendedUnionFind *> vect_neighUF;
1015 = mesh->getVertexNeighborNumber(currentVertex);
1019 idNode closingNode, currentNode;
1023 for(
SimplexId n = 0; n < neighborNumber; ++n) {
1024 mesh->getVertexNeighbor(currentVertex, n, neighbor);
1026 tmpseed = vect_baseUF[neighbor];
1028 if(tmpseed ==
nullptr) {
1032 tmpseed = tmpseed->find();
1035 if(find(vect_neighUF.cbegin(), vect_neighUF.cend(), tmpseed)
1036 == vect_neighUF.end()) {
1037 vect_neighUF.emplace_back(tmpseed);
1042 (neighSize = vect_neighUF.size());
1052#ifdef TTK_ENABLE_OPENMP
1060 currentNode =
makeNode(currentVertex);
1062 currentArc =
openSuperArc(currentNode, overlapB, overlapA);
1068 this->
printMsg(
"Min node id: " + std::to_string(currentVertex), 1.0,
1069 begin.getElapsedTime(), this->threadNumber_);
1071 this->
printMsg(
"Max node id: " + std::to_string(currentVertex), 1.0,
1072 begin.getElapsedTime(), this->threadNumber_);
1075 }
else if(neighSize > 1) {
1082 closingNode =
makeNode(currentVertex);
1083 currentArc =
openSuperArc(closingNode, overlapB, overlapA);
1085 SimplexId farOrigin = vect_neighUF[0]->find()->getOrigin();
1088 for(
auto *neigh : vect_neighUF) {
1090 overlapB, overlapA);
1099 if((isJT &&
isLower(neigh->find()->getOrigin(), farOrigin))
1100 || (!isJT &&
isHigher(neigh->find()->getOrigin(), farOrigin))) {
1105 farOrigin = neigh->find()->getOrigin();
1114 if(seed ==
nullptr) {
1124 this->
printMsg(
"Saddle node id: " + std::to_string(currentVertex),
1128#ifndef TTK_ENABLE_KAMIKAZE
1129 if(seed ==
nullptr) {
1139 getSuperArc(currentArc)->setLastVisited(currentVertex);
1140 vect_baseUF[currentVertex] = seed;
1143 template <
typename triangulationType>
1144 bool MergeTree::verifyTree(
const triangulationType &mesh) {
1147#ifdef TTK_ENABLE_OPENMP
1154 std::cout <<
"Verify Tree : " << std::endl;
1155 std::cout <<
"nbNode initial : " << nbNodes << std::endl;
1156 std::cout <<
"nbArcs initial : " << nbArcs << std::endl;
1163 for(
idSuperArc aid = 0; aid < nbArcs; aid++) {
1169 if(up == nullNodes || down == nullNodes) {
1171 std::cout <<
"[Verif]: arc id : " << aid
1172 <<
"have a null boundary :";
1173 std::cout <<
" down :" << down <<
" up:" << up << std::endl;
1188 std::cout <<
"[Verif]: arc " <<
printArc(aid)
1189 <<
" is not known by its up node :";
1197 const auto &upNbUp = ndown.getNumberOfUpSuperArcs();
1199 if(ndown.getUpSuperArcId(u) == aid) {
1206 std::cout <<
"[Verif]: arc " <<
printArc(aid)
1207 <<
" is not known by its down node :";
1216 for(
idNode nid = 0; nid < nbNodes; nid++) {
1218 if(!node.isHidden()) {
1222 const auto &nbup = node.getNumberOfUpSuperArcs();
1226 const idNode arcDownNode = arc.getDownNodeId();
1227 if(arcDownNode != nid || !arc.isVisible()) {
1229 const idNode upnode = arc.getUpNodeId();
1230 const idNode downnode = arc.getDownNodeId();
1231 if(upnode == nullNodes || downnode == nullNodes) {
1232 std::cout <<
"[Verif]: arc id : " << node.getUpSuperArcId(ua);
1233 std::cout <<
"have a null boundary :";
1234 std::cout <<
" down :" << downnode <<
" up:" << upnode
1237 std::cout <<
"[Verif] Node " << node.getVertexId()
1239 std::cout <<
" Problem with up arc : "
1240 <<
printArc(node.getUpSuperArcId(ua)) << std::endl;
1246 const auto &nbdown = node.getNumberOfDownSuperArcs();
1250 const idNode arcUpNode = arc.getUpNodeId();
1251 if(arcUpNode != nid || !arc.isVisible()) {
1253 const idNode upnode = arc.getUpNodeId();
1254 const idNode downnode = arc.getDownNodeId();
1255 if(upnode == nullNodes || downnode == nullNodes) {
1256 std::cout <<
"[Verif]: arc id : "
1257 << node.getDownSuperArcId(da);
1258 std::cout <<
"have a null boundary :";
1259 std::cout <<
" down :" << downnode <<
" up:" << upnode
1262 std::cout <<
"[Verif] Node " << node.getVertexId()
1264 std::cout <<
" Problem with down arc : "
1265 <<
printArc(node.getUpSuperArcId(da)) << std::endl;
1273 const auto &nbVert = mesh->getNumberOfVertices();
1274 std::vector<bool> segmSeen(nbVert,
false);
1276 for(
idSuperArc aid = 0; aid < nbArcs; aid++) {
1279 if(!arc.isVisible())
1282 const SimplexId segmSize = arc.getVertSize();
1283 const std::pair<SimplexId, bool> *segmVect = arc.getVertList();
1285 if(segmSize && !segmVect) {
1287 std::cout <<
"[Verif] Inconsistent segmentation for arc : ";
1289 std::cout <<
" have size of " << segmSize;
1290 std::cout <<
" and a null list" << std::endl;
1293 if(segmVect !=
nullptr) {
1294 for(
SimplexId v = 0; v < segmSize; v++) {
1295 if(!segmVect[v].second) {
1296 segmSeen.at(segmVect[v].first) =
true;
1302 for(
const Node &node :
treeData_.nodes) {
1306 segmSeen.at(node.getVertexId()) =
true;
1309 std::cout <<
"Segm missing : ";
1313 std::cout << v <<
", ";
1316 std::cout << std::endl;
1318 std::cout <<
"Nb visible Node : " << nbNodesVisible << std::endl;
1319 std::cout <<
"Nb visible Arcs : " << nbArcsVisible << std::endl;
#define TTK_PSORT(NTHREADS,...)
Parallel sort macro.
Legacy backward compatibility.
int getNumberOfDownSuperArcs() const
int getDownSuperArcId(const int &neighborId) const
const ufDataType & getData() const
void setData(const ufDataType &d)
void setOrigin(const SimplexId &origin)
const SimplexId & getOrigin() const
static ExtendedUnionFind * makeUnion(ExtendedUnionFind *uf0, ExtendedUnionFind *uf1)
ExtendedUnionFind * find()
void hideArc(const idSuperArc &sa)
std::list< ExtendedUnionFind > storageEUF_
idNode makeNode(const SimplexId &vertexId, const SimplexId &linked=nullVertex)
Node * vertex2Node(const SimplexId &vert)
idNode getNumberOfNodes() const
idSuperArc openSuperArc(const idNode &downNodeId, const bool overlapB, const bool overlapA)
void sortInput()
if sortedVertices_ is null, define and fill it Also fill the mirror std::vector
int build(std::vector< ExtendedUnionFind * > &vect_baseUF, const std::vector< SimplexId > &overlapBefore, const std::vector< SimplexId > &overlapAfter, SimplexId start, SimplexId end, const SimplexId &posSeed0, const SimplexId &posSeed1, const triangulationType &mesh)
Compute the merge tree using Carr's algorithm.
std::string printArc(const idSuperArc &a)
SimplexId globalSimplify(const SimplexId posSeed0, const SimplexId posSeed1, std::list< std::vector< std::pair< SimplexId, bool > > > &storage, const triangulationType &mesh)
std::shared_ptr< Scalars > scalars_
void mergeArc(const idSuperArc &sa, const idSuperArc &recept, const bool changeConnectivity=true)
void markThisArc(std::vector< ExtendedUnionFind * > &ufArray, const idNode &curNodeId, const idSuperArc &mergingArcId, const idNode &parentNodeId)
idSuperArc getNumberOfSuperArcs() const
void processVertex(const SimplexId &vertex, std::vector< ExtendedUnionFind * > &vect_baseUF, const bool overlapB, const bool overlapA, const triangulationType &mesh, DebugTimer &begin)
bool isCorrespondingNode(const SimplexId &val) const
SimplexId localSimplify(const SimplexId &podSeed0, const SimplexId &podSeed1, std::list< std::vector< std::pair< SimplexId, bool > > > &storage)
SimplexId simplifyTree(const SimplexId &posSeed0, const SimplexId &posSeed1, std::list< std::vector< std::pair< SimplexId, bool > > > &storage, const std::vector< std::tuple< SimplexId, SimplexId, scalarType, bool > > &sortedPairs)
idSuperArc makeSuperArc(const idNode &downNodeId, const idNode &upNodeId, const bool overlapB, const bool overlapA, std::pair< SimplexId, bool > *vertexList=nullptr, SimplexId vertexSize=-1)
std::string printNode(const idNode &n)
void updateCorrespondingArc(const SimplexId &arc, const idSuperArc &val)
bool isHigher(const SimplexId &a, const SimplexId &b) const
idNode getCorrespondingNodeId(const SimplexId &val) const
void closeSuperArc(const idSuperArc &superArcId, const idNode &upNodeId, const bool overlapB, const bool overlapA)
void flush()
clear local data for new computation
void hideNode(const idNode &node)
int computePersistencePairs(std::vector< std::tuple< SimplexId, SimplexId, scalarType > > &pairs, const triangulationType &mesh)
bool isLower(const SimplexId &a, const SimplexId &b) const
void recoverMTPairs(const std::vector< idNode > &sortedNodes, std::vector< std::tuple< SimplexId, SimplexId, scalarType, bool > > &pairsJT, std::vector< std::tuple< SimplexId, SimplexId, scalarType, bool > > &pairsST, const triangulationType &mesh)
const std::vector< SuperArc > & getSuperArc() const
Node * getNode(const idNode &nodeId)
std::shared_ptr< Params > params_
SimplexId getVertexId() const
const SimplexId & getTermination() const
void removeDownSuperArc(const idSuperArc &idSa)
idSuperArc getDownSuperArcId(const idSuperArc &neighborId) const
idSuperArc getNumberOfUpSuperArcs() const
void setTermination(const SimplexId &linked)
void setOrigin(const SimplexId &linked)
void removeUpSuperArc(const idSuperArc &idSa)
idSuperArc getUpSuperArcId(const idSuperArc &neighborId) const
idSuperArc getNumberOfDownSuperArcs() const
const idNode & getUpNodeId() const
const idNode & getDownNodeId() const
T distance(const T *p0, const T *p1, const int &dimension=3)
long unsigned int idSuperArc
SuperArc index in vect_superArcs_.
long int ufDataType
type stored by UnionFind
unsigned int idNode
Node index in vect_nodes_.
int SimplexId
Identifier type for simplices of any dimension.
T end(std::pair< T, T > &p)
T begin(std::pair< T, T > &p)
std::vector< idSuperArc > arcsCrossingAbove
std::vector< idNode > leaves
std::vector< Node > nodes
std::vector< SuperArc > superArcs
std::vector< idSuperArc > arcsCrossingBelow
std::vector< idNode > roots
printMsg(debug::output::BOLD+" | | | | | . \\ | | (__| | / __/| |_| / __/|__ _|"+debug::output::ENDCOLOR, debug::Priority::PERFORMANCE, debug::LineMode::NEW, stream)