shift#

Shift an operator by a given amount either positive or negative along one dimension

template<int DIM, typename OpT, typename ShiftOpT>
auto __MATX_INLINE__ matx::shift(OpT op, ShiftOpT s)#

Operator to shift dimension by a given amount

Template Parameters:
  • DIM – The dimension to be shifted

  • OpT – Type of operator or view

  • ShiftOpT – Type of the operator for the shift

Parameters:
  • op – Operator or view to shift

  • s – Operator which returns the shift

Returns:

New operator with shifted indices

template<int DIM, int... DIMS, typename OpT, typename ShiftT, typename ...ShiftsT>
auto __MATX_INLINE__ matx::shift(OpT op, ShiftT s, ShiftsT... shifts)#

Operator to shift dimension by a given amount. This version allows multiple dimensions.

Template Parameters:
  • DIM – The dimension to be shifted

  • DIMS... – The dimensions targeted for shifts

  • OpT – Type of operator or view

  • ShiftsT – Type of the shift operators

Parameters:
  • op – Operator or view to shift

  • s – Amount to shift forward

  • shifts – list of shift amounts

Returns:

New operator with shifted indices

Examples#

// Shift the first dimension of "t2" by -5 so the 5th element of "t2" is the first element of "t2s"
(t2s = shift<0>(t2, -5)).run(exec);