11 #ifndef vtk_m_worklet_NDimsHistMarginalization_h
12 #define vtk_m_worklet_NDimsHistMarginalization_h
53 template <
typename BinaryCompare>
58 BinaryCompare conditionFunc,
73 const auto marginalPortal = marginalVariables.
ReadPortal();
74 const auto numBinsPortal = numberOfBins.
ReadPortal();
75 for (
vtkm::Id i = 0; i < numOfVariable; i++)
77 if (marginalPortal.Get(i) ==
true)
80 numMarginalVariables++;
81 const vtkm::Id nFieldBins = numBinsPortal.Get(i);
85 size_t vecIndex =
static_cast<size_t>(i);
86 to1DIndexDispatcher.Invoke(binId[vecIndex], bin1DIndex, bin1DIndex);
95 conditionalFreqWorklet.
setVar(i);
97 cfDispatcher(conditionalFreqWorklet);
98 size_t vecIndex =
static_cast<size_t>(i);
99 cfDispatcher.Invoke(binId[vecIndex], freqs, freqs);
110 bin1DIndex, freqs, bin1DIndex, nonSparseMarginalFreqs,
vtkm::Add());
118 marginalBinId.resize(
static_cast<size_t>(numMarginalVariables));
119 vtkm::Id marginalVarIdx = numMarginalVariables - 1;
120 for (
vtkm::Id i = numOfVariable - 1; i >= 0; i--)
122 if (marginalPortal.Get(i) ==
true)
124 const vtkm::Id nFieldBins = numBinsPortal.Get(i);
127 convertHistBinToNDDispatcher(binWorklet);
128 size_t vecIndex =
static_cast<size_t>(marginalVarIdx);
129 convertHistBinToNDDispatcher.Invoke(
130 sparseMarginal1DBinId, sparseMarginal1DBinId, marginalBinId[vecIndex]);
156 const auto marginalPortal = marginalVariables.
ReadPortal();
157 const auto numBinsPortal = numberOfBins.
ReadPortal();
158 for (
vtkm::Id i = 0; i < numOfVariable; i++)
160 if (marginalPortal.Get(i) ==
true)
163 numMarginalVariables++;
164 const vtkm::Id nFieldBins = numBinsPortal.Get(i);
168 size_t vecIndex =
static_cast<size_t>(i);
169 to1DIndexDispatcher.Invoke(binId[vecIndex], bin1DIndex, bin1DIndex);
180 marginalBinId.resize(
static_cast<size_t>(numMarginalVariables));
181 vtkm::Id marginalVarIdx = numMarginalVariables - 1;
182 for (
vtkm::Id i = numOfVariable - 1; i >= 0; i--)
184 if (marginalPortal.Get(i) ==
true)
186 const vtkm::Id nFieldBins = numBinsPortal.Get(i);
189 convertHistBinToNDDispatcher(binWorklet);
190 size_t vecIndex =
static_cast<size_t>(marginalVarIdx);
191 convertHistBinToNDDispatcher.Invoke(bin1DIndex, bin1DIndex, marginalBinId[vecIndex]);
200 #endif // vtk_m_worklet_NDimsHistMarginalization_h