get_sub_matrixT_get_sub_matrixGetSubMatrixGetSubMatrix (Operator)

Name

get_sub_matrixT_get_sub_matrixGetSubMatrixGetSubMatrix — Get a sub-matrix of a matrix.

Signature

get_sub_matrix( : : MatrixID, Row, Column, RowsSub, ColumnsSub : MatrixSubID)

Herror T_get_sub_matrix(const Htuple MatrixID, const Htuple Row, const Htuple Column, const Htuple RowsSub, const Htuple ColumnsSub, Htuple* MatrixSubID)

void GetSubMatrix(const HTuple& MatrixID, const HTuple& Row, const HTuple& Column, const HTuple& RowsSub, const HTuple& ColumnsSub, HTuple* MatrixSubID)

HMatrix HMatrix::GetSubMatrix(Hlong Row, Hlong Column, Hlong RowsSub, Hlong ColumnsSub) const

static void HOperatorSet.GetSubMatrix(HTuple matrixID, HTuple row, HTuple column, HTuple rowsSub, HTuple columnsSub, out HTuple matrixSubID)

HMatrix HMatrix.GetSubMatrix(int row, int column, int rowsSub, int columnsSub)

Description

The operator get_sub_matrixget_sub_matrixGetSubMatrixGetSubMatrixGetSubMatrix generates a new matrix MatrixSubMatrixSubMatrixSubMatrixSubmatrixSub and copies to this matrix a part of the input MatrixMatrixMatrixMatrixmatrix defined by the matrix handle MatrixMatrixMatrixMatrixmatrix. The part of the MatrixMatrixMatrixMatrixmatrix is determined by the upper left corner (RowRowRowRowrow,ColumnColumnColumnColumncolumn) and the sub-matrix dimensions (RowsSubRowsSubRowsSubRowsSubrowsSub, ColumnsSubColumnsSubColumnsSubColumnsSubcolumnsSub). The operator returns the matrix handle MatrixSubIDMatrixSubIDMatrixSubIDMatrixSubIDmatrixSubID of the matrix MatrixSubMatrixSubMatrixSubMatrixSubmatrixSub. Access to the elements of the matrix is possible e.g. with the operator get_full_matrixget_full_matrixGetFullMatrixGetFullMatrixGetFullMatrix.

Example:

Attention

The conditions 0 <= RowRowRowRowrow < size of MatrixMatrixMatrixMatrixmatrix in row direction, RowRowRowRowrow + RowsSubRowsSubRowsSubRowsSubrowsSub <= size of MatrixMatrixMatrixMatrixmatrix in the row direction, 0 <= ColumnColumnColumnColumncolumn < size of MatrixMatrixMatrixMatrixmatrix in the column direction, and ColumnColumnColumnColumncolumn + ColumnsSubColumnsSubColumnsSubColumnsSubcolumnsSub <= size of matrix MatrixMatrixMatrixMatrixmatrix in the column direction must be satisfied.

Execution Information

Parameters

MatrixIDMatrixIDMatrixIDMatrixIDmatrixID (input_control)  matrix HMatrix, HTupleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

Matrix handle of the input matrix.

RowRowRowRowrow (input_control)  integer HTupleHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Upper row position of the sub-matrix in the input matrix.

Default value: 0

Suggested values: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 15, 20, 30, 50, 100

Restriction: Row >= 0

ColumnColumnColumnColumncolumn (input_control)  integer HTupleHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Left column position of the sub-matrix in the input matrix.

Default value: 0

Suggested values: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 15, 20, 30, 50, 100

Restriction: Column >= 0

RowsSubRowsSubRowsSubRowsSubrowsSub (input_control)  integer HTupleHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Number of rows of the sub-matrix.

Default value: 1

Suggested values: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 15, 20, 30, 50, 100

Restriction: RowsSub >= 1

ColumnsSubColumnsSubColumnsSubColumnsSubcolumnsSub (input_control)  integer HTupleHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Number of columns of the sub-matrix.

Default value: 1

Suggested values: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 15, 20, 30, 50, 100

Restriction: ColumnsSub >= 1

MatrixSubIDMatrixSubIDMatrixSubIDMatrixSubIDmatrixSubID (output_control)  matrix HMatrix, HTupleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

Matrix handle of the sub-matrix.

Result

If the parameters are valid, the operator get_sub_matrixget_sub_matrixGetSubMatrixGetSubMatrixGetSubMatrix returns the value 2 (H_MSG_TRUE). If necessary, an exception is raised.

Possible Predecessors

create_matrixcreate_matrixCreateMatrixCreateMatrixCreateMatrix

Possible Successors

get_full_matrixget_full_matrixGetFullMatrixGetFullMatrixGetFullMatrix, get_value_matrixget_value_matrixGetValueMatrixGetValueMatrixGetValueMatrix

See also

set_sub_matrixset_sub_matrixSetSubMatrixSetSubMatrixSetSubMatrix

Module

Foundation