Skip to content

norm_matrixNormMatrixNormMatrixnorm_matrixT_norm_matrix🔗

説明🔗

norm_matrixNormMatrixNormMatrixnorm_matrixT_norm_matrix — 行列のノルムを計算する。

書式🔗

norm_matrix( matrix MatrixID, string NormType, out real Value )void NormMatrix( const HTuple& MatrixID, const HTuple& NormType, HTuple* Value )static void HOperatorSet.NormMatrix( HTuple matrixID, HTuple normType, out HTuple value )def norm_matrix( matrix_id: HHandle, norm_type: str ) -> float

Herror T_norm_matrix( const Htuple MatrixID, const Htuple NormType, Htuple* Value )

double HMatrix::NormMatrix( const HString& NormType ) const

double HMatrix::NormMatrix( const char* NormType ) const

double HMatrix::NormMatrix( const wchar_t* NormType ) const (Windows only)

double HMatrix.NormMatrix( string normType )

説明🔗

オペレーター norm_matrixNormMatrix は行列ハンドル MatrixIDmatrixIDmatrix_id で定義された行列 Matrix の要素のノルム を計算します。戻り値は浮動小数点数です。

行列のノルムの計算手法はパラメーター NormTypenormTypenorm_type で設定する ことができます。

  • 'frobenius-norm'"frobenius-norm": フロベニウスノルムが計算され ます。結果の計算式は以下の通りです。

    \[\begin{eqnarray*} \textrm{Value} \quad = \quad \sqrt{\sum_{i=0}^{m-1} \sum_{j=0}^{n-1}{\texttt{Matrix}_{ij}}^2} \end{eqnarray*}\]

    ここで \(m\) は行列 Matrix の行数、\(n\) は列数を表しま す。

    例:

    \[\begin{eqnarray*} \texttt{Matrix} = \left[ \begin{array}{rr} 3.0 & 1.0 \\ 4.0 & -3.0 \\ -7.0 & 4.0 \end{array} \right] \qquad \to \qquad \textrm{Value} = 10.0 \end{eqnarray*}\]
  • 'infinity-norm'"infinity-norm": 無限ノルムが計算されます。無限 ノルムでは各行要素の絶対値の和の最大値を計算結果として返します。 計算式は以下のとおりです。

    \[\begin{eqnarray*} \textrm{Value} \quad = \quad \max_{i=0,m-1} \sum_{j=0}^{n-1}|\texttt{Matrix}_{ij}| \end{eqnarray*}\]

    ここで \(m\) は行列 Matrix の行数、\(n\) は列数を表しま す。

    例:

    \[\begin{eqnarray*} \texttt{Matrix} = \left[ \begin{array}{rr} 3.0 & 1.0 \\ 4.0 & -3.0 \\ -7.0 & 4.0 \end{array} \right] \qquad \to \qquad \textrm{Value} = 11.0 \end{eqnarray*}\]
  • '1-norm'"1-norm": 1-ノルムが計算されます。1-ノルムでは各 列要素の絶対値の和の最大値を計算結果として返します。計算式は以下 のとおりです。

    \[\begin{eqnarray*} \textrm{Value} \quad = \quad \max_{j=0,n-1} \sum_{i=0}^{m-1}|\texttt{Matrix}_{ij}| \end{eqnarray*}\]

    ここで \(m\) は行列 Matrix の行数、\(n\) は列数を表しま す。

    例:

    \[\begin{eqnarray*} \texttt{Matrix} = \left[ \begin{array}{rr} 3.0 & 1.0 \\ 4.0 & -3.0 \\ -7.0 & 4.0 \end{array} \right] \qquad \to \qquad \textrm{Value} = 14.0 \end{eqnarray*}\]
  • '2-norm'"2-norm": 2-ノルムが計算されます。2-ノルムでは行 列 Matrix の最大特異値を計算結果として返します。結果の 計算式は以下の通りです。

    \[\begin{eqnarray*} \textrm{Value} \quad = \quad \max\,(\mathrm{singular\,values}\,(\texttt{Matrix})) \end{eqnarray*}\]

    例:

    \[\begin{eqnarray*} \texttt{Matrix} = \left[ \begin{array}{rr} 3.0 & 1.0 \\ 4.0 & -3.0 \\ -7.0 & 4.0 \end{array} \right] \qquad \to \qquad \textrm{Value} = 9.7006 \end{eqnarray*}\]

実行情報🔗

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

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

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

パラメーター🔗

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

入力行列の行列ハンドル

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

ノルムの種類

初期値: '2-norm'"2-norm"
値のリスト: '1-norm', '2-norm', 'frobenius-norm', 'infinity-norm'"1-norm", "2-norm", "frobenius-norm", "infinity-norm"

Valuevaluevalue (output_control) real → (real)HTuple (double)HTuple (double)floatHtuple (double)

入力行列のノルム

結果🔗

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

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

組み合わせ

前処理の候補

create_matrixCreateMatrix

関連項目

sum_matrixSumMatrix, mean_matrixMeanMatrix

参考文献🔗

David Poole: “Linear Algebra: A Modern Introduction”; Thomson; Belmont; 2006.

Gene H. Golub, Charles F. van Loan: “Matrix Computations”; The Johns Hopkins University Press; Baltimore and London; 1996.

モジュール🔗

Foundation