Rearranges columns of a matrix specified by a column-major two-dimensional array with respect to an array of integral indices of the columns and respectively copy-assigns the result to a destination buffer.
- Template Parameters
-
ValueType | A type of a matrix element. |
- Parameters
-
[in] | column_matrix | A pointer to a two dimensional array of elements which represent a column-major matrix to rearrange. |
| columns | A number of columns in the matrix to rearrange. |
| rows | A number of rows in the matrix to rearrange. |
[in,out] | output | A vector of column*rows elements to accept the rearranged matrix. Elements of the vector are sequentially copy-assigned from the rearranged elements of column_matrix . |
[in] | permutation_indices | A pointer to an array of integral indices of columns in column_matrix in the desired order. |
- Exceptions
-
Any | exceptions that originate from invoking copy-assignment of the elements. |
Elements of the resulting matrix after permutation of the columns are assigned to the respective elements of the destination buffer, i.e. by invoking copy-assignment for every element of the original matrix column_matrix
upon respective element of output
. In order to write the rearranged result to an uninitialized space, use rearrange_matrix_construct.
To permute columns in place, use rearrange_matrix_inplace.