24FTMTree_CT::FTMTree_CT(
const std::shared_ptr<Params> ¶ms,
25 const std::shared_ptr<Scalars> &scalars)
34 queue<pair<bool, idNode>> growingNodes, remainingNodes;
36 const bool DEBUG =
false;
48 for(
idNode n = 0; n < nbSTLeaves; ++n) {
50 growingNodes.emplace(
false, nId);
60 for(
idNode n = 0; n < nbJTLeaves; ++n) {
62 growingNodes.emplace(
true, nId);
67 cout <<
"growingNodes : " << growingNodes.size()
77 if(growingNodes.empty()) {
78 cout <<
"[FTMTree_CT::combine ] Nothing to combine" << endl;
81#ifdef TTK_ENABLE_FTM_TREE_DUAL_QUEUE_COMBINE
83 while(!remainingNodes.empty()) {
88 tie(
isJT, currentNodeId) = remainingNodes.front();
98 growingNodes.emplace(
isJT, currentNodeId);
100 cout <<
"repush in growing:" <<
isJT
101 <<
"::" << xt->
printNode(currentNodeId) << endl;
107 while(!growingNodes.empty()) {
113 tie(
isJT, currentNodeId) = growingNodes.front();
122 const Node *currentNode = xt->
getNode(currentNodeId);
126 cout << endl <<
"JT ";
128 cout << endl <<
"ST ";
129 cout <<
"node : " << currentNode->
getVertexId() << endl;
136 cout <<
" ignore already processed" << endl;
141 idNode const correspondingNodeId
146 cout <<
"put remain:" <<
isJT <<
"::" << xt->
printNode(currentNodeId)
148 cout <<
" which is in yt : " << yt->
printNode(correspondingNodeId)
151#ifdef TTK_ENABLE_FTM_TREE_DUAL_QUEUE_COMBINE
152 remainingNodes.emplace(
isJT, currentNodeId);
154 growingNodes.emplace(
isJT, currentNodeId);
183 cout <<
" parent node :" << parentNode->
getVertexId() << endl;
219 cout <<
"create arc : " <<
printArc(createdArc) << endl;
227 cout <<
" delete xt (" << (xt == &
jt_) <<
") ";
228 cout <<
"node :" << xt->printNode(currentNodeId) << endl;
237 cout <<
" delete yt (" <<
isJT <<
") node :";
238 cout << yt->
printNode(correspondingNodeId) << endl;
241 yt->
delNode(correspondingNodeId);
248 growingNodes.emplace(
isJT, parentId);
251 cout <<
"will see : " << parentNode->
getVertexId() << endl;
255#ifdef TTK_ENABLE_FTM_TREE_DUAL_QUEUE_COMBINE
256 }
while(!remainingNodes.empty());
276 for(
const Region ® : xtRegions) {
277 segm_it cur = reg.segmentBegin;
279 segm_it tmpBeg = reg.segmentBegin;
281 for(; cur !=
end; ++cur) {
305#ifdef TTK_ENABLE_OPENMP
306#pragma omp parallel for schedule(dynamic)
312 printTime(finSegmTime,
"post-process segm", 4);
319 for(
const idNode &t : sortedSTNodes) {
328 for(
const idNode &t : sortedJTNodes) {
void setDebugMsgPrefix(const std::string &prefix)
void createCTArcSegmentation(idSuperArc ctArc, const bool isJT, idSuperArc xtArc)
void finalizeSegmentation()
bool isCorrespondingNode(const SimplexId val) const
std::shared_ptr< Params > params_
idNode getLeave(const idNode id) const
std::string printNode(idNode n)
SuperArc * getSuperArc(idSuperArc i)
idNode getNumberOfNodes() const
bool isCorrespondingNull(const SimplexId val) const
void delNode(idNode node)
std::string printArc(idSuperArc a)
void move(FTMTree_MT &mt)
idSuperArc insertNode(Node *node, const bool segm=true)
idNode getCorrespondingNodeId(const SimplexId val) const
idSuperArc getNumberOfSuperArcs() const
idNode getNumberOfLeaves() const
int printTime(Timer &t, const std::string &s, const int debugLevel=2) const
const std::vector< idNode > & getLeaves() const
idNode makeNode(SimplexId vertexId, SimplexId linked=nullVertex)
idSuperArc makeSuperArc(idNode downNodeId, idNode upNodeId)
Node * getNode(idNode nodeId)
std::shared_ptr< Scalars > scalars_
void updateCorrespondingArc(const SimplexId vert, const idSuperArc arc)
std::vector< idNode > sortedNodes(const bool parallel=false)
idSuperArc getUpSuperArcId(idSuperArc neighborId) const
idSuperArc getNumberOfDownSuperArcs() const
SimplexId getVertexId() const
idSuperArc getNumberOfUpSuperArcs() const
idNode getUpNodeId() const
void concat(const segm_it &begin, const segm_it &end)
const std::list< Region > & getRegions() const
void createSegmentation(const Scalars *s)
long unsigned int idSuperArc
SuperArc index in vect_superArcs_.
std::vector< SimplexId >::iterator segm_it
unsigned int idNode
Node index in vect_nodes_.
int SimplexId
Identifier type for simplices of any dimension.
T end(std::pair< T, T > &p)
std::shared_ptr< FTMAtomicVector< SuperArc > > superArcs
std::shared_ptr< FTMAtomicVector< Node > > nodes
std::vector< idNode > leaves