Skip to content

set_value_matrixSetValueMatrixSetValueMatrixset_value_matrixT_set_value_matrix🔗

Short description🔗

set_value_matrixSetValueMatrixSetValueMatrixset_value_matrixT_set_value_matrix — Set one or more elements of a matrix.

Signature🔗

set_value_matrix( matrix MatrixID, integer Row, integer Column, number Value )void SetValueMatrix( const HTuple& MatrixID, const HTuple& Row, const HTuple& Column, const HTuple& Value )static void HOperatorSet.SetValueMatrix( HTuple matrixID, HTuple row, HTuple column, HTuple value )def set_value_matrix( matrix_id: HHandle, row: MaybeSequence[int], column: MaybeSequence[int], value: MaybeSequence[Union[int, float]] ) -> None

Herror T_set_value_matrix( 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

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

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

Description🔗

The operator set_value_matrixSetValueMatrix sets the values of the elements of the input Matrix at the positions (Rowrowrow,Columncolumncolumn) to the values specified by Valuevaluevalue. 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 Valuevaluevalue must match the number of elements of Rowrowrow and Columncolumncolumn. In addition, the conditions 0 \(\le\) Rowrowrow \(<\) size of Matrix in the row direction and 0 \(\le\) Columncolumncolumn \(<\) size of Matrix in the column direction must be satisfied. The Matrix is defined by the matrix handle MatrixIDmatrixIDmatrix_id.

Example:

Rowrowrow = [0, 2, 1][0, 2, 1], Columncolumncolumn = [1, 0, 3][1, 0, 3], Valuevaluevalue = [1, -9, 6][1, -9, 6]

\[\begin{eqnarray*} \texttt{Matrix} = \left[ \begin{array}{rrrr} 3.0 & 0.0 & -2.0 & 1.0 \\ -5.0 & 7.0 & 2.0 & -2.0 \\ 8.0 & -4.0 & 1.0 & -1.0 \end{array} \right] \end{eqnarray*}\]
\[\begin{eqnarray*} \to \quad \texttt{Matrix} = \left[ \begin{array}{rrrr} 3.0 & 1.0 & -2.0 & 1.0 \\ -5.0 & 7.0 & 2.0 & 6.0 \\ -9.0 & -4.0 & 1.0 & -1.0 \end{array} \right] \end{eqnarray*}\]

Execution information🔗

Execution information
  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).

  • Multithreading scope: global (may be called from any thread).

  • Processed without parallelization.

This operator modifies the state of the following input parameter:

During execution of this operator, access to the value of this parameter must be synchronized if it is used across multiple threads.

Parameters🔗

MatrixIDmatrixIDmatrix_id (input_control, state is modified) matrix → (handle)HTuple (HHandle)HMatrix, HTuple (IntPtr)HHandleHtuple (handle)

Matrix handle of the input matrix.

Rowrowrow (input_control) integer(-array) → (integer)HTuple (Hlong)HTuple (int / long)MaybeSequence[int]Htuple (Hlong)

Row numbers of the matrix elements to be modified.

Default: 00
Suggested values: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 15, 20, 30, 50, 1000, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 15, 20, 30, 50, 100
Restriction: Row >= 0

Columncolumncolumn (input_control) integer(-array) → (integer)HTuple (Hlong)HTuple (int / long)MaybeSequence[int]Htuple (Hlong)

Column numbers of the matrix elements to be modified.

Default: 00
Suggested values: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 15, 20, 30, 50, 1000, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 15, 20, 30, 50, 100
Restriction: Column >= 0

Valuevaluevalue (input_control) number(-array) → (real / integer)HTuple (double / Hlong)HTuple (double / int / long)MaybeSequence[Union[int, float]]Htuple (double / Hlong)

Values to be set in the indicated matrix elements.

Default: 00
Suggested values: 0, 1, -10, 1, -1

Result🔗

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

Combinations with other operators🔗

Combinations

Possible predecessors

create_matrixCreateMatrix

Possible successors

clear_matrixClearMatrix

See also

get_value_matrixGetValueMatrix

Module🔗

Foundation