Template Function librapid::ordered#

Function Documentation#

template<typename Scalar = int64_t, typename Backend = backend::CPU, typename T = size_t, size_t N = 32>
Array<Scalar, Backend> librapid::ordered(const Shape<T, N> &shape)#

Create an Array filled, in order, with the numbers 0 to N-1.

Create a new Array object with a given shape, where each value is filled with a number from 0 to N-1, where N is the total number of elements in the array. The values are filled in the same order as the array is stored in memory.

Template Parameters
  • Scalar – Scalar type of the Array

  • Backend – Backend type of the Array

  • T – Scalar type of the Shape

  • N – Maximum number of dimensions of the Shape

Parameters

shapeShape of the Array

Returns

Array filled with numbers from 0 to N-1