repmat#

Repeat an operator

template<typename T1>
auto __MATX_INLINE__ matx::repmat(const T1 &t, index_t reps)#

Repeat a matrix an equal number of times in each dimension

Template Parameters:

T1 – Type of operator or view

Parameters:
  • t – Operator or view to repeat

  • reps – Amount to repeat

Returns:

New operator with repeated data

template<typename T1, int N>
auto __MATX_INLINE__ matx::repmat(const T1 &t, const index_t (&reps)[N])#

Repeat a matrix a specific number of times in each direction

Template Parameters:

T1 – Type of operator or view

Parameters:
  • t – Operator or view to repeat

  • reps – Array of times to repeat in each dimension

Returns:

New operator with repeated data

template<typename T1>
auto __MATX_INLINE__ matx::repmat(const T1 &t, const index_t *reps)#

Repeat a matrix a specific number of times in each direction

Template Parameters:

T1 – Type of operator or view

Parameters:
  • t – Operator or view to repeat

  • reps – Array of times to repeat in each dimension

Returns:

New operator with repeated data

Examples#

const index_t count0 = 4;
const index_t count1 = 4;
const index_t same_reps = 10;
tensor_t<TestType, 2> t2({count0, count1});
tensor_t<TestType, 2> t2s({count0 * same_reps, count1 * same_reps});

for (index_t i = 0; i < count0; i++) {
  for (index_t j = 0; j < count1; j++) {
    t2(i, j) = static_cast<detail::value_promote_t<TestType>>(i);
  }
}

auto repop = repmat(t2, same_reps);