Template Function otyca::row_to_col_major(const T *, T *, int, int)
Function Documentation
-
template<typename T>
void otyca::row_to_col_major(const T *rowMajor, T *colMajor, int rows, int cols) Converts a matrix from row-major order to column-major order.
This function takes a matrix stored in row-major order and converts it into column-major order. It performs the necessary transformations by swapping the indices of the matrix elements in memory.
- Template Parameters:
T – The type of the elements in the matrix (e.g., float, double).
- Parameters:
rowMajor – A pointer to the input matrix stored in row-major order.
colMajor – A pointer to the output matrix where the elements will be stored in column-major order.
rows – The number of rows in the matrix.
cols – The number of columns in the matrix.