set_full_matrixT_set_full_matrixSetFullMatrixSetFullMatrixset_full_matrix(算子)

名称

set_full_matrixT_set_full_matrixSetFullMatrixSetFullMatrixset_full_matrix — 设置矩阵的所有值。

签名

set_full_matrix( : : MatrixID, Values : )

Herror T_set_full_matrix(const Htuple MatrixID, const Htuple Values)

void SetFullMatrix(const HTuple& MatrixID, const HTuple& Values)

void HMatrix::SetFullMatrix(const HTuple& Values) const

void HMatrix::SetFullMatrix(double Values) const

static void HOperatorSet.SetFullMatrix(HTuple matrixID, HTuple values)

void HMatrix.SetFullMatrix(HTuple values)

void HMatrix.SetFullMatrix(double values)

def set_full_matrix(matrix_id: HHandle, values: MaybeSequence[Union[int, float]]) -> None

描述

算子 set_full_matrixset_full_matrixSetFullMatrixSetFullMatrixSetFullMatrixset_full_matrix sets all elements of the input Matrix defined by the matrix handle MatrixIDMatrixIDMatrixIDMatrixIDmatrixIDmatrix_id. The values of the parameter ValuesValuesValuesValuesvaluesvalues can be a tuple of floating point or integer numbers. Integer numbers are converted to floating point numbers automatically. The parameter ValuesValuesValuesValuesvaluesvalues must contain all values in a row-major order, i.e., stored line by line. In addition, the number of elements in ValuesValuesValuesValuesvaluesvalues must be 1 or identical to the number of all elements of the matrix.

Note: The same result can be reached with the operator create_matrixcreate_matrixCreateMatrixCreateMatrixCreateMatrixcreate_matrix。The advantage by using the operator set_full_matrixset_full_matrixSetFullMatrixSetFullMatrixSetFullMatrixset_full_matrix is to recycle a matrix that is no longer needed. Thus, the runtime of the operation takes fewer time.

Example 1:

Example 2:

执行信息

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

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

参数

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

输入矩阵的矩阵句柄。

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

Values to be set.

结果

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

可能的前趋

create_matrixcreate_matrixCreateMatrixCreateMatrixCreateMatrixcreate_matrix

可能的后继

clear_matrixclear_matrixClearMatrixClearMatrixClearMatrixclear_matrix

另见

get_full_matrixget_full_matrixGetFullMatrixGetFullMatrixGetFullMatrixget_full_matrix

模块

基础