|
| VTKM_ARRAY_HANDLE_SUBCLASS (ArrayHandleTransform,(ArrayHandleTransform< ArrayHandleType, FunctorType, InverseFunctorType >),(vtkm::cont::ArrayHandle< typename internal::StorageTagTransform< ArrayHandleType, FunctorType, InverseFunctorType >::ValueType, internal::StorageTagTransform< ArrayHandleType, FunctorType, InverseFunctorType >>)) |
|
| 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...
|
|
template<typename ArrayHandleType, typename FunctorType, typename InverseFunctorType>
class vtkm::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.
template<typename ArrayHandleType , typename FunctorType , typename InverseFunctorType >
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.