Go to the documentation of this file.
10 #ifndef vtk_m_worklet_DescriptiveStatistics_h
11 #define vtk_m_worklet_DescriptiveStatistics_h
31 ,
min_(std::numeric_limits<T>::max())
32 ,
max_(std::numeric_limits<T>::lowest())
81 T delta2 = delta * delta;
84 T delta3 = delta * delta2;
85 T n2 = result.
n_ * result.
n_;
87 result.
M3_ += delta3 * x.
n_ * y.
n_ * (x.
n_ - y.
n_) / n2;
88 result.
M3_ += T(3.0) * delta * (x.
n_ * y.
M2_ - y.
n_ * x.
M2_) / result.
n_;
90 T delta4 = delta2 * delta2;
91 T n3 = result.
n_ * n2;
95 result.
M4_ += T(4.0) * delta * (x.
n_ * y.
M3_ - y.
n_ * x.
M3_) / result.
n_;
101 T
N()
const {
return this->
n_; }
125 return this->
M2_ / (this->
n_ - 1);
152 return this->
n_ * this->
M4_ / (this->
M2_ * this->
M2_);
169 template <
typename T>
185 template <
typename FieldType,
typename Storage>
196 template <
typename KeyType,
typename ValueType,
typename KeyInStorage,
typename ValueInStorage>
212 Algorithm::SortByKey(keys_copy, values_copy);
218 Algorithm::ReduceByKey(keys_copy, states, keys_out, results,
vtkm::Add{});
226 #endif // vtk_m_worklet_DescriptiveStatistics_h
VTKM_EXEC_CONT vtkm::Float32 Sqrt(vtkm::Float32 x)
Compute the square root of x.
Definition: Math.h:958
Manages an array-worth of data.
Definition: ArrayHandle.h:283
T sum_
Definition: DescriptiveStatistics.h:160
Groups connected points that have the same field value.
Definition: Atomic.h:19
#define VTKM_ASSERT(condition)
Definition: Assert.h:43
#define VTKM_EXEC_CONT
Definition: ExportMacros.h:52
T M4_
Definition: DescriptiveStatistics.h:164
VTKM_EXEC_CONT T PopulationVariance() const
Definition: DescriptiveStatistics.h:129
VTKM_EXEC_CONT T Max() const
Definition: DescriptiveStatistics.h:107
static VTKM_CONT StatState< FieldType > Run(const vtkm::cont::ArrayHandle< FieldType, Storage > &field)
Calculate various summary statistics for the input ArrayHandle.
Definition: DescriptiveStatistics.h:186
T mean_
Definition: DescriptiveStatistics.h:161
static VTKM_CONT auto Run(const vtkm::cont::ArrayHandle< KeyType, KeyInStorage > &keys, const vtkm::cont::ArrayHandle< ValueType, ValueInStorage > &values) -> vtkm::cont::ArrayHandleZip< vtkm::cont::ArrayHandle< KeyType >, vtkm::cont::ArrayHandle< StatState< ValueType >>>
Definition: DescriptiveStatistics.h:197
VTKM_EXEC_CONT StatState()
Definition: DescriptiveStatistics.h:29
VTKM_EXEC_CONT T SampleVariance() const
Definition: DescriptiveStatistics.h:122
VTKM_EXEC_CONT T Skewness() const
Definition: DescriptiveStatistics.h:132
Definition: DescriptiveStatistics.h:167
ArrayHandleZip is a specialization of ArrayHandle.
Definition: ArrayHandleZip.h:251
VTKM_EXEC_CONT T Kurtosis() const
Definition: DescriptiveStatistics.h:144
VTKM_CONT vtkm::cont::ArrayHandleTransform< HandleType, FunctorType > make_ArrayHandleTransform(HandleType handle, FunctorType functor)
make_ArrayHandleTransform is convenience function to generate an ArrayHandleTransform.
Definition: ArrayHandleTransform.h:474
VTKM_EXEC_CONT StatState operator+(const StatState< T > &y) const
Definition: DescriptiveStatistics.h:55
VTKM_EXEC_CONT T Sum() const
Definition: DescriptiveStatistics.h:110
VTKM_CONT vtkm::cont::ArrayHandleZip< FirstHandleType, SecondHandleType > make_ArrayHandleZip(const FirstHandleType &first, const SecondHandleType &second)
A convenience function for creating an ArrayHandleZip.
Definition: ArrayHandleZip.h:288
void ArrayCopy(const SourceArrayType &source, DestArrayType &destination)
Does a deep copy from one array to another array.
Definition: ArrayCopy.h:142
Definition: DescriptiveStatistics.h:26
#define VTKM_CONT
Definition: ExportMacros.h:57
VTKM_EXEC_CONT vtkm::worklet::DescriptiveStatistics::StatState< T > operator()(T value) const
Definition: DescriptiveStatistics.h:170
T max_
Definition: DescriptiveStatistics.h:159
T M3_
Definition: DescriptiveStatistics.h:163
VTKM_EXEC_CONT T Mean() const
Definition: DescriptiveStatistics.h:113
VTKM_EXEC_CONT T SampleStddev() const
Definition: DescriptiveStatistics.h:116
Definition: Algorithm.h:385
T n_
Definition: DescriptiveStatistics.h:157
VTKM_EXEC_CONT T N() const
Definition: DescriptiveStatistics.h:101
Definition: DescriptiveStatistics.h:22
T min_
Definition: DescriptiveStatistics.h:158
T M2_
Definition: DescriptiveStatistics.h:162
VTKM_EXEC_CONT T Min() const
Definition: DescriptiveStatistics.h:104
VTKM_EXEC_CONT StatState(T value)
Definition: DescriptiveStatistics.h:42
VTKM_EXEC_CONT T PopulationStddev() const
Definition: DescriptiveStatistics.h:119