LAPACK  3.6.1 LAPACK: Linear Algebra PACKage
 real function slange ( character NORM, integer M, integer N, real, dimension( lda, * ) A, integer LDA, real, dimension( * ) WORK )

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

Purpose:
``` SLANGE  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
SLANGE
```    SLANGE = ( 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 SLANGE as described above.``` [in] M ``` M is INTEGER The number of rows of the matrix A. M >= 0. When M = 0, SLANGE is set to zero.``` [in] N ``` N is INTEGER The number of columns of the matrix A. N >= 0. When N = 0, SLANGE is set to zero.``` [in] A ``` A is REAL 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 REAL array, dimension (MAX(1,LWORK)), where LWORK >= M when NORM = 'I'; otherwise, WORK is not referenced.```
Date
September 2012

Definition at line 116 of file slange.f.

116 *
117 * -- LAPACK auxiliary routine (version 3.4.2) --
118 * -- LAPACK is a software package provided by Univ. of Tennessee, --
119 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
120 * September 2012
121 *
122 * .. Scalar Arguments ..
123  CHARACTER norm
124  INTEGER lda, m, n
125 * ..
126 * .. Array Arguments ..
127  REAL a( lda, * ), work( * )
128 * ..
129 *
130 * =====================================================================
131 *
132 * .. Parameters ..
133  REAL one, zero
134  parameter ( one = 1.0e+0, zero = 0.0e+0 )
135 * ..
136 * .. Local Scalars ..
137  INTEGER i, j
138  REAL scale, sum, VALUE, temp
139 * ..
140 * .. External Subroutines ..
141  EXTERNAL slassq
142 * ..
143 * .. External Functions ..
144  LOGICAL lsame, sisnan
145  EXTERNAL lsame, sisnan
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. sisnan( 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. sisnan( 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. sisnan( 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 slassq( m, a( 1, j ), 1, scale, sum )
202  90 CONTINUE
203  VALUE = scale*sqrt( sum )
204  END IF
205 *
206  slange = VALUE
207  RETURN
208 *
209 * End of SLANGE
210 *
subroutine slassq(N, X, INCX, SCALE, SUMSQ)
SLASSQ updates a sum of squares represented in scaled form.
Definition: slassq.f:105
logical function sisnan(SIN)
SISNAN tests input for NaN.
Definition: sisnan.f:61
real function slange(NORM, M, N, A, LDA, WORK)
SLANGE returns the value of the 1-norm, Frobenius norm, infinity-norm, or the largest absolute value ...
Definition: slange.f:116
logical function lsame(CA, CB)
LSAME
Definition: lsame.f:55

Here is the call graph for this function:

Here is the caller graph for this function: