Viskores  1.0
Public Types | Public Member Functions | List of all members
viskores::cont::ArrayHandleTransform< ArrayHandleType, FunctorType, InverseFunctorType > Class Template Reference

Implicitly transform values of one array to another with a functor. More...

#include <ArrayHandleTransform.h>

Inheritance diagram for viskores::cont::ArrayHandleTransform< ArrayHandleType, FunctorType, InverseFunctorType >:
viskores::cont::ArrayHandleSwizzle< ArrayHandleType, OutSize >

Public Types

using Thisclass = typename viskores::cont::detail::GetTypeInParentheses< void(ArrayHandleTransform< ArrayHandleType, FunctorType, InverseFunctorType >) >::type
 
using Superclass = typename viskores::cont::detail::GetTypeInParentheses< void(viskores::cont::ArrayHandle< typename internal::StorageTagTransform< ArrayHandleType, FunctorType, InverseFunctorType >::ValueType, internal::StorageTagTransform< ArrayHandleType, FunctorType, InverseFunctorType > >) >::type
 
using ValueType = typename Superclass::ValueType
 
using StorageTag = typename Superclass::StorageTag
 
using StorageType = typename Superclass::StorageType
 
using ReadPortalType = typename Superclass::ReadPortalType
 
using WritePortalType = typename Superclass::WritePortalType
 

Public Member Functions

 ArrayHandleTransform ()
 
VISKORES_CONT ArrayHandleTransform (const Thisclass &src)
 
VISKORES_CONT ArrayHandleTransform (Thisclass &&src) noexcept
 
VISKORES_CONT ArrayHandleTransform (const viskores::cont::ArrayHandle< typename Superclass::ValueType, typename Superclass::StorageTag > &src)
 
VISKORES_CONT ArrayHandleTransform (viskores::cont::ArrayHandle< typename Superclass::ValueType, typename Superclass::StorageTag > &&src) noexcept
 
VISKORES_CONT ArrayHandleTransform (const std::vector< viskores::cont::internal::Buffer > &buffers)
 
VISKORES_CONT ArrayHandleTransform (std::vector< viskores::cont::internal::Buffer > &&buffers) noexcept
 
VISKORES_CONT Thisclassoperator= (const Thisclass &src)
 
VISKORES_CONT Thisclassoperator= (Thisclass &&src) noexcept
 
 ArrayHandleTransform (const ArrayHandleType &handle, const FunctorType &functor=FunctorType(), const InverseFunctorType &inverseFunctor=InverseFunctorType())
 
 ~ArrayHandleTransform ()
 Implemented so that it is defined exclusively in the control environment. More...
 
ArrayHandleType GetTransformedArray () const
 Returns the ArrayHandle that is being transformed. More...
 
FunctorType GetFunctor () const
 Returns the functor transforming the ArrayHandle. More...
 
InverseFunctorType GetInverseFunctor () const
 Returns the inverse functor transforming the ArrayHandle More...
 

Detailed Description

template<typename ArrayHandleType, typename FunctorType, typename InverseFunctorType>
class viskores::cont::ArrayHandleTransform< ArrayHandleType, FunctorType, InverseFunctorType >

Implicitly transform values of one array to another with a functor.

ArrayHandleTransforms is a specialization of ArrayHandle. It takes a delegate array handle and makes a new handle that calls a given unary functor with the element at a given index and returns the result of the functor as the value of this array at that position. This transformation is done on demand. That is, rather than make a new copy of the array with new values, the transformation is done as values are read from the array. Thus, the functor operator should work in both the control and execution environments.

Member Typedef Documentation

◆ ReadPortalType

template<typename ArrayHandleType , typename FunctorType , typename InverseFunctorType >
using viskores::cont::ArrayHandleTransform< ArrayHandleType, FunctorType, InverseFunctorType >::ReadPortalType = typename Superclass::ReadPortalType

◆ StorageTag

template<typename ArrayHandleType , typename FunctorType , typename InverseFunctorType >
using viskores::cont::ArrayHandleTransform< ArrayHandleType, FunctorType, InverseFunctorType >::StorageTag = typename Superclass::StorageTag

◆ StorageType

template<typename ArrayHandleType , typename FunctorType , typename InverseFunctorType >
using viskores::cont::ArrayHandleTransform< ArrayHandleType, FunctorType, InverseFunctorType >::StorageType = typename Superclass::StorageType

◆ Superclass

template<typename ArrayHandleType , typename FunctorType , typename InverseFunctorType >
using viskores::cont::ArrayHandleTransform< ArrayHandleType, FunctorType, InverseFunctorType >::Superclass = typename viskores::cont::detail::GetTypeInParentheses<void (viskores::cont::ArrayHandle< typename internal::StorageTagTransform<ArrayHandleType, FunctorType, InverseFunctorType>:: ValueType, internal::StorageTagTransform<ArrayHandleType, FunctorType, InverseFunctorType> >) >::type

◆ Thisclass

template<typename ArrayHandleType , typename FunctorType , typename InverseFunctorType >
using viskores::cont::ArrayHandleTransform< ArrayHandleType, FunctorType, InverseFunctorType >::Thisclass = typename viskores::cont::detail::GetTypeInParentheses<void (ArrayHandleTransform<ArrayHandleType, FunctorType, InverseFunctorType>) >::type

◆ ValueType

template<typename ArrayHandleType , typename FunctorType , typename InverseFunctorType >
using viskores::cont::ArrayHandleTransform< ArrayHandleType, FunctorType, InverseFunctorType >::ValueType = typename Superclass::ValueType

