norm_matrix๐
Short description๐
norm_matrix โ Norm of a matrix.
Signature๐
norm_matrix( matrix MatrixID, string NormType, out real Value )
Description๐
The operator norm_matrix computes the norm of the elements
of the Matrix defined by the matrix handle
MatrixID. The return value is a floating point number.
The type of norming of the matrix can be selected via the parameter
NormType:
-
'frobenius-norm': The Frobenius norm is computed. The formula for the calculation of the result is:
\[\begin{eqnarray*} \textrm{Value} \quad = \quad \sqrt{\sum_{i=0}^{m-1} \sum_{j=0}^{n-1}{\texttt{Matrix}_{ij}}^2} \end{eqnarray*}\]with \(m\) = number of rows and \(n\) = number of columns of the
Matrix.Example:
\[\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': The infinity norm is computed. The result is the largest value of the sum of the absolute values of the elements of the rows. The formula for the calculation is:
\[\begin{eqnarray*} \textrm{Value} \quad = \quad \max_{i=0,m-1} \sum_{j=0}^{n-1}|\texttt{Matrix}_{ij}| \end{eqnarray*}\]with \(m\) = number of rows and \(n\) = number of columns of the
Matrix.Example:
\[\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': The 1-norm is computed. The result is the largest value of the sum of the absolute values of the elements of the columns. The formula for the calculation is:
\[\begin{eqnarray*} \textrm{Value} \quad = \quad \max_{j=0,n-1} \sum_{i=0}^{m-1}|\texttt{Matrix}_{ij}| \end{eqnarray*}\]with \(m\) = number of rows and \(n\) = number of columns of the
Matrix.Example:
\[\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': The 2-norm is computed. The result is the largest singular value of the
Matrix. The formula for the calculation of the result is:\[\begin{eqnarray*} \textrm{Value} \quad = \quad \max\,(\mathrm{singular\,values}\,(\texttt{Matrix})) \end{eqnarray*}\]Example:
\[\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*}\]
Execution information๐
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๐
MatrixID (input_control) matrix โ (handle)
Matrix handle of the input matrix.
NormType (input_control) string โ (string)
Type of norm.
Default: '2-norm'
List of values: '1-norm', '2-norm', 'frobenius-norm', 'infinity-norm'
Value (output_control) real โ (real)
Norm of the input matrix.
Result๐
If the parameters are valid, the operator norm_matrix
returns the value 2 (H_MSG_TRUE). If necessary, an exception is raised.
Combinations with other operators๐
References๐
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.
Module๐
Foundation