Template Function otyca::col_to_row_major(const T *, T *, int, int)

Function Documentation

template<typename T>
void otyca::col_to_row_major(const T *colMajor, T *rowMajor, int rows, int cols)

Converts a matrix from column-major order to row-major order.

This function takes a matrix stored in column-major order and converts it into row-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:
  • colMajor – A pointer to the input matrix stored in column-major order.

  • rowMajor – A pointer to the output matrix where the elements will be stored in row-major order.

  • rows – The number of rows in the matrix.

  • cols – The number of columns in the matrix.