Rearranges columns of a matrix specified by a column-major two-dimensional array with respect to an array of integral indices of the columns constructing the rearrangement in 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. |
| [out] | output | A vector capable of holding at least column*rows elements to accept the rearranged matrix. Elements of the vector are sequentially copy-constructed 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-construction of the elements. |
The elements of the resulting matrix are copy-constructed in place of the respective elements in the buffer output, that is the buffer is considered to be uninitialized, and no destruction of existing data nor assignment takes place. In order to replace a matrix, that is not the original matrix, with a rearranged copy of column_matrix, invoking copy-assignment rather than copy-construction, use rearrange_matrix_copy.
To rearrange matrix in place, use rearrange_matrix_inplace.