#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 Arrayarray,
        
const IndexTransform<InputRank, OutputRank, CKind>transform,
        
TransformArrayConstraints constraints =
           
 skip_repeated_elements
);

Returns a strided array that represents the result of applying transform to array.

Template Parameters:
ArrayOriginKind OriginKind = offset_origin

If equal to offset_origin (the default), the returned array will have an offset_origin and retain the resolved input origin. If equal to zero_origin, the returned array will have a zero_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 MustAllocateConstraint and an optional IterationConstraints value. If an MustAllocateConstraint of may_allocate is specified (which is the default), a view of the existing array will be returned if possible, and in this case if Array::Pointer is a std::shared_ptr, the returned array will share ownership of the data. If the transformed array cannot be represented as a view of the existing array or if a MustAllocateConstraint of must_allocate is specified, a newly allocated array is returned, with a layout constrained by the IterationConstraints, which defaults to skip_repeated_elements.