Skip to content

add_matrixAddMatrixAddMatrixadd_matrixT_add_matrix🔗

説明🔗

add_matrixAddMatrixAddMatrixadd_matrixT_add_matrix — 2 つの行列の和を計算する。

書式🔗

add_matrix( matrix MatrixAID, matrix MatrixBID, out matrix MatrixSumID )void AddMatrix( const HTuple& MatrixAID, const HTuple& MatrixBID, HTuple* MatrixSumID )static void HOperatorSet.AddMatrix( HTuple matrixAID, HTuple matrixBID, out HTuple matrixSumID )def add_matrix( matrix_aid: HHandle, matrix_bid: HHandle ) -> HHandle

Herror T_add_matrix( const Htuple MatrixAID, const Htuple MatrixBID, Htuple* MatrixSumID )

HMatrix HMatrix::AddMatrix( const HMatrix& MatrixBID ) const

HMatrix HMatrix.AddMatrix( HMatrix matrixBID )

説明🔗

オペレーター add_matrixAddMatrix は行列ハンドル MatrixAIDmatrixAIDmatrix_aid と MatrixBIDmatrixBIDmatrix_bid により定義された入力行列 MatrixA と MatrixB の和を計算します。この 2 つの行列は、同じ次元 を持つ必要があります。その結果、新しい行列 MatrixSum が 生成されます。オペレーターは行列 MatrixSum の行列ハンド ル MatrixSumIDmatrixSumIDmatrix_sum_id を返します。行列の要素には、オペレーター get_full_matrixGetFullMatrix などを使用してアクセスできます。結果の計算 式は以下の通りです。

\[\begin{eqnarray*} \texttt{MatrixSum} \quad = \quad \texttt{MatrixA} \quad + \quad \texttt{MatrixB}. \end{eqnarray*}\]

例:

\[\begin{eqnarray*} \texttt{MatrixA} = \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 \texttt{MatrixB} = \left[ \begin{array}{rrr} 2.0 & 8.0 & -3.0 \\ -4.0 & -1.0 & 5.0 \\ 2.0 & -4.0 & 7.0 \end{array} \right] \end{eqnarray*}\]
\[\begin{eqnarray*} \to \qquad \texttt{MatrixSum} = \left[ \begin{array}{rrr} 5.0 & 9.0 & -5.0 \\ -9.0 & 6.0 & 7.0 \\ -7.0 & -8.0 & 8.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 の行列ハンドル

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

入力行列の合計をもつ行列ハンドル

結果🔗

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

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

組み合わせ

前処理の候補

create_matrixCreateMatrix

後処理の候補

get_full_matrixGetFullMatrix, get_value_matrixGetValueMatrix

他の選択候補

add_matrix_modAddMatrixMod

関連項目

sub_matrixSubMatrix, sub_matrix_modSubMatrixMod

モジュール🔗

Foundation