◆ WritePortalType

template<typename ArrayHandleType , typename FunctorType , typename InverseFunctorType >
using viskores::cont::ArrayHandleTransform< ArrayHandleType, FunctorType, InverseFunctorType >::WritePortalType = typename Superclass::WritePortalType

Constructor & Destructor Documentation

◆ ArrayHandleTransform() [1/8]

template<typename ArrayHandleType , typename FunctorType , typename InverseFunctorType >
viskores::cont::ArrayHandleTransform< ArrayHandleType, FunctorType, InverseFunctorType >::ArrayHandleTransform ( )
inline

◆ ArrayHandleTransform() [2/8]

template<typename ArrayHandleType , typename FunctorType , typename InverseFunctorType >
VISKORES_CONT viskores::cont::ArrayHandleTransform< ArrayHandleType, FunctorType, InverseFunctorType >::ArrayHandleTransform ( const Thisclass src)
inline

◆ ArrayHandleTransform() [3/8]

template<typename ArrayHandleType , typename FunctorType , typename InverseFunctorType >
VISKORES_CONT viskores::cont::ArrayHandleTransform< ArrayHandleType, FunctorType, InverseFunctorType >::ArrayHandleTransform ( Thisclass &&  src)
inlinenoexcept

◆ ArrayHandleTransform() [4/8]

template<typename ArrayHandleType , typename FunctorType , typename InverseFunctorType >
VISKORES_CONT viskores::cont::ArrayHandleTransform< ArrayHandleType, FunctorType, InverseFunctorType >::ArrayHandleTransform ( const viskores::cont::ArrayHandle< typename Superclass::ValueType, typename Superclass::StorageTag > &  src)
inline

◆ ArrayHandleTransform() [5/8]

template<typename ArrayHandleType , typename FunctorType , typename InverseFunctorType >
VISKORES_CONT viskores::cont::ArrayHandleTransform< ArrayHandleType, FunctorType, InverseFunctorType >::ArrayHandleTransform ( viskores::cont::ArrayHandle< typename Superclass::ValueType, typename Superclass::StorageTag > &&  src)
inlinenoexcept

◆ ArrayHandleTransform() [6/8]

template<typename ArrayHandleType , typename FunctorType , typename InverseFunctorType >
VISKORES_CONT viskores::cont::ArrayHandleTransform< ArrayHandleType, FunctorType, InverseFunctorType >::ArrayHandleTransform ( const std::vector< viskores::cont::internal::Buffer > &  buffers)
inlineexplicit

◆ ArrayHandleTransform() [7/8]

template<typename ArrayHandleType , typename FunctorType , typename InverseFunctorType >
VISKORES_CONT viskores::cont::ArrayHandleTransform< ArrayHandleType, FunctorType, InverseFunctorType >::ArrayHandleTransform ( std::vector< viskores::cont::internal::Buffer > &&  buffers)
inlineexplicitnoexcept

◆ ArrayHandleTransform() [8/8]

template<typename ArrayHandleType , typename FunctorType , typename InverseFunctorType >
viskores::cont::ArrayHandleTransform< ArrayHandleType, FunctorType, InverseFunctorType >::ArrayHandleTransform ( const ArrayHandleType &  handle,
const FunctorType &  functor = FunctorType(),
const InverseFunctorType &  inverseFunctor = InverseFunctorType() 
)
inline

◆ ~ArrayHandleTransform()

template<typename ArrayHandleType , typename FunctorType , typename InverseFunctorType >
viskores::cont::ArrayHandleTransform< ArrayHandleType, FunctorType, InverseFunctorType >::~ArrayHandleTransform ( )
inline

Implemented so that it is defined exclusively in the control environment.

If there is a separate device for the execution environment (for example, with CUDA), then the automatically generated destructor could be created for all devices, and it would not be valid for all devices.

Member Function Documentation

◆ GetFunctor()

template<typename ArrayHandleType , typename FunctorType , typename InverseFunctorType >
FunctorType viskores::cont::ArrayHandleTransform< ArrayHandleType, FunctorType, InverseFunctorType >::GetFunctor ( ) const
inline

Returns the functor transforming the ArrayHandle.

◆ GetInverseFunctor()

template<typename ArrayHandleType , typename FunctorType , typename InverseFunctorType >
InverseFunctorType viskores::cont::ArrayHandleTransform< ArrayHandleType, FunctorType, InverseFunctorType >::GetInverseFunctor ( ) const
inline

Returns the inverse functor transforming the ArrayHandle

◆ GetTransformedArray()

template<typename ArrayHandleType , typename FunctorType , typename InverseFunctorType >
ArrayHandleType viskores::cont::ArrayHandleTransform< ArrayHandleType, FunctorType, InverseFunctorType >::GetTransformedArray ( ) const
inline

Returns the ArrayHandle that is being transformed.

◆ operator=() [1/2]

template<typename ArrayHandleType , typename FunctorType , typename InverseFunctorType >
VISKORES_CONT Thisclass& viskores::cont::ArrayHandleTransform< ArrayHandleType, FunctorType, InverseFunctorType >::operator= ( const Thisclass src)
inline

◆ operator=() [2/2]

template<typename ArrayHandleType , typename FunctorType , typename InverseFunctorType >
VISKORES_CONT Thisclass& viskores::cont::ArrayHandleTransform< ArrayHandleType, FunctorType, InverseFunctorType >::operator= ( Thisclass &&  src)
inlinenoexcept

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