Click or drag to resize

Copying And Conversion

Hereinafter the following convention is used:

  • VSmall Greek – small Greek letters are used to denote scalars;

  • VSmall Latin – small Latin letters are used to denote vectors;

  • VCapital Latin – capital Latin letters are used to denote matrices.

This topic contains the following sections:

Copying

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.

methodClone

methodCopyTo(Matrix)

copy part of this matrix to another matrix

Suppose the given matrix is:

MCopy Offset

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.

methodCopyTo(Matrix, Int32, Int32, Int32, Int32, Int32, Int32)

get submatrix

Creates a matrix that contains the values from the requested submatrix. Suppose our matrix is:

MCopy Offset

then user needs to set the number of rows and columns to copy from the specified offset to the destination matrix.

methodGetSubMatrix(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.

methodGetSubMatrix(Int32, Int32, Matrix)

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.

methodSetSubMatrix(Matrix, Int32, Int32)

get diagonal elements

Copies diagonal elements of this matrix into a vector.

methodGetDiagonalValues(Vector)

get row

Returns the vector that stores the elements of the particular row.

Returning result:

methodGetRow(Int32)

Out of place:

methodGetRow(Int32, Vector)

set row

Sets elements of a particular row.

methodSetRow(Int32, Vector)

get column

Returns the vector that stores the elements of particular column of this matrix.

Returning result:

methodGetColumn(Int32)

Out of place:

methodGetColumn(Int32, Vector)

set column

Sets elements of a particular column.

methodSetColumn(Int32, Vector)

Conversion
See Also