VTK-m  2.2
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
vtkm::worklet::ScatterCounting Struct Reference

A scatter that maps input to some numbers of output. More...

#include <ScatterCounting.h>

Inheritance diagram for vtkm::worklet::ScatterCounting:

Public Types

using CountTypes = vtkm::List< vtkm::Int64, vtkm::Int32, vtkm::Int16, vtkm::Int8, vtkm::UInt64, vtkm::UInt32, vtkm::UInt16, vtkm::UInt8 >
 
using OutputToInputMapType = vtkm::cont::ArrayHandle< vtkm::Id >
 
using VisitArrayType = vtkm::cont::ArrayHandle< vtkm::IdComponent >
 

Public Member Functions

 ScatterCounting (const vtkm::cont::UnknownArrayHandle &countArray, vtkm::cont::DeviceAdapterId device=vtkm::cont::DeviceAdapterTagAny(), bool saveInputToOutputMap=false)
 Construct a ScatterCounting object using an array of counts for the number of outputs for each input. More...
 
 ScatterCounting (const vtkm::cont::UnknownArrayHandle &countArray, bool saveInputToOutputMap)
 
template<typename RangeType >
OutputToInputMapType GetOutputToInputMap (RangeType) const
 
template<typename RangeType >
VisitArrayType GetVisitArray (RangeType) const
 
vtkm::Id GetOutputRange (vtkm::Id inputRange) const
 
vtkm::Id GetOutputRange (vtkm::Id3 inputRange) const
 
OutputToInputMapType GetOutputToInputMap () const
 
vtkm::cont::ArrayHandle< vtkm::IdGetInputToOutputMap () const
 This array will not be valid unless explicitly instructed to be saved. More...
 

Private Member Functions

void BuildArrays (const vtkm::cont::UnknownArrayHandle &countArray, vtkm::cont::DeviceAdapterId device, bool saveInputToOutputMap)
 

Private Attributes

vtkm::Id InputRange
 
vtkm::cont::ArrayHandle< vtkm::IdInputToOutputMap
 
OutputToInputMapType OutputToInputMap
 
VisitArrayType VisitArray
 

Detailed Description

A scatter that maps input to some numbers of output.

The Scatter classes are responsible for defining how much output is generated based on some sized input. ScatterCounting establishes a 1 to N mapping from input to output. That is, every input element generates 0 or more output elements associated with it. The output elements are grouped by the input associated.

A counting scatter takes an array of counts for each input. The data is taken in the constructor and the index arrays are derived from that. So changing the counts after the scatter is created will have no effect.

Member Typedef Documentation

◆ CountTypes

◆ OutputToInputMapType

◆ VisitArrayType

Constructor & Destructor Documentation

◆ ScatterCounting() [1/2]

vtkm::worklet::ScatterCounting::ScatterCounting ( const vtkm::cont::UnknownArrayHandle countArray,
vtkm::cont::DeviceAdapterId  device = vtkm::cont::DeviceAdapterTagAny(),
bool  saveInputToOutputMap = false 
)
inline

Construct a ScatterCounting object using an array of counts for the number of outputs for each input.

Part of the construction requires generating an input to output map, but this map is not needed for the operations of ScatterCounting, so by default it is deleted. However, other users might make use of it, so you can instruct the constructor to save the input to output map.

◆ ScatterCounting() [2/2]

vtkm::worklet::ScatterCounting::ScatterCounting ( const vtkm::cont::UnknownArrayHandle countArray,
bool  saveInputToOutputMap 
)
inline

Member Function Documentation

◆ BuildArrays()

void vtkm::worklet::ScatterCounting::BuildArrays ( const vtkm::cont::UnknownArrayHandle countArray,
vtkm::cont::DeviceAdapterId  device,
bool  saveInputToOutputMap 
)
private

◆ GetInputToOutputMap()

vtkm::cont::ArrayHandle<vtkm::Id> vtkm::worklet::ScatterCounting::GetInputToOutputMap ( ) const
inline

This array will not be valid unless explicitly instructed to be saved.

(See documentation for the constructor.)

◆ GetOutputRange() [1/2]

vtkm::Id vtkm::worklet::ScatterCounting::GetOutputRange ( vtkm::Id  inputRange) const
inline

◆ GetOutputRange() [2/2]

vtkm::Id vtkm::worklet::ScatterCounting::GetOutputRange ( vtkm::Id3  inputRange) const
inline

◆ GetOutputToInputMap() [1/2]

OutputToInputMapType vtkm::worklet::ScatterCounting::GetOutputToInputMap ( ) const
inline

◆ GetOutputToInputMap() [2/2]

template<typename RangeType >
OutputToInputMapType vtkm::worklet::ScatterCounting::GetOutputToInputMap ( RangeType  ) const
inline

◆ GetVisitArray()

template<typename RangeType >
VisitArrayType vtkm::worklet::ScatterCounting::GetVisitArray ( RangeType  ) const
inline

Member Data Documentation

◆ InputRange

vtkm::Id vtkm::worklet::ScatterCounting::InputRange
private

◆ InputToOutputMap

vtkm::cont::ArrayHandle<vtkm::Id> vtkm::worklet::ScatterCounting::InputToOutputMap
private

◆ OutputToInputMap

OutputToInputMapType vtkm::worklet::ScatterCounting::OutputToInputMap
private

◆ VisitArray

VisitArrayType vtkm::worklet::ScatterCounting::VisitArray
private

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