Skip to content

copy_matrixCopyMatrixCopyMatrixcopy_matrixT_copy_matrix🔗

Short description🔗

copy_matrixCopyMatrixCopyMatrixcopy_matrixT_copy_matrix — Copy a matrix.

Signature🔗

copy_matrix( matrix MatrixID, out matrix MatrixCopyID )void CopyMatrix( const HTuple& MatrixID, HTuple* MatrixCopyID )static void HOperatorSet.CopyMatrix( HTuple matrixID, out HTuple matrixCopyID )def copy_matrix( matrix_id: HHandle ) -> HHandle

Herror T_copy_matrix( const Htuple MatrixID, Htuple* MatrixCopyID )

HMatrix HMatrix::CopyMatrix( ) const

HMatrix HMatrix.CopyMatrix( )

Description🔗

The operator copy_matrixCopyMatrix creates the new matrix MatrixCopy and copies all elements of the input Matrix to this new matrix. The input Matrix is defined by the matrix handle MatrixIDmatrixIDmatrix_id. The operator returns the matrix handle MatrixCopyIDmatrixCopyIDmatrix_copy_id of the matrix MatrixCopy. Access to the elements of the matrix is possible e.g., with the operator get_full_matrixGetFullMatrix. With this operator a matrix can be saved before the matrix is modified by the operators set_value_matrixSetValueMatrix, set_full_matrixSetFullMatrix, set_sub_matrixSetSubMatrix, or set_diagonal_matrixSetDiagonalMatrix.

Example:

\[\begin{eqnarray*} \texttt{Matrix} = \left[ \begin{array}{rrr} 3.0 & 1.0 & -2.0 \\ -5.0 & 7.0 & 2.0 \\ -9.0 & -4.0 & 1.0 \end{array} \right] \qquad \to \qquad \texttt{MatrixCopy} = \left[ \begin{array}{rrr} 3.0 & 1.0 & -2.0 \\ -5.0 & 7.0 & 2.0 \\ -9.0 & -4.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.

Parameters🔗

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

Matrix handle of the input matrix.

MatrixCopyIDmatrixCopyIDmatrix_copy_id (output_control) matrix → (handle)HTuple (HHandle)HMatrix, HTuple (IntPtr)HHandleHtuple (handle)

Matrix handle of the copied matrix.

Result🔗

If the parameters are valid, the operator copy_matrixCopyMatrix 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

Alternatives

repeat_matrixRepeatMatrix

Module🔗

Foundation