54 #ifndef _TREECOMPILER_H_
55 #define _TREECOMPILER_H_
68 namespace contourtree_distributed
93 if (LHS.
low < RHS.
low)
return true;
94 if (LHS.
low > RHS.
low)
return false;
95 if (LHS.
high < RHS.
high)
return true;
96 if (LHS.
high > RHS.
high)
return false;
100 else if (std::min(LHS.
low, LHS.
high) > std::min(RHS.
low, RHS.
high))
104 else if (std::max(LHS.
low, LHS.
high) > std::max(RHS.
low, RHS.
high))
171 std::ostream&
operator<<(std::ostream& outStream, SupernodeOnSuperarc& node);
174 std::istream&
operator>>(std::istream& inStream, SupernodeOnSuperarc& node);
230 dataValues_handle.SyncControlArray();
232 auto regularNodeGlobalIds_array = addedTree.
GetField(
"RegularNodeGlobalIds").
GetData();
233 std::vector<vtkm::Id> regularNodeGlobalIds(regularNodeGlobalIds_array.GetNumberOfValues());
234 auto regularNodeGlobalIds_handle =
237 regularNodeGlobalIds_handle
241 std::vector<vtkm::Id> added_tree_superarcs(superarcs_array.GetNumberOfValues());
244 superarcs_handle.SyncControlArray();
247 std::vector<vtkm::Id> added_tree_supernodes(supernodes_array.GetNumberOfValues());
250 supernodes_handle.SyncControlArray();
252 auto superparents_array = addedTree.
GetField(
"Superparents").
GetData();
253 std::vector<vtkm::Id> superparents(superparents_array.GetNumberOfValues());
256 superparents_handle.SyncControlArray();
259 for (
indexType supernode = 0; supernode < static_cast<indexType>(added_tree_supernodes.size());
263 indexType regularId = added_tree_supernodes[supernode];
264 indexType globalId = regularNodeGlobalIds[regularId];
265 dataType dataVal = dataValues[regularId];
268 indexType superTo = added_tree_superarcs[supernode];
275 indexType superparent = superparents[regularId];
279 if (superparent == supernode)
284 indexType regularFrom = added_tree_supernodes[superparent];
285 indexType globalFrom = regularNodeGlobalIds[regularFrom];
286 indexType superParentTo = added_tree_superarcs[superparent];
289 indexType globalTo = regularNodeGlobalIds[regularTo];
307 indexType regularTo = added_tree_supernodes[maskedTo];
308 indexType globalTo = regularNodeGlobalIds[regularTo];
309 dataType dataTo = dataValues[regularTo];
365 for (
indexType superarc = 0; superarc < static_cast<indexType>(superarc_array.size()); superarc++)
367 if (superarc_array[superarc].low < superarc_array[superarc].high)
369 std::cout << std::setw(
PRINT_WIDTH) << superarc_array[superarc].low <<
" ";
370 std::cout << std::setw(
PRINT_WIDTH) << superarc_array[superarc].high << std::endl;
374 std::cout << std::setw(
PRINT_WIDTH) << superarc_array[superarc].high <<
" ";
375 std::cout << std::setw(
PRINT_WIDTH) << superarc_array[superarc].low << std::endl;
386 std::cout <<
"============" << std::endl;
387 std::cout <<
"Contour Tree" << std::endl;
405 fseek(inFile, 0, SEEK_END);
408 std::size_t nBytes = ftell(inFile);
422 std::size_t nSupernodesRead =
425 if (nSupernodesRead != nSupernodes)
428 "Error: Expected to read " << nSupernodes <<
" supernodes but could read only "
429 << nSupernodesRead <<
". Output will be incorrect!"
446 while (!inStream.eof())
449 inStream >> tempNode;