-
#include "tensorstore/index_space/index_transform.h" -
template <ArrayOriginKind OriginKind = offset_origin,
DimensionIndex InputRank,
DimensionIndex OutputRank,
ContainerKind CKind,
typename Array>
requires IsArray<Array> && (OutputRank == Array::static_rank)
Result<
SharedArray<const typename Array::Element, InputRank, OriginKind>>
tensorstore::TransformArray(
const Array& array,
const IndexTransform<InputRank, OutputRank, CKind>& transform,
TransformArrayConstraints constraints = skip_repeated_elements); Returns a strided array that represents the result of applying
transformtoarray.- Template Parameters:¶
- ArrayOriginKind OriginKind = offset_origin¶
If equal to
offset_origin(the default), the returned array will have anoffset_originand retain the resolved input origin. If equal tozero_origin, the returned array will have azero_origin.
- Parameters:¶
- const Array &array¶
The existing array to transform with
transform.- const IndexTransform<InputRank, OutputRank, CKind> &transform¶
The index transform to apply to
array.- TransformArrayConstraints constraints = skip_repeated_elements¶
Specifies constraints on the returned array, as the sum of an optional
MustAllocateConstraintand an optionalIterationConstraintsvalue. If anMustAllocateConstraintofmay_allocateis specified (which is the default), a view of the existingarraywill be returned if possible, and in this case ifArray::Pointeris astd::shared_ptr, the returned array will share ownership of the data. If the transformed array cannot be represented as a view of the existingarrayor if aMustAllocateConstraintofmust_allocateis specified, a newly allocated array is returned, with a layout constrained by theIterationConstraints, which defaults toskip_repeated_elements.