Function uw12::linalg::reshape

Function Documentation

inline Mat uw12::linalg::reshape(const Mat &mat, const size_t n_row, const size_t n_col, const bool copy_data = false)

Reshape an object into a matrix of size n_row * n_col

Parameters
  • mat – Input object (must have n_row * n_col elements)

  • n_row – Number of rows of output matrix

  • n_col – Number of columns of output matrix

  • copy_data – Whether to copy the matrix data or point to original data

Returns

Output matrix of size n_row * n_col