chsvlib
chsv helper source code

◆ transpose_inplace()

void Chusov::Math::transpose_inplace ( ValueType *  column_matrix,
std::size_t  columns,
std::size_t  rows 
)

Performs an in-place transposition of a matrix.

Template Parameters
ValueTypeA type of a matrix element.
Parameters
[in,out]column_matrixA pointer to a matrix, of columns by rows elements, to transpose.
columnsA number of columns in the matrix to transpose.
rowsA number of rows in the matrix to transpose.
Exceptions
std::bad_allocThe function failed to allocate necessary memory to complete the operation due to lack of system resources.
Anyexception generated from copy-assignment or swapping of ValueType elements.

To transpose a matrix writing the result to a different buffer and leaving the original matrix intact, use either transpose_construct, if the destination buffer is not initialized with any ValueType elements, or transpose_copy to replace existing contents of the destination buffer with the transposed copy of the original matrix.