Matrix Norms
Given two normed linear spaces ( V_{1}, | · |_{1} ) and ( V_{2}, | · |_{2} ) the induced norm on the linear transformations L : V_{1} → V_{2} is defined as| L | = sup{ | L x |_{2} : | x |_{1} = 1 }.
In particular, given a normed linear space ( V, | · |) the induced norm defined on the algebra of linear endomorphisms
A : V → V is given by
| A | = sup{ | A x | : | x | = 1 }.
For the three vector norms, l_{1}, l_{2}, and l_{∞}, the corresponding matrix norms are called the L_{1}, L_{2}, and L_{∞} norms respectively.
The L_{1}-norm of the endomorphism A defined on the normed linear space ( V, | · |_{1}) is the max of the l_{1} norms of the column vectors of A.
The L_{∞}-norm of the endomorphism A defined on the normed linear space ( V, | · |_{∞}) is the max of the l_{1} norms of the row vectors of A.
The L_{2}-norm of the endomorphism A defined on the normed linear space ( V, | · |_{∞}) is the square root of the maximum eigenvalue of A^{T}A. This is usually too unwieldly to be of use, instead the norm | · |_{E} defined as the square root of the sum of squares of all the elements of the matrix A. This norm is sometimes called variously the Euclidean norm or Frobenius norm of the matrix A. This norm satisifies the inequality: | Ax |_{2} ≤ | A |_{E} | x |_{2}.
The source code for evaluating the L_{1}, E, and the L_{∞} norms are given below. The function for evaluating the L_{1} norm of an n × n real matrix is Matrix_L1_Norm, the function for evaluating the Euclidean norm of an n × n real matrix is Matrix_E_Norm, the function for evaluating the L_{∞} norm of an n×n real matrix is Matrix_Max_Norm, the function for evaluating the L_{1} norm of an n × n complex matrix is CMatrix_L1_Norm, the function for evaluating the Euclidean norm of an n × n complex matrix is CMatrix_E_Norm, and the function for evaluating the L_{∞} norm of an n×n complex matrix is CMatrix_Max_Norm.. There are special versions of these routines for the cases of the ubiquitous 2×2 and 3×3 matrices.
Function List
- double Matrix_L1_Norm( double* A, int n )
This routine calculates the L_{1}-norm of the n×n real matrix A,
| A | = max {| A[0][i] | + ··· + | A[n-1][i] | : 0 ≤ i < n }.
- double Matrix_L1_Norm_2d( double* A )
This routine calculates the L_{1}-norm of the 2×2 real matrix A,
| A | = max {| A[0][0] | + | A[1][0] |, | A[0][1] | + | A[1][1] | }.
- double Matrix_L1_Norm_3d( double* A )
This routine calculates the L_{1}-norm of the 3×3 real matrix A,
| A | = max {| A[0][0] | + | A[1][0] | + | A[2][0] |, | A[0][1] | + | A[1][1] | + | A[2][1] |, | A[0][2] | + | A[1][2] | + | A[2][2] | }.
- double Matrix_E_Norm( double* A, int n )
This routine calculates the E-norm of the n×n real matrix A,
| A | = (| A[0][0] |² + ··· + | A[n-1][n-1] |² )^{½}.
- double Matrix_E_Norm_2d( double* A )
This routine calculates the E-norm of the 2×2 real matrix A,
| A | = (| A[0][0] |² + | A[0][1] |² + | A[1][0] |² + | A[1][1] |² )^{½}.
- double Matrix_E_Norm_3d( double* A )
This routine calculates the E-norm of the 3×3 real matrix A,
| A | = (| A[0][0] |² + | A[0][1] |² + | A[0][2] |² + ··· + | A[2][2] |² )^{½}.
- double Matrix_Max_Norm( double* A, int n )
This routine calculates the max-norm of the n×n real matrix A,
| A | = max { | A[i][0] | + ··· + | A[i][n-1] | : 0 ≤ i < n }.
- double Matrix_Max_Norm_2d( double* A )
This routine calculates the max-norm of the 2×2 real matrix A,
| A | = max { | A[0][0] | + | A[0][1] |, | A[1][0] | + | A[1][1] | }.
- double Matrix_Max_Norm_3d( double* A )
This routine calculates the max-norm of the 3×3 real matrix A,
| A | = max { | A[0][0] | + | A[0][1] | + | A[0][2] |, | A[1][0] | + | A[1][1] | + | A[1][2] |,
| A[2][0] | + | A[2][1] | + | A[2][2] | }.
- double CMatrix_L1_Norm( double complex* A, int n )
This routine calculates the L_{1}-norm of the n×n complex matrix A,
| A | = max {| A[0][i] | + ··· + | A[n-1][i] | : 0 ≤ i < n }.
- double CMatrix_L1_Norm_2d( double complex* A )
This routine calculates the L_{1}-norm of the 2×2 complex matrix A,
| A | = max {| A[0][0] | + | A[1][0] |, | A[0][1] | + | A[1][1] | }.
- double CMatrix_L1_Norm_3d( double complex* A )
This routine calculates the L_{1}-norm of the 3×3 complex matrix A,
| A | = max {| A[0][0] | + | A[1][0] | + | A[2][0] |, | A[0][1] | + | A[1][1] | + | A[2][1] |, | A[0][2] | + | A[1][2] | + | A[2][2] | }.
- double CMatrix_E_Norm( double complex* A, int n )
This routine calculates the E-norm of the n×n complex matrix A,
| A | = (| A[0][0] |² + ··· + | A[n-1][n-1] |² )^{½}.
- double CMatrix_E_Norm_2d( double complex* A )
This routine calculates the E-norm of the 2×2 complex matrix A,
| A | = (| A[0][0] |² + | A[0][1] |² + | A[1][0] |² + | A[1][1] |² )^{½}.
- double CMatrix_E_Norm_3d( double complex* A )
This routine calculates the E-norm of the 3×3 complex matrix A,
| A | = (| A[0][0] |² + | A[0][1] |² + | A[0][2] |² + ··· + | A[2][2] |² )^{½}.
- double CMatrix_Max_Norm( double complex* A, int n )
This routine calculates the max-norm of the n×n complex matrix A,
| A | = max { | A[i][0] | + ··· + | A[i][n-1] | : 0 ≤ i < n }.
- double CMatrix_Max_Norm_2d( double complex* A )
This routine calculates the max-norm of the 2×2 complex matrix A,
| A | = max { | A[0][0] | + | A[0][1] |, | A[1][0] | + | A[1][1] | }.
- double CMatrix_Max_Norm_3d( double complex* A )
This routine calculates the max-norm of the 3×3 complex matrix A,
| A | = max { | A[0][0] | + | A[0][1] | + | A[0][2] |, | A[1][0] | + | A[1][1] | + | A[1][2] |,
| A[2][0] | + | A[2][1] | + | A[2][2] | }.
C Source Code
- The file, matrix_l1_norm.c, contains the version of Matrix_L1_Norm( ) written in C.
- The file, matrix_l1_norm_2d.c, contains the version of Matrix_L1_Norm_2d( ) written in C.
- The file, matrix_l1_norm_3d.c, contains the version of Matrix_L1_Norm_3d( ) written in C.
- The file, matrix_e_norm.c, contains the version of Matrix_E_Norm( ) written in C.
- The file, matrix_e_norm_2d.c, contains the version of Matrix_E_Norm_2d( ) written in C.
- The file, matrix_e_norm_3d.c, contains the version of Matrix_E_Norm_3d( ) written in C.
- The file, matrix_max_norm.c, contains the version of Matrix_Max_Norm( ) written in C.
- The file, matrix_max_norm_2d.c, contains the version of Matrix_Max_Norm_2d( ) written in C.
- The file, matrix_max_norm_3d.c, contains the version of Matrix_Max_Norm_3d( ) written in C.
- The file, cmatrix_l1_norm.c, contains the version of CMatrix_L1_Norm( ) written in C.
- The file, cmatrix_l1_norm_2d.c, contains the version of CMatrix_L1_Norm_2d( ) written in C.
- The file, cmatrix_l1_norm_3d.c, contains the version of CMatrix_L1_Norm_3d( ) written in C.
- The file, cmatrix_e_norm.c, contains the version of CMatrix_E_Norm( ) written in C.
- The file, cmatrix_e_norm_2d.c, contains the version of CMatrix_E_Norm_2d( ) written in C.
- The file, cmatrix_e_norm_3d.c, contains the version of CMatrix_E_Norm_3d( ) written in C.
- The file, cmatrix_max_norm.c, contains the version of CMatrix_Max_Norm( ) written in C.
- The file, cmatrix_max_norm_2d.c, contains the version of CMatrix_Max_Norm_2d( ) written in C.
- The file, cmatrix_max_norm_3d.c, contains the version of CMatrix_Max_Norm_3d( ) written in C.
NASM Source Code
For Linux gcc Users
- The file, matrix_l1_norm.asm, contains the version of Matrix_L1_Norm( ) written in NASM.
- The file, matrix_l1_norm_2d.asm, contains the version of Matrix_L1_Norm_2d( ) written in NASM.
- The file, matrix_l1_norm_3d.asm, contains the version of Matrix_L1_Norm_3d( ) written in NASM.
- The file, matrix_e_norm.asm, contains the version of Matrix_E_Norm( ) written in NASM.
- The file, matrix_e_norm_2d.asm, contains the version of Matrix_E_Norm_2d( ) written in NASM.
- The file, matrix_e_norm_3d.asm, contains the version of Matrix_E_Norm_3d( ) written in NASM.
- The file, matrix_max_norm.asm, contains the version of Matrix_Max_Norm( ) written in NASM.
- The file, matrix_max_norm_2d.asm, contains the version of Matrix_Max_Norm_2d( ) written in NASM.
- The file, matrix_max_norm_3d.asm, contains the version of Matrix_Max_Norm_3d( ) written in NASM.
C Test Code, Test Results, and Build Shell Script
- The file, testmatrixl1norm.c, contains a test program of Matrix_L1_Norm( ). This test program requires the file matrix_l1_norm.c listed above.
- The file, MatrixL1NormTest.txt, contains the results of the test program testmatrixl1norm.c.
- The file, testmatrixl1norm.sh, contains the shell script used to compile, link, and execute the test program testmatrixl1norm.c.
- The file, testmatrixl1norm_2d.c, contains a test program of Matrix_L1_Norm_2d( ). This test program requires the file matrix_l1_norm_2d.c listed above.
- The file, MatrixL1Norm2dTest.txt, contains the results of the test program testmatrixl1norm_2d.c.
- The file, testmatrixl1norm_2d.sh, contains the shell script used to compile, link, and execute the test program testmatrixl1norm_2d.c.
- The file, testmatrixl1norm_3d.c, contains a test program of Matrix_L1_Norm_3d( ). This test program requires the file matrix_l1_norm_3d.c listed above.
- The file, MatrixL1Norm3dTest.txt, contains the results of the test program testmatrixl1norm_3d.c.
- The file, testmatrixl1norm_3d.sh, contains the shell script used to compile, link, and execute the test program testmatrixl1norm_3d.c.
- The file, testmatrixenorm.c, contains a test program of Matrix_E_Norm( ). This test program requires the file matrix_e_norm.c listed above.
- The file, MatrixENormTest.txt, contains the results of the test program testmatrixenorm.c.
- The file, testmatrixenorm.sh, contains the shell script used to compile, link, and execute the test program testmatrixenorm.c.
- The file, testmatrixenorm_2d.c, contains a test program of Matrix_E_Norm_2d( ). This test program requires the file matrix_e_norm_2d.c listed above.
- The file, MatrixENorm2dTest.txt, contains the results of the test program testmatrixenorm_2d.c.
- The file, testmatrixenorm_2d.sh, contains the shell script used to compile, link, and execute the test program testmatrixenorm_2d.c.
- The file, testmatrixenorm_3d.c, contains a test program of Matrix_E_Norm_3d( ). This test program requires the file matrix_e_norm_3d.c listed above.
- The file, MatrixENorm3dTest.txt, contains the results of the test program testmatrixenorm_3d.c.
- The file, testmatrixenorm_3d.sh, contains the shell script used to compile, link, and execute the test program testmatrixenorm_3d.c.
- The file, testmatrixmaxnorm.c, contains a test program of Matrix_Max_Norm( ). This test program requires the file matrix_max_norm.c listed above.
- The file, MatrixMaxNormTest.txt, contains the results of the test program testmatrixmaxnorm.c.
- The file, testmatrixmaxnorm.sh, contains the shell script used to compile, link, and execute the test program testmatrixmaxnorm.c.
- The file, testmatrixmaxnorm_2d.c, contains a test program of Matrix_Max_Norm_2d( ). This test program requires the file matrix_max_norm_2d.c listed above.
- The file, MatrixMaxNorm2dTest.txt, contains the results of the test program testmatrixmaxnorm_2d.c.
- The file, testmatrixmaxnorm_2d.sh, contains the shell script used to compile, link, and execute the test program testmatrixmaxnorm_2d.c.
- The file, testmatrixmaxnorm_3d.c, contains a test program of Matrix_Max_Norm_3d( ). This test program requires the file matrix_max_norm_3d.c listed above.
- The file, MatrixMaxNorm3dTest.txt, contains the results of the test program testmatrixmaxnorm_3d.c.
- The file, testmatrixmaxnorm_3d.sh, contains the shell script used to compile, link, and execute the test program testmatrixmaxnorm_3d.c.
- The file, testcmatrixl1norm.c, contains a test program of CMatrix_L1_Norm( ). This test program requires the file cmatrix_l1_norm.c listed above.
- The file, CMatrixL1NormTest.txt, contains the results of the test program testcmatrixl1norm.c.
- The file, testcmatrixl1norm.sh, contains the shell script used to compile, link, and execute the test program testcmatrixl1norm.c.
- The file, testcmatrixl1norm_2d.c, contains a test program of CMatrix_L1_Norm_2d( ). This test program requires the file cmatrix_l1_norm_2d.c listed above.
- The file, CMatrixL1Norm2dTest.txt, contains the results of the test program testcmatrixl1norm_2d.c.
- The file, testcmatrixl1norm_2d.sh, contains the shell script used to compile, link, and execute the test program testcmatrixl1norm_2d.c.
- The file, testcmatrixl1norm_3d.c, contains a test program of CMatrix_L1_Norm_3d( ). This test program requires the file cmatrix_l1_norm_3d.c listed above.
- The file, CMatrixL1Norm3dTest.txt, contains the results of the test program testcmatrixl1norm_3d.c.
- The file, testcmatrixl1norm_3d.sh, contains the shell script used to compile, link, and execute the test program testcmatrixl1norm_3d.c.
- The file, testcmatrixenorm.c, contains a test program of CMatrix_E_Norm( ). This test program requires the file cmatrix_l2_norm.c listed above.
- The file, CMatrixENormTest.txt, contains the results of the test program testcmatrixenorm.c.
- The file, testcmatrixenorm.sh, contains the shell script used to compile, link, and execute the test program testcmatrixenorm.c.
- The file, testcmatrixenorm_2d.c, contains a test program of CMatrix_E_Norm_2d( ). This test program requires the file cmatrix_l2_norm_2d.c listed above.
- The file, CMatrixENorm2dTest.txt, contains the results of the test program testcmatrixenorm_2d.c.
- The file, testcmatrixenorm_2d.sh, contains the shell script used to compile, link, and execute the test program testcmatrixenorm_2d.c.
- The file, testcmatrixenorm_3d.c, contains a test program of CMatrix_E_Norm_3d( ). This test program requires the file cmatrix_e_norm_3d.c listed above.
- The file, CMatrixENorm3dTest.txt, contains the results of the test program testcmatrixl2norm_3d.c.
- The file, testcmatrixenorm_3d.sh, contains the shell script used to compile, link, and execute the test program testcmatrixenorm_3d.c.
- The file, testcmatrixmaxnorm.c, contains a test program of CMatrix_Max_Norm( ). This test program requires the file cmatrix_max_norm.c listed above.
- The file, CMatrixMaxNormTest.txt, contains the results of the test program testcmatrixmaxnorm.c.
- The file, testcmatrixmaxnorm.sh, contains the shell script used to compile, link, and execute the test program testcmatrixmaxnorm.c.
- The file, testcmatrixmaxnorm_2d.c, contains a test program of CMatrix_Max_Norm_2d( ). This test program requires the file cmatrix_max_norm_2d.c listed above.
- The file, CMatrixMaxNorm2dTest.txt, contains the results of the test program testcmatrixmaxnorm_2d.c.
- The file, testcmatrixmaxnorm_2d.sh, contains the shell script used to compile, link, and execute the test program testcmatrixmaxnorm_2d.c.
- The file, testcmatrixmaxnorm_3d.c, contains a test program of CMatrix_Max_Norm_3d( ). This test program requires the file cmatrix_max_norm_3d.c listed above.
- The file, CMatrixMaxNorm3dTest.txt, contains the results of the test program testcmatrixmaxnorm_3d.c.
- The file, testcmatrixmaxnorm_3d.sh, contains the shell script used to compile, link, and execute the test program testcmatrixmaxnorm_3d.c.