SwapCols
Swap columns in a matrix.
bool matrix::SwapCols( const ulong row1, // index of first column const ulong row2 // index of second column );
Parameters
col1
[in] Index of the first column.
col2
[in] Index of the second column.
Return Value
Returns true on success, false otherwise.
Example
matrix matrix_a={{1,2,3,4}, {5,6,7,8}, {9,10,11,12}, {13,14,15,16}}; matrix matrix_i=matrix::Identity(4,4); matrix matrix_a1=matrix_a; matrix_a1.SwapCols(0,3); Print("matrix_a1\n",matrix_a1); matrix matrix_p=matrix_i; matrix_p.SwapCols(0,3); matrix matrix_c1=matrix_a.MatMul(matrix_p); Print("matrix_c1\n",matrix_c1); /* matrix_a1 [[4,2,3,1] [8,6,7,5] [12,10,11,9] [16,14,15,13]] matrix_c1 [[4,2,3,1] [8,6,7,5] [12,10,11,9] [16,14,15,13]] */