TTK
Loading...
Searching...
No Matches
PersistenceDiagram.cpp
Go to the documentation of this file.
2
3using namespace std;
4using namespace ttk;
5
6using namespace ftm;
7
9 setDebugMsgPrefix("PersistenceDiagram");
10}
11
13 TreeType treeType,
14 const SimplexId vertexId) const {
15 const Node *node = tree->vertex2Node(vertexId);
16 int upDegree{};
17 int downDegree{};
18 if(treeType == TreeType::Join or treeType == TreeType::Contour) {
19 upDegree = node->getNumberOfUpSuperArcs();
20 downDegree = node->getNumberOfDownSuperArcs();
21 } else {
22 upDegree = node->getNumberOfDownSuperArcs();
23 downDegree = node->getNumberOfUpSuperArcs();
24 }
25 int degree = upDegree + downDegree;
26
27 // saddle point
28 if(degree > 1) {
29 if(upDegree > 1)
31 else
33 }
34 // local extremum
35 else {
36 if(upDegree)
38 else
40 }
41}
42
44 std::vector<PersistencePair> &diagram, const SimplexId *const offsets) const {
45
46 auto cmp = [offsets](const PersistencePair &a, const PersistencePair &b) {
47 return offsets[a.birth.id] < offsets[b.birth.id];
48 };
49
50 std::sort(diagram.begin(), diagram.end(), cmp);
51}
void setDebugMsgPrefix(const std::string &prefix)
Definition: Debug.h:364
int getNumberOfDownSuperArcs() const
Definition: ContourTree.h:182
int getNumberOfUpSuperArcs() const
Definition: ContourTree.h:190
void sortPersistenceDiagram(std::vector< PersistencePair > &diagram, const SimplexId *const offsets) const
ttk::CriticalType getNodeType(ftm::FTMTree_MT *tree, ftm::TreeType treeType, const SimplexId vertexId) const
Node * vertex2Node(const SimplexId vert)
Definition: FTMTree_MT.h:487
The Topology ToolKit.
CriticalType
default value for critical index
Definition: DataTypes.h:80
int SimplexId
Identifier type for simplices of any dimension.
Definition: DataTypes.h:22
ttk::CriticalVertex birth