1HPL_dlange(3) HPL Library Functions HPL_dlange(3)
2
3
4
6 HPL_dlange - Compute ||A||.
7
9 #include "hpl.h"
10
11 double HPL_dlange( const HPL_T_NORM NORM, const int M, const int N,
12 const double * A, const int LDA );
13
15 HPL_dlange returns the value of the one norm, or the infinity norm,
16 or the element of largest absolute value of a matrix A:
17
18 max(abs(A(i,j))) when NORM = HPL_NORM_A,
19 norm1(A), when NORM = HPL_NORM_1,
20 normI(A), when NORM = HPL_NORM_I,
21
22 where norm1 denotes the one norm of a matrix (maximum column sum) and
23 normI denotes the infinity norm of a matrix (maximum row sum). Note
24 that max(abs(A(i,j))) is not a matrix norm.
25
27 NORM (local input) const HPL_T_NORM
28 On entry, NORM specifies the value to be returned by this
29 function as described above.
30
31 M (local input) const int
32 On entry, M specifies the number of rows of the matrix A.
33 M must be at least zero.
34
35 N (local input) const int
36 On entry, N specifies the number of columns of the matrix A.
37 N must be at least zero.
38
39 A (local input) const double *
40 On entry, A points to an array of dimension (LDA,N), that
41 contains the matrix A.
42
43 LDA (local input) const int
44 On entry, LDA specifies the leading dimension of the array A.
45 LDA must be at least max(1,M).
46
48 #include "hpl.h"
49
50 int main(int argc, char *argv[])
51 {
52 double a[2*2];
53 a[0] = 1.0; a[1] = 3.0; a[2] = 2.0; a[3] = 4.0;
54 norm = HPL_dlange( HPL_NORM_I, 2, 2, a, 2 );
55 printf("norm=%f\n", norm);
56 exit(0); return(0);
57 }
58
60 HPL_dlaprnt (3), HPL_fprintf (3).
61
62
63
64HPL 2.1 October 26, 2012 HPL_dlange(3)