Copying And Conversion |
Hereinafter the following convention is used:
– small Greek letters are used to denote scalars;
– small Latin letters are used to denote vectors;
– capital Latin letters are used to denote matrices.
This topic contains the following sections:
This section describes methods applied to receive a copy of a matrix and to get a sub-vector of the given matrix.
Operation | Description | Performance |
---|---|---|
copy | Creates a copy of the original matrix. | |
copy part of this matrix to another matrix | Suppose the given matrix is: We want to copy intersection of l rows from offset k and q columns from offset p of the source matrix to the other matrix. The copied submatrix will be pasted in the target matrix starting from the specified row and column offset. | |
get submatrix | Creates a matrix that contains the values from the requested submatrix. Suppose our matrix is: then user needs to set the number of rows and columns to copy from the specified offset to the destination matrix. GetSubMatrix(Int32, Int32, Int32, Int32) If number of rows and columns to copy is not specified then the number of copied rows and columns will be equal to destination matrix row and column dimensions respectively. | |
set submatrix | Sets submatrix of this matrix to the other specified matrix. Submatrix is pasted in this matrix from the specified row and column offset. | |
get diagonal elements | Copies diagonal elements of this matrix into a vector. | |
get row | Returns the vector that stores the elements of the particular row. Returning result:Out of place: | |
set row | Sets elements of a particular row. | |
get column | Returns the vector that stores the elements of particular column of this matrix. Returning result:Out of place: | |
set column | Sets elements of a particular column. |
This section describes various methods applied to convert a matrix into an array or a string.
Operation | Description | Performance |
---|---|---|
get values | Returns the 2D array with matrix' elements. Returning result:Out of place: | |
set values | Copies the elements of the matrix from 2D array. | |
convert to string | Formats the value of the current instance using the specified format. | |
convert to array | Converts this matrix to 2D array of its values. Converts this matrix to 1D array by columns. Converts this matrix to 1D array by rows. |