VTK-m  2.0
Classes | Static Public Member Functions | List of all members
vtkm::worklet::AverageByKey Struct Reference

#include <AverageByKey.h>

Classes

struct  AverageWorklet
 
struct  ExtractMean
 

Static Public Member Functions

template<typename InArrayType , typename OutArrayType >
static VTKM_CONT void Run (const vtkm::worklet::internal::KeysBase &keys, const InArrayType &inValues, const OutArrayType &outAverages)
 Compute average values based on a set of Keys. More...
 
template<typename ValueType , typename InValuesStorage >
static VTKM_CONT vtkm::cont::ArrayHandle< ValueType > Run (const vtkm::worklet::internal::KeysBase &keys, const vtkm::cont::ArrayHandle< ValueType, InValuesStorage > &inValues)
 Compute average values based on a set of Keys. More...
 
template<class KeyType , class ValueType , class KeyInStorage , class KeyOutStorage , class ValueInStorage , class ValueOutStorage >
static VTKM_CONT void Run (const vtkm::cont::ArrayHandle< KeyType, KeyInStorage > &keyArray, const vtkm::cont::ArrayHandle< ValueType, ValueInStorage > &valueArray, vtkm::cont::ArrayHandle< KeyType, KeyOutStorage > &outputKeyArray, vtkm::cont::ArrayHandle< ValueType, ValueOutStorage > &outputValueArray)
 Compute average values based on an array of keys. More...
 

Member Function Documentation

◆ Run() [1/3]

template<class KeyType , class ValueType , class KeyInStorage , class KeyOutStorage , class ValueInStorage , class ValueOutStorage >
static VTKM_CONT void vtkm::worklet::AverageByKey::Run ( const vtkm::cont::ArrayHandle< KeyType, KeyInStorage > &  keyArray,
const vtkm::cont::ArrayHandle< ValueType, ValueInStorage > &  valueArray,
vtkm::cont::ArrayHandle< KeyType, KeyOutStorage > &  outputKeyArray,
vtkm::cont::ArrayHandle< ValueType, ValueOutStorage > &  outputValueArray 
)
inlinestatic

Compute average values based on an array of keys.

This method uses an array of keys and an equally sized array of values. The keys in that array are collected into groups of equal keys, and the values corresponding to those groups are averaged.

This method is less sensitive to constructing large groups with the keys than doing the similar reduction with a Keys object. For example, if you have only one key, the reduction will still be parallel. However, if you need to run the average of different values with the same keys, you will have many duplicated operations.

◆ Run() [2/3]

template<typename InArrayType , typename OutArrayType >
static VTKM_CONT void vtkm::worklet::AverageByKey::Run ( const vtkm::worklet::internal::KeysBase &  keys,
const InArrayType &  inValues,
const OutArrayType &  outAverages 
)
inlinestatic

Compute average values based on a set of Keys.

This method uses an existing Keys object to collected values by those keys and find the average of those groups.

◆ Run() [3/3]

template<typename ValueType , typename InValuesStorage >
static VTKM_CONT vtkm::cont::ArrayHandle<ValueType> vtkm::worklet::AverageByKey::Run ( const vtkm::worklet::internal::KeysBase &  keys,
const vtkm::cont::ArrayHandle< ValueType, InValuesStorage > &  inValues 
)
inlinestatic

Compute average values based on a set of Keys.

This method uses an existing Keys object to collected values by those keys and find the average of those groups.


The documentation for this struct was generated from the following file: