logspace#

Return a range of logarithmically-spaced numbers using first and last value. The step size is determined by the shape.

template<int Dim, typename ShapeType, typename T = float, std::enable_if_t<!std::is_array_v<typename remove_cvref<ShapeType>::type>, bool> = true>
inline auto matx::logspace(ShapeType &&s, T first, T last)#

Create a log10-spaced range of values.

Creates a set of values using a start and end that are log10- spaced apart over the set of values. Distance is determined by the shape and selected dimension.

Template Parameters:
  • T – Operator type

  • Dim – Dimension to operate over

  • ShapeType – Shape type

Parameters:
  • s – Shape object

  • first – First value

  • last – Last value

Returns:

Operator with log10-spaced values

template<int Dim, int RANK, typename T = float>
inline auto matx::logspace(const index_t (&s)[RANK], T first, T last)#

Create a log10-spaced range of values.

Creates a set of values using a start and end that are log10- spaced apart over the set of values. Distance is determined by the shape and selected dimension.

Template Parameters:
  • T – Operator type

  • Dim – Dimension to operate over

  • ShapeType – Shape type

Parameters:
  • s – Shape object

  • first – First value

  • last – Last value

Returns:

Operator with log10-spaced values

Examples#

index_t count = 20;
tensor_t<TestType, 1> t1{{count}};
TestType start = 1.0f;
TestType stop = 2.0f;
auto s = t1.Shape();

// Create a logarithmically-spaced sequence of numbers and assign to tensor "t1"
(t1 = logspace<0>(s, start, stop)).run(exec);