Skip to content

set_sub_matrixSetSubMatrixSetSubMatrixset_sub_matrixT_set_sub_matrix🔗

Short description🔗

set_sub_matrixSetSubMatrixSetSubMatrixset_sub_matrixT_set_sub_matrix — Set a sub-matrix of a matrix.

Signature🔗

set_sub_matrix( matrix MatrixID, matrix MatrixSubID, integer Row, integer Column )void SetSubMatrix( const HTuple& MatrixID, const HTuple& MatrixSubID, const HTuple& Row, const HTuple& Column )static void HOperatorSet.SetSubMatrix( HTuple matrixID, HTuple matrixSubID, HTuple row, HTuple column )def set_sub_matrix( matrix_id: HHandle, matrix_sub_id: HHandle, row: int, column: int ) -> None

Herror T_set_sub_matrix( const Htuple MatrixID, const Htuple MatrixSubID, const Htuple Row, const Htuple Column )

void HMatrix::SetSubMatrix( const HMatrix& MatrixSubID, Hlong Row, Hlong Column ) const

void HMatrix.SetSubMatrix( HMatrix matrixSubID, int row, int column )

Description🔗

The operator set_sub_matrixSetSubMatrix overwrites a part of the Matrix with the matrix MatrixSub. The input matrices are defined by the matrix handles MatrixIDmatrixIDmatrix_id and MatrixSubIDmatrixSubIDmatrix_sub_id. The parameters Rowrowrow and Columncolumncolumn determine the position of the upper left corner of the sub-matrix MatrixSub in Matrix.

Example:

Rowrowrow = 00, Columncolumncolumn = 11

\[\begin{eqnarray*} \texttt{Matrix} = \left[ \begin{array}{rrrr} 3.0 & 0.0 & 9.0 & 1.0 \\ -5.0 & 3.0 & 1.0 & 6.0 \\ -9.0 & 0.0 & 1.0 & -1.0 \end{array} \right] \qquad \texttt{MatrixSub} = \left[ \begin{array}{rr} 1.0 & -2.0 \\ 7.0 & 2.0 \\ -4.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*}\]

Attention🔗

The conditions 0 \(\le\) Rowrowrow \(<\) size of matrix Matrix in the row direction, Rowrowrow \(+\) size of matrix MatrixSub in the row direction \(\le\) size of matrix Matrix in the row direction, 0 \(\le\) Columncolumncolumn \(<\) size of Matrix in the column direction, and Columncolumncolumn \(+\) size of matrix MatrixSub in the columns direction \(\le\) size of Matrix in the column direction must be satisfied.

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.

MatrixSubIDmatrixSubIDmatrix_sub_id (input_control) matrix → (handle)HTuple (HHandle)HMatrix, HTuple (IntPtr)HHandleHtuple (handle)

Matrix handle of the input sub-matrix.

Rowrowrow (input_control) integer → (integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)

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

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 → (integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)

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

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

Result🔗

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

Combinations with other operators🔗

Combinations

Possible predecessors

create_matrixCreateMatrix

Possible successors

get_full_matrixGetFullMatrix, get_value_matrixGetValueMatrix

See also

get_sub_matrixGetSubMatrix

Module🔗

Foundation