Operator Reference

get_sub_matrixT_get_sub_matrixGetSubMatrixGetSubMatrixget_sub_matrix (Operator)

get_sub_matrixT_get_sub_matrixGetSubMatrixGetSubMatrixget_sub_matrix — 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)

def get_sub_matrix(matrix_id: HHandle, row: int, column: int, rows_sub: int, columns_sub: int) -> HHandle

Description

The operator get_sub_matrixget_sub_matrixGetSubMatrixGetSubMatrixget_sub_matrix generates a new matrix MatrixSub and copies to this matrix a part of the input Matrix defined by the matrix handle MatrixIDMatrixIDMatrixIDmatrixIDmatrix_id. The part of the Matrix is determined by the upper left corner (RowRowRowrowrow,ColumnColumnColumncolumncolumn) and the sub-matrix dimensions (RowsSubRowsSubRowsSubrowsSubrows_sub, ColumnsSubColumnsSubColumnsSubcolumnsSubcolumns_sub). The operator returns the matrix handle MatrixSubIDMatrixSubIDMatrixSubIDmatrixSubIDmatrix_sub_id of the matrix MatrixSub. Access to the elements of the matrix is possible e.g., with the operator get_full_matrixget_full_matrixGetFullMatrixGetFullMatrixget_full_matrix.

Example:

RowRowRowrowrow = 0, ColumnColumnColumncolumncolumn = 1, RowsSubRowsSubRowsSubrowsSubrows_sub = 3, ColumnsSubColumnsSubColumnsSubcolumnsSubcolumns_sub = 2

Attention

The conditions 0 RowRowRowrowrow < size of Matrix in row direction, RowRowRowrowrow + RowsSubRowsSubRowsSubrowsSubrows_sub size of Matrix in the row direction, 0 ColumnColumnColumncolumncolumn < size of Matrix in the column direction, and ColumnColumnColumncolumncolumn + ColumnsSubColumnsSubColumnsSubcolumnsSubcolumns_sub size of matrix Matrix in the column direction must be satisfied.

Execution Information

  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).
  • Multithreading scope: global (may be called from any thread).
  • Processed without parallelization.

Parameters

MatrixIDMatrixIDMatrixIDmatrixIDmatrix_id (input_control)  matrix HMatrix, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

Matrix handle of the input matrix.

RowRowRowrowrow (input_control)  integer HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

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

Default: 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 HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

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

Default: 0

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

Restriction: Column >= 0

RowsSubRowsSubRowsSubrowsSubrows_sub (input_control)  integer HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Number of rows of the sub-matrix.

Default: 1

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

Restriction: RowsSub >= 1

ColumnsSubColumnsSubColumnsSubcolumnsSubcolumns_sub (input_control)  integer HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Number of columns of the sub-matrix.

Default: 1

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

Restriction: ColumnsSub >= 1

MatrixSubIDMatrixSubIDMatrixSubIDmatrixSubIDmatrix_sub_id (output_control)  matrix HMatrix, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

Matrix handle of the sub-matrix.

Result

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

Possible Predecessors

create_matrixcreate_matrixCreateMatrixCreateMatrixcreate_matrix

Possible Successors

get_full_matrixget_full_matrixGetFullMatrixGetFullMatrixget_full_matrix, get_value_matrixget_value_matrixGetValueMatrixGetValueMatrixget_value_matrix

See also

set_sub_matrixset_sub_matrixSetSubMatrixSetSubMatrixset_sub_matrix

Module

Foundation