Skip to content

mean_matrixMeanMatrixMeanMatrixmean_matrixT_mean_matrix🔗

説明🔗

mean_matrixMeanMatrixMeanMatrixmean_matrixT_mean_matrix — 行列の要素単位での平均値を計算する。

書式🔗

mean_matrix( matrix MatrixID, string MeanType, out matrix MatrixMeanID )void MeanMatrix( const HTuple& MatrixID, const HTuple& MeanType, HTuple* MatrixMeanID )static void HOperatorSet.MeanMatrix( HTuple matrixID, HTuple meanType, out HTuple matrixMeanID )def mean_matrix( matrix_id: HHandle, mean_type: str ) -> HHandle

Herror T_mean_matrix( const Htuple MatrixID, const Htuple MeanType, Htuple* MatrixMeanID )

HMatrix HMatrix::MeanMatrix( const HString& MeanType ) const

HMatrix HMatrix::MeanMatrix( const char* MeanType ) const

HMatrix HMatrix::MeanMatrix( const wchar_t* MeanType ) const (Windows only)

HMatrix HMatrix.MeanMatrix( string meanType )

説明🔗

オペレーター mean_matrixMeanMatrix は行列ハンドル MatrixIDmatrixIDmatrix_id で定義された行列 Matrix の要素の平均値を返します。新しい 行列 MatrixMean が結果とともに生成され、この行列の行列ハ ンドル MatrixMeanIDmatrixMeanIDmatrix_mean_id が返されます。行列の要素には、オペ レーター get_full_matrixGetFullMatrix などを使用してアクセスできます。

行列の計算方法の指定をパラメーター MeanTypemeanTypemean_type を通じて選択 することができます。

  • 'columns'"columns": 行列 Matrix の各列ごとの平 均が返されます。結果行列 MatrixMean は 1 つの行と入力 行列と同数の列を持ちます。

    例:

    MeanTypemeanTypemean_type = 'columns'"columns"

    \[\begin{eqnarray*} \texttt{Matrix} = \left[ \begin{array}{rrr} 8.0 & 4.0 & -3.0 \\ -6.0 & 2.0 & 7.0 \end{array} \right] \end{eqnarray*}\]
    \[\begin{eqnarray*} \to \qquad \texttt{MatrixMean} = \left[ \begin{array}{rrr} 1.0 & 3.0 & 2.0 \\ \end{array} \right] \end{eqnarray*}\]
  • 'rows'"rows": 行列 Matrix の各行ごとの平均が 返されます。結果行列 MatrixMean は入力行列と同数の行 と 1 つの列を持ちます。

    例:

    MeanTypemeanTypemean_type = 'rows'"rows"

    \[\begin{eqnarray*} \texttt{Matrix} = \left[ \begin{array}{rrr} 8.0 & 4.0 & -3.0 \\ -6.0 & 2.0 & 7.0 \end{array} \right] \end{eqnarray*}\]
    \[\begin{eqnarray*} \to \qquad \texttt{MatrixMean} = \left[ \begin{array}{r} 3.0 \\ 1.0 \end{array} \right] \end{eqnarray*}\]
  • 'full'"full": Matrix の全要素の平均が返され ます。結果行列 MatrixMean は 1 つの行と 1 つの列を持ち ます。

    例:

    MeanTypemeanTypemean_type = 'full'"full"

    \[\begin{eqnarray*} \texttt{Matrix} = \left[ \begin{array}{rrr} 8.0 & 4.0 & -3.0 \\ -6.0 & 2.0 & 7.0 \end{array} \right] \end{eqnarray*}\]
    \[\begin{eqnarray*} \to \qquad \texttt{MatrixMean} = \left[ \begin{array}{r} 2.0 \\ \end{array} \right] \end{eqnarray*}\]

実行情報🔗

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

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

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

パラメーター🔗

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

入力行列の行列ハンドル

MeanTypemeanTypemean_type (input_control) string → (string)HTuple (HString)HTuple (string)strHtuple (char*)

計算方法の指定

初期値: 'columns'"columns"
値のリスト: 'columns', 'full', 'rows'"columns", "full", "rows"

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

入力行列の平均値を持つ行列ハンドル

結果🔗

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

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

組み合わせ

前処理の候補

create_matrixCreateMatrix

後処理の候補

get_full_matrixGetFullMatrix, get_value_matrixGetValueMatrix

関連項目

norm_matrixNormMatrix, sum_matrixSumMatrix

モジュール🔗

Foundation