Skip to content

mult_element_matrixMultElementMatrixMultElementMatrixmult_element_matrixT_mult_element_matrix🔗

説明🔗

mult_element_matrixMultElementMatrixMultElementMatrixmult_element_matrixT_mult_element_matrix — 行列の要素ごとに積を計算する。

書式🔗

mult_element_matrix( matrix MatrixAID, matrix MatrixBID, out matrix MatrixMultID )void MultElementMatrix( const HTuple& MatrixAID, const HTuple& MatrixBID, HTuple* MatrixMultID )static void HOperatorSet.MultElementMatrix( HTuple matrixAID, HTuple matrixBID, out HTuple matrixMultID )def mult_element_matrix( matrix_aid: HHandle, matrix_bid: HHandle ) -> HHandle

Herror T_mult_element_matrix( const Htuple MatrixAID, const Htuple MatrixBID, Htuple* MatrixMultID )

HMatrix HMatrix::MultElementMatrix( const HMatrix& MatrixBID ) const

HMatrix HMatrix.MultElementMatrix( HMatrix matrixBID )

説明🔗

オペレーター mult_element_matrixMultElementMatrix は、2 つの行列 MatrixA と MatrixB を要素ごとに乗算します。行 列は、行列ハンドル MatrixAIDmatrixAIDmatrix_aid と MatrixBIDmatrixBIDmatrix_bid により 定義されます。2 つの入力行列は同じ次元でなければなりません。その結 果、新しい行列 MatrixMult が生成されます。オペレーターは 行列 MatrixMult の行列ハンドル MatrixMultIDmatrixMultIDmatrix_mult_id を 返します。行列の要素には、オペレーター get_full_matrixGetFullMatrix な どを使用してアクセスできます。結果の計算式は以下の通りです。

\[\begin{eqnarray*} \texttt{MatrixMult}_{ij} \quad = \quad \texttt{MatrixA}_{ij} \quad \cdot \quad \texttt{MatrixB}_{ij}. \end{eqnarray*}\]

例:

\[\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{MatrixMult} = \left[ \begin{array}{rrr} 8.0 & 64.0 & 0.0 \\ 24.0 & -7.0 & 8.0 \\ 18.0 & -16.0 & 2.0 \end{array} \right] \end{eqnarray*}\]

実行情報🔗

実行情報
  • マルチスレッドタイプ: リエントラント(非排他なオペレーターと並列に動作)

  • マルチスレッドスコープ: グローバル(他のスレッドから呼び出される可能性あり)

  • 並列演算処理には未対応

パラメーター🔗

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

入力行列 A の行列ハンドル

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

入力行列 B の行列ハンドル

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

入力行列の乗算値を持つ行列ハンドル

結果🔗

パラメーターが有効ならば、オペレーター mult_element_matrixMultElementMatrix は値 2 (H_MSG_TRUE) を返します。必要に応じて、例 外が発生します。

他のオペレーターとの組み合わせ🔗

組み合わせ

前処理の候補

create_matrixCreateMatrix

後処理の候補

get_full_matrixGetFullMatrix, get_value_matrixGetValueMatrix

他の選択候補

mult_element_matrix_modMultElementMatrixMod

関連項目

div_element_matrixDivElementMatrix, div_element_matrix_modDivElementMatrixMod, scale_matrixScaleMatrix, scale_matrix_modScaleMatrixMod

モジュール🔗

Foundation