Computes various norms of a rectangular matrix.
#include <imsl.h>
float imsl_f_matrix_norm (int m, int n, float a[], ..., 0)
The type double function is imsl_d_matrix_norm.
int m
(Input)
The number of rows in matrix A.
int n
(Input)
The number of columns in matrix A.
float a[]
(Input)
Matrix for which the norm will be computed.
The requested norm of the input matrix. If the norm cannot be computed, NaN is returned.
#include <imsl.h>
float
imsl_f_matrix_norm (int m, int n, float
a[],
IMSL_ONE_NORM,
IMSL_INF_NORM,
0)
By default, imsl_f_matrix_norm computes the Frobenius norm

If the option IMSL_ONE_NORM is selected, the 1-norm

is returned. If the option IMSL_INF_NORM is selected, the infinity norm

is returned.
Compute the Frobenius norm, infinity norm, and one norm of matrix A.
#include <imsl.h>
void main()
{
float a[] = {1.0, 2.0, -2.0, 3.0,
-2.0, 1.0, 3.0, 0.0,
0.0, 3.0, 1.0, -7.0,
5.0, -2.0, 7.0, 6.0,
4.0, 3.0, 4.0, 0.0};
int m = 5, n = 4;
float frobenius_norm, inf_norm, one_norm;
frobenius_norm = imsl_f_matrix_norm(m, n, a, 0);
inf_norm = imsl_f_matrix_norm(m, n, a, IMSL_INF_NORM, 0);
one_norm = imsl_f_matrix_norm(m, n, a, IMSL_ONE_NORM, 0);
printf("Frobenius norm = %f\n", frobenius_norm);
printf("Infinity norm = %f\n", inf_norm);
printf("One norm = %f\n", one_norm);
}
|
Visual Numerics, Inc. PHONE: 713.784.3131 FAX:713.781.9260 |