Template Function librapid::linspace#

Function Documentation#

template<typename Scalar = double, typename Backend = backend::CPU, typename Start, typename Stop>
Array<Scalar, Backend> librapid::linspace(Start start, Stop stop, int64_t num, bool includeEnd = true)#

Create a 1-dimensional Array with a specified number of elements, evenly spaced between two values.

Create a 1-dimensional Array with a specified number of elements, evenly spaced between two values. If includeEnd is true, the last element of the Array will be equal to stop, otherwise it will be equal to stop - \(\frac{stop - start}{num}\).

Template Parameters
  • Scalar – Scalar type of the Array

  • Backend – Backend for the Array

  • Start – Scalar type of the start value

  • Stop – Scalar type of the stop value

Parameters
  • start – First value in the range

  • stop – Second value in the range

  • num – Number of elements in the Array

  • includeEnd – Whether or not to include the end value in the Array

Returns

Linearly spaced Array