 LAPACK  3.8.0 LAPACK: Linear Algebra PACKage

## ◆ dlange()

 double precision function dlange ( character NORM, integer M, integer N, double precision, dimension( lda, * ) A, integer LDA, double precision, dimension( * ) WORK )

DLANGE returns the value of the 1-norm, Frobenius norm, infinity-norm, or the largest absolute value of any element of a general rectangular matrix.

Download DLANGE + dependencies [TGZ] [ZIP] [TXT]

Purpose:
``` DLANGE  returns the value of the one norm,  or the Frobenius norm, or
the  infinity norm,  or the  element of  largest absolute value  of a
real matrix A.```
Returns
DLANGE
```    DLANGE = ( max(abs(A(i,j))), NORM = 'M' or 'm'
(
( norm1(A),         NORM = '1', 'O' or 'o'
(
( normI(A),         NORM = 'I' or 'i'
(
( normF(A),         NORM = 'F', 'f', 'E' or 'e'

where  norm1  denotes the  one norm of a matrix (maximum column sum),
normI  denotes the  infinity norm  of a matrix  (maximum row sum) and
normF  denotes the  Frobenius norm of a matrix (square root of sum of
squares).  Note that  max(abs(A(i,j)))  is not a consistent matrix norm.```
Parameters
 [in] NORM ``` NORM is CHARACTER*1 Specifies the value to be returned in DLANGE as described above.``` [in] M ``` M is INTEGER The number of rows of the matrix A. M >= 0. When M = 0, DLANGE is set to zero.``` [in] N ``` N is INTEGER The number of columns of the matrix A. N >= 0. When N = 0, DLANGE is set to zero.``` [in] A ``` A is DOUBLE PRECISION array, dimension (LDA,N) The m by n matrix A.``` [in] LDA ``` LDA is INTEGER The leading dimension of the array A. LDA >= max(M,1).``` [out] WORK ``` WORK is DOUBLE PRECISION array, dimension (MAX(1,LWORK)), where LWORK >= M when NORM = 'I'; otherwise, WORK is not referenced.```
Date
December 2016

Definition at line 116 of file dlange.f.

116 *
117 * -- LAPACK auxiliary routine (version 3.7.0) --
118 * -- LAPACK is a software package provided by Univ. of Tennessee, --
119 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
120 * December 2016
121 *
122 * .. Scalar Arguments ..
123  CHARACTER norm
124  INTEGER lda, m, n
125 * ..
126 * .. Array Arguments ..
127  DOUBLE PRECISION a( lda, * ), work( * )
128 * ..
129 *
130 * =====================================================================
131 *
132 * .. Parameters ..
133  DOUBLE PRECISION one, zero
134  parameter( one = 1.0d+0, zero = 0.0d+0 )
135 * ..
136 * .. Local Scalars ..
137  INTEGER i, j
138  DOUBLE PRECISION scale, sum, VALUE, temp
139 * ..
140 * .. External Subroutines ..
141  EXTERNAL dlassq
142 * ..
143 * .. External Functions ..
144  LOGICAL lsame, disnan
145  EXTERNAL lsame, disnan
146 * ..
147 * .. Intrinsic Functions ..
148  INTRINSIC abs, min, sqrt
149 * ..
150 * .. Executable Statements ..
151 *
152  IF( min( m, n ).EQ.0 ) THEN
153  VALUE = zero
154  ELSE IF( lsame( norm, 'M' ) ) THEN
155 *
156 * Find max(abs(A(i,j))).
157 *
158  VALUE = zero
159  DO 20 j = 1, n
160  DO 10 i = 1, m
161  temp = abs( a( i, j ) )
162  IF( VALUE.LT.temp .OR. disnan( temp ) ) VALUE = temp
163  10 CONTINUE
164  20 CONTINUE
165  ELSE IF( ( lsame( norm, 'O' ) ) .OR. ( norm.EQ.'1' ) ) THEN
166 *
167 * Find norm1(A).
168 *
169  VALUE = zero
170  DO 40 j = 1, n
171  sum = zero
172  DO 30 i = 1, m
173  sum = sum + abs( a( i, j ) )
174  30 CONTINUE
175  IF( VALUE.LT.sum .OR. disnan( sum ) ) VALUE = sum
176  40 CONTINUE
177  ELSE IF( lsame( norm, 'I' ) ) THEN
178 *
179 * Find normI(A).
180 *
181  DO 50 i = 1, m
182  work( i ) = zero
183  50 CONTINUE
184  DO 70 j = 1, n
185  DO 60 i = 1, m
186  work( i ) = work( i ) + abs( a( i, j ) )
187  60 CONTINUE
188  70 CONTINUE
189  VALUE = zero
190  DO 80 i = 1, m
191  temp = work( i )
192  IF( VALUE.LT.temp .OR. disnan( temp ) ) VALUE = temp
193  80 CONTINUE
194  ELSE IF( ( lsame( norm, 'F' ) ) .OR. ( lsame( norm, 'E' ) ) ) THEN
195 *
196 * Find normF(A).
197 *
198  scale = zero
199  sum = one
200  DO 90 j = 1, n
201  CALL dlassq( m, a( 1, j ), 1, scale, sum )
202  90 CONTINUE
203  VALUE = scale*sqrt( sum )
204  END IF
205 *
206  dlange = VALUE
207  RETURN
208 *
209 * End of DLANGE
210 *
subroutine dlassq(N, X, INCX, SCALE, SUMSQ)
DLASSQ updates a sum of squares represented in scaled form.
Definition: dlassq.f:105
logical function lsame(CA, CB)
LSAME
Definition: lsame.f:55
logical function disnan(DIN)
DISNAN tests input for NaN.
Definition: disnan.f:61
double precision function dlange(NORM, M, N, A, LDA, WORK)
DLANGE returns the value of the 1-norm, Frobenius norm, infinity-norm, or the largest absolute value ...
Definition: dlange.f:116
Here is the call graph for this function:
Here is the caller graph for this function: