Assigns a diagonal matrix to elements in a buffer considered a column-major matrix representation.
- Template Parameters
-
ValueType | A type of a matrix element. |
- Parameters
-
[in,out] | column_matrix | A pointer to a two-dimensional array filled with matrix elements to be replaced by the assignment. The array must be sufficient to hold columns * rows elements of the type ValueType . |
| columns | A number of columns in the matrix to set. |
| rows | A number of rows in the matrix to set. |
| diag | A value copy-assigned to elements of the main diagonal of the target matrix. |
- Exceptions
-
Any | exception thrown by the default constructor, copy- or move-assignment operator of ValueType . |
The function copy-assigns diag
to all elements of the main diagonal of the target matrix and assigns default-constructed ValueType
elements to the other elements.
In order to construct elements of a diagonal matrix, rather than assign them, use construct_diagonal_matrix.