#include "tensorstore/array.h"
template <typename Element, Index N0>
SharedArray<Element, 1, offset_origin>
tensorstore::MakeOffsetArray(span<const Index, 1> origin,
                             
Element (&array)[N0]);
template <typename Element, Index N0>
SharedArray<Element, 1, offset_origin>
tensorstore::MakeOffsetArray(span<const Index, 1> origin,
                             
const Element (&array)[N0]);
template <typename Element, Index N0, Index N1>
SharedArray<Element, 2, offset_origin>
tensorstore::MakeOffsetArray(span<const Index, 2> origin,
                             
Element (&array)[N0][N1]);
template <typename Element, Index N0, Index N1>
SharedArray<Element, 2, offset_origin>
tensorstore::MakeOffsetArray(span<const Index, 2> origin,
                             
const Element (&array)[N0][N1]);

Returns a SharedArray containing a copy of the specified C array.

Note

Only the rank-1 and rank-2 overloads are shown, but C arrays with up to 6 dimensions are supported.

Parameters:
span<const Index, 1> origin
span<const Index, 2> origin

The origin vector of the array. May be specified as a braced list, e.g. MakeOffsetArray({1, 2}, {{3, 4, 5}, {6, 7, 8}}).

Element (&array)[N0]
const Element (&array)[N0]
Element (&array)[N0][N1]
const Element (&array)[N0][N1]

The C array to be copied. May be specified as a (nested) braced list, e.g. MakeArray({{1, 2, 3}, {4, 5, 6}}).