Go to the documentation of this file.
11 #ifndef vtk_m_worklet_FieldHistogram_h
12 #define vtk_m_worklet_FieldHistogram_h
32 #pragma GCC diagnostic push
33 #pragma GCC diagnostic ignored "-Wconversion"
39 const T fieldRange = fieldMaxValue - fieldMinValue;
40 return fieldRange /
static_cast<typename VecType::ComponentType
>(num);
43 #pragma GCC diagnostic pop
57 template <
typename FieldType>
96 template <
typename WholeArrayType>
98 const WholeArrayType& counts,
102 difference = counts.Get(index);
104 difference = counts.Get(index) - counts.Get(index - 1);
113 template <
typename FieldType,
typename Storage>
125 this->
Run(fieldArray, numberOfBins, result[0], result[1], binDelta, binArray);
135 template <
typename FieldType,
typename Storage>
138 FieldType fieldMinValue,
139 FieldType fieldMaxValue,
145 const FieldType fieldDelta =
compute_delta(fieldMinValue, fieldMaxValue, numberOfBins);
155 setHistogramBinDispatcher.Invoke(fieldArray, binIndex);
167 dispatcher.Invoke(binCounter, totalCount, binArray);
170 binDelta = fieldDelta;
176 #endif // vtk_m_worklet_FieldHistogram_h
FieldType minValue
Definition: FieldHistogram.h:66
VTKM_CONT vtkm::Id GetNumberOfValues() const
Returns the number of entries in the array.
Definition: ArrayHandle.h:448
void(FieldIn inputIndex, WholeArrayIn counts, FieldOut outputCount) ControlSignature
Definition: FieldHistogram.h:92
Manages an array-worth of data.
Definition: ArrayHandle.h:283
Definition: FieldHistogram.h:58
vtkm::Id numberOfBins
Definition: FieldHistogram.h:65
#define VTKM_EXEC
Definition: ExportMacros.h:51
Groups connected points that have the same field value.
Definition: Atomic.h:19
Binary Predicate that takes two arguments argument x, and y and returns a vtkm::Vec<T,...
Definition: BinaryOperators.h:112
VTKM_CONT void Allocate(vtkm::Id numberOfValues, vtkm::CopyFlag preserve, vtkm::cont::Token &token) const
Allocates an array large enough to hold the given number of values.
Definition: ArrayHandle.h:465
A control signature tag for output fields.
Definition: WorkletMapField.h:60
static VTKM_CONT void UpperBounds(vtkm::cont::DeviceAdapterId devId, const vtkm::cont::ArrayHandle< T, CIn > &input, const vtkm::cont::ArrayHandle< T, CVal > &values, vtkm::cont::ArrayHandle< vtkm::Id, COut > &output)
Definition: Algorithm.h:1091
static VTKM_CONT void Sort(vtkm::cont::DeviceAdapterId devId, vtkm::cont::ArrayHandle< T, Storage > &values)
Definition: Algorithm.h:965
VTKM_CONT T ArrayGetValue(vtkm::Id id, const vtkm::cont::ArrayHandle< T, S > &data)
Obtain a small set of values from an ArrayHandle with minimal device transfers.
Definition: ArrayGetValues.h:264
VTKM_CONT SetHistogramBin(vtkm::Id numberOfBins0, FieldType minValue0, FieldType delta0)
Definition: FieldHistogram.h:70
_1 InputDomain
Definition: FieldHistogram.h:94
vtkm::Int32 Id
Represents an ID (index into arrays).
Definition: Types.h:191
void(_1, _2, _3) ExecutionSignature
Definition: FieldHistogram.h:93
VTKM_EXEC void operator()(const FieldType &value, vtkm::Id &binIndex) const
Definition: FieldHistogram.h:78
FieldType delta
Definition: FieldHistogram.h:67
void(FieldIn value, FieldOut binIndex) ControlSignature
Definition: FieldHistogram.h:61
T compute_delta(T fieldMinValue, T fieldMaxValue, vtkm::Id num)
Definition: ComputeNDHistogram.h:36
Dispatcher for worklets that inherit from WorkletMapField.
Definition: DispatcherMapField.h:25
Definition: FieldHistogram.h:89
A control signature tag for input fields.
Definition: WorkletMapField.h:49
_1 InputDomain
Definition: FieldHistogram.h:63
#define VTKM_CONT
Definition: ExportMacros.h:57
void Run(vtkm::cont::ArrayHandle< FieldType, Storage > fieldArray, vtkm::Id numberOfBins, vtkm::Range &rangeOfValues, FieldType &binDelta, vtkm::cont::ArrayHandle< vtkm::Id > &binArray)
Definition: FieldHistogram.h:114
VTKM_EXEC void operator()(const vtkm::Id &index, const WholeArrayType &counts, vtkm::Id &difference) const
Definition: FieldHistogram.h:97
A short fixed-length array.
Definition: Types.h:767
static VTKM_CONT U Reduce(vtkm::cont::DeviceAdapterId devId, const vtkm::cont::ArrayHandle< T, CIn > &input, U initialValue)
Definition: Algorithm.h:656
void Run(vtkm::cont::ArrayHandle< FieldType, Storage > fieldArray, vtkm::Id numberOfBins, FieldType fieldMinValue, FieldType fieldMaxValue, FieldType &binDelta, vtkm::cont::ArrayHandle< vtkm::Id > &binArray)
Definition: FieldHistogram.h:136
void(_1, _2) ExecutionSignature
Definition: FieldHistogram.h:62
Definition: FieldHistogram.h:53
Base class for worklets that do a simple mapping of field arrays.
Definition: WorkletMapField.h:38
Represent a continuous scalar range of values.
Definition: Range.h:31