div_element_matrixdiv_element_matrixDivElementMatrixDivElementMatrixdiv_element_matrixT_div_element_matrix
Short description
div_element_matrixdiv_element_matrixDivElementMatrixDivElementMatrixdiv_element_matrixT_div_element_matrix — Divide matrices element-by-element.
Signature
div_element_matrix( matrix MatrixAID, matrix MatrixBID, out matrix MatrixDivID )div_element_matrix( : : MatrixAID, MatrixBID : MatrixDivID )void DivElementMatrix( const HTuple& MatrixAID, const HTuple& MatrixBID, HTuple* MatrixDivID )static void HOperatorSet.DivElementMatrix( HTuple matrixAID, HTuple matrixBID, out HTuple matrixDivID )def div_element_matrix( matrix_aid: HHandle, matrix_bid: HHandle ) -> HHandle
Herror T_div_element_matrix( const Htuple MatrixAID, const Htuple MatrixBID, Htuple* MatrixDivID )
HMatrix HMatrix::DivElementMatrix( const HMatrix& MatrixBID ) const
HMatrix HMatrix.DivElementMatrix( HMatrix matrixBID )
Description
The operator div_element_matrixDivElementMatrix divides the two matrices
MatrixA and MatrixB element-by-element. The
matrices are given by the matrix handles MatrixAIDmatrixAIDmatrix_aid and
MatrixBIDmatrixBIDmatrix_bid. It is required that both input matrices have
identical dimensions. The new created output MatrixDiv
contains the result. The operator returns the matrix handle
MatrixDivIDmatrixDivIDmatrix_div_id of the matrix MatrixDiv. Access
to the elements of the matrix is possible e.g., with the operator
get_full_matrixGetFullMatrix. The formula for the calculation of the
result is:
\[\begin{eqnarray*}
\texttt{MatrixDiv}_{ij} \quad = \quad \texttt{MatrixA}_{ij}
\quad / \quad \texttt{MatrixB}_{ij}.
\end{eqnarray*}\]
Example:
\[\begin{eqnarray*}
\texttt{MatrixA} =
\left[ \begin{array}{rrr}
4.0 & 8.0 & 0.0 \\
-6.0 & 7.0 & 2.0 \\
-9.0 & 4.0 & 1.0
\end{array} \right]
\qquad
\texttt{MatrixB} =
\left[ \begin{array}{rrr}
2.0 & 8.0 & -3.0 \\
-4.0 & -1.0 & 4.0 \\
-2.0 & -4.0 & 2.0
\end{array} \right]
\end{eqnarray*}\]
\[\begin{eqnarray*}
\to \qquad
\texttt{MatrixDiv} =
\left[ \begin{array}{rrr}
2.0 & 1.0 & 0.0 \\
1.5 & -7.0 & 0.5 \\
4.5 & -1.0 & 0.5
\end{array} \right]
\end{eqnarray*}\]
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
MatrixAIDmatrixAIDmatrix_aid (input_control) matrix → (handle)(handle)HTuple (HHandle)HMatrix, HTuple (IntPtr)HHandleHtuple (handle)
Matrix handle of the input matrix A.
MatrixBIDmatrixBIDmatrix_bid (input_control) matrix → (handle)(handle)HTuple (HHandle)HMatrix, HTuple (IntPtr)HHandleHtuple (handle)
Matrix handle of the input matrix B.
MatrixDivIDmatrixDivIDmatrix_div_id (output_control) matrix → (handle)(handle)HTuple (HHandle)HMatrix, HTuple (IntPtr)HHandleHtuple (handle)
Matrix handle with the divided values of input
matrices.
Result
If the parameters are valid, the operator div_element_matrixDivElementMatrix
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
div_element_matrix_modDivElementMatrixMod
See also
mult_element_matrixMultElementMatrix, mult_element_matrix_modMultElementMatrixMod, scale_matrixScaleMatrix, scale_matrix_modScaleMatrixMod
Module
Foundation