Go to the documentation of this file.
54 #ifndef _BRANCHCOMPILER_H_
55 #define _BRANCHCOMPILER_H_
66 namespace contourtree_distributed
69 typedef std::tuple<vtkm::Id, vtkm::Id>
Branch;
76 void Parse(std::istream& in);
77 void Print(std::ostream& out)
const;
78 void Load(
const std::string& filename);
101 in >> nextBranch >> nextValue >> nextSupernode;
108 if (nextBranch != currentBranch)
117 highValue = nextValue;
118 lowValue = nextValue;
119 highEnd = nextSupernode;
120 lowEnd = nextSupernode;
123 currentBranch = nextBranch;
128 if ((nextValue > highValue) || ((nextValue == highValue) && (nextSupernode > highEnd)))
130 highEnd = nextSupernode;
131 highValue = nextValue;
134 else if ((nextValue < lowValue) || ((nextValue == lowValue) && (nextSupernode < lowEnd)))
136 lowEnd = nextSupernode;
137 lowValue = nextValue;
143 std::sort(this->
branches.begin(), this->branches.end());
148 for (
auto it = std::begin(this->
branches); it != std::end(this->
branches); ++it)
152 out << std::setw(12) << std::get<0>(branch) << std::setw(14) << std::get<1>(branch)
161 std::ifstream in(filename);
168 in >> highEnd >> lowEnd;
176 std::sort(this->
branches.begin(), this->branches.end());
Groups connected points that have the same field value.
Definition: Atomic.h:19
std::tuple< vtkm::Id, vtkm::Id > Branch
Definition: BranchCompiler.h:69
Definition: BranchCompiler.h:71
vtkm::Int32 Id
Represents an ID (index into arrays).
Definition: Types.h:191
void Load(const std::string &filename)
Definition: BranchCompiler.h:157
VTKM_EXEC_CONT bool NoSuchElement(vtkm::Id flaggedIndex)
Definition: filter/scalar_topology/worklet/contourtree_augmented/Types.h:97
std::vector< Branch > branches
Definition: BranchCompiler.h:74
void Parse(std::istream &in)
Definition: BranchCompiler.h:81
VTKM_SUPPRESS_EXEC_WARNINGS VTKM_EXEC_CONT auto make_tuple(Ts &&... args) -> decltype(vtkm::MakeTuple(std::forward< Ts >(args)...))
Compatible with std::make_tuple for vtkm::Tuple.
Definition: Tuple.h:129
void Print(std::ostream &out) const
Definition: BranchCompiler.h:146
double Float64
Definition: Types.h:155
constexpr vtkm::Id NO_SUCH_ELEMENT
Definition: filter/scalar_topology/worklet/contourtree_augmented/Types.h:73