get_sub_matrixT_get_sub_matrixGetSubMatrixGetSubMatrixget_sub_matrix (算子)

名称

get_sub_matrixT_get_sub_matrixGetSubMatrixGetSubMatrixget_sub_matrix — 获取矩阵的子矩阵。

签名

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

描述

算子 get_sub_matrixget_sub_matrixGetSubMatrixGetSubMatrixGetSubMatrixget_sub_matrix generates a new matrix MatrixSub and copies to this matrix a part of the input Matrix defined by the matrix handle MatrixIDMatrixIDMatrixIDMatrixIDmatrixIDmatrix_id. The part of the Matrix is determined by the upper left corner (RowRowRowRowrowrow,ColumnColumnColumnColumncolumncolumn) and the sub-matrix dimensions (RowsSubRowsSubRowsSubRowsSubrowsSubrows_sub, ColumnsSubColumnsSubColumnsSubColumnsSubcolumnsSubcolumns_sub). The operator returns the matrix handle MatrixSubIDMatrixSubIDMatrixSubIDMatrixSubIDmatrixSubIDmatrix_sub_id of the matrix MatrixSub.可通过算子 get_full_matrixget_full_matrixGetFullMatrixGetFullMatrixGetFullMatrixget_full_matrix 等方式访问该矩阵的元素。

示例:

RowRowRowRowrowrow = 0, ColumnColumnColumnColumncolumncolumn = 1, RowsSubRowsSubRowsSubRowsSubrowsSubrows_sub = 3, ColumnsSubColumnsSubColumnsSubColumnsSubcolumnsSubcolumns_sub = 2

注意

The conditions 0 RowRowRowRowrowrow < size of Matrix in row direction, RowRowRowRowrowrow + RowsSubRowsSubRowsSubRowsSubrowsSubrows_sub size of Matrix in the row direction, 0 ColumnColumnColumnColumncolumncolumn < size of Matrix in the column direction, and ColumnColumnColumnColumncolumncolumn + ColumnsSubColumnsSubColumnsSubColumnsSubcolumnsSubcolumns_sub size of matrix Matrix in the column direction must be satisfied.

执行信息

参数

MatrixIDMatrixIDMatrixIDMatrixIDmatrixIDmatrix_id (输入控制)  matrix HMatrix, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

输入矩阵的矩阵句柄。

RowRowRowRowrowrow (输入控制)  integer HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

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

默认值: 0

建议值: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 15, 20, 30, 50, 100

限制: Row >= 0

ColumnColumnColumnColumncolumncolumn (输入控制)  integer HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

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

默认值: 0

建议值: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 15, 20, 30, 50, 100

限制: Column >= 0

RowsSubRowsSubRowsSubRowsSubrowsSubrows_sub (输入控制)  integer HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Number of rows of the sub-matrix.

默认值: 1

建议值: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 15, 20, 30, 50, 100

限制: RowsSub >= 1

ColumnsSubColumnsSubColumnsSubColumnsSubcolumnsSubcolumns_sub (输入控制)  integer HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Number of columns of the sub-matrix.

默认值: 1

建议值: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 15, 20, 30, 50, 100

限制: ColumnsSub >= 1

MatrixSubIDMatrixSubIDMatrixSubIDMatrixSubIDmatrixSubIDmatrix_sub_id (输出控制)  matrix HMatrix, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

Matrix handle of the sub-matrix.

结果

如果参数有效,算子 get_sub_matrixget_sub_matrixGetSubMatrixGetSubMatrixGetSubMatrixget_sub_matrix 返回值 2 ( H_MSG_TRUE )。如有必要,则抛出异常。

可能的前趋

create_matrixcreate_matrixCreateMatrixCreateMatrixCreateMatrixcreate_matrix

可能的后继

get_full_matrixget_full_matrixGetFullMatrixGetFullMatrixGetFullMatrixget_full_matrix, get_value_matrixget_value_matrixGetValueMatrixGetValueMatrixGetValueMatrixget_value_matrix

另见

set_sub_matrixset_sub_matrixSetSubMatrixSetSubMatrixSetSubMatrixset_sub_matrix

模块

基础