Viskores  1.0
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
viskores::worklet::ScatterCounting Struct Reference

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

#include <ScatterCounting.h>

Inheritance diagram for viskores::worklet::ScatterCounting:

Public Types

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

Public Member Functions

 ScatterCounting (const viskores::cont::UnknownArrayHandle &countArray, viskores::cont::DeviceAdapterId device=viskores::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 viskores::cont::UnknownArrayHandle &countArray, bool saveInputToOutputMap)
 
template<typename RangeType >
OutputToInputMapType GetOutputToInputMap (RangeType) const
 
template<typename RangeType >
VisitArrayType GetVisitArray (RangeType) const
 
viskores::Id GetOutputRange (viskores::Id inputRange) const
 
viskores::Id GetOutputRange (viskores::Id3 inputRange) const
 
OutputToInputMapType GetOutputToInputMap () const
 
viskores::cont::ArrayHandle< viskores::IdGetInputToOutputMap () const
 This array will not be valid unless explicitly instructed to be saved. More...
 

Private Member Functions

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

Private Attributes

viskores::Id InputRange
 
viskores::cont::ArrayHandle< viskores::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]

viskores::worklet::ScatterCounting::ScatterCounting ( const viskores::cont::UnknownArrayHandle countArray,
viskores::cont::DeviceAdapterId  device = viskores::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]

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

Member Function Documentation

◆ BuildArrays()

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

◆ GetInputToOutputMap()

viskores::cont::ArrayHandle<viskores::Id> viskores::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]

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

◆ GetOutputRange() [2/2]

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

◆ GetOutputToInputMap() [1/2]

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

◆ GetOutputToInputMap() [2/2]

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

◆ GetVisitArray()

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

Member Data Documentation

◆ InputRange

viskores::Id viskores::worklet::ScatterCounting::InputRange
private

◆ InputToOutputMap

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

◆ OutputToInputMap

OutputToInputMapType viskores::worklet::ScatterCounting::OutputToInputMap
private

◆ VisitArray

VisitArrayType viskores::worklet::ScatterCounting::VisitArray
private

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