set_value_matrixT_set_value_matrixSetValueMatrixSetValueMatrixset_value_matrix (算子)

名称

set_value_matrixT_set_value_matrixSetValueMatrixSetValueMatrixset_value_matrix — 设置矩阵的一个或多个元素。

签名

set_value_matrix( : : MatrixID, Row, Column, Value : )

Herror T_set_value_matrix(const Htuple MatrixID, const Htuple Row, const Htuple Column, const Htuple Value)

void SetValueMatrix(const HTuple& MatrixID, const HTuple& Row, const HTuple& Column, const HTuple& Value)

void HMatrix::SetValueMatrix(const HTuple& Row, const HTuple& Column, const HTuple& Value) const

void HMatrix::SetValueMatrix(Hlong Row, Hlong Column, double Value) const

static void HOperatorSet.SetValueMatrix(HTuple matrixID, HTuple row, HTuple column, HTuple value)

void HMatrix.SetValueMatrix(HTuple row, HTuple column, HTuple value)

void HMatrix.SetValueMatrix(int row, int column, double value)

def set_value_matrix(matrix_id: HHandle, row: MaybeSequence[int], column: MaybeSequence[int], value: MaybeSequence[Union[int, float]]) -> None

描述

算子 set_value_matrixset_value_matrixSetValueMatrixSetValueMatrixSetValueMatrixset_value_matrix sets the values of the elements of the input Matrix at the positions (RowRowRowRowrowrow,ColumnColumnColumnColumncolumncolumn) to the values specified by ValueValueValueValuevaluevalue. The values can be a tuple of floating point or integer numbers. Integer numbers are converted to floating point numbers automatically. The number of values of ValueValueValueValuevaluevalue must match the number of elements of RowRowRowRowrowrow and ColumnColumnColumnColumncolumncolumn. In addition, the conditions 0   Row < size of Matrix in the row direction and 0   Column < size of Matrix in the column direction must be satisfied. The Matrix is defined by the matrix handle MatrixIDMatrixIDMatrixIDMatrixIDmatrixIDmatrix_id

示例:

RowRowRowRowrowrow = [0,2,1], ColumnColumnColumnColumncolumncolumn = [1,0,3], ValueValueValueValuevaluevalue = [1,-9,6]

执行信息

此算子修改后续输入参数的状态:

在执行此算子时,若该参数值需在多个线程间使用,则必须对其访问进行同步。

参数

MatrixIDMatrixIDMatrixIDMatrixIDmatrixIDmatrix_id (输入控制,状态被修改)  matrix HMatrix, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

输入矩阵的矩阵句柄。

RowRowRowRowrowrow (输入控制)  integer(-array) HTupleMaybeSequence[int]HTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Row numbers of the matrix elements to be modified.

默认值: 0

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

限制: Row >= 0

ColumnColumnColumnColumncolumncolumn (输入控制)  integer(-array) HTupleMaybeSequence[int]HTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Column numbers of the matrix elements to be modified.

默认值: 0

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

限制: Column >= 0

ValueValueValueValuevaluevalue (输入控制)  number(-array) HTupleMaybeSequence[Union[int, float]]HTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)

Values to be set in the indicated matrix elements.

默认值: 0

建议值: 0, 1, -1

结果

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

可能的前趋

create_matrixcreate_matrixCreateMatrixCreateMatrixCreateMatrixcreate_matrix

可能的后继

clear_matrixclear_matrixClearMatrixClearMatrixClearMatrixclear_matrix

另见

get_value_matrixget_value_matrixGetValueMatrixGetValueMatrixGetValueMatrixget_value_matrix

模块

基础