LAPACK  3.6.1
LAPACK: Linear Algebra PACKage
double precision function zlansb ( character  NORM,
character  UPLO,
integer  N,
integer  K,
complex*16, dimension( ldab, * )  AB,
integer  LDAB,
double precision, dimension( * )  WORK 
)

ZLANSB returns the value of the 1-norm, or the Frobenius norm, or the infinity norm, or the element of largest absolute value of a symmetric band matrix.

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

Purpose:
 ZLANSB  returns the value of the one norm,  or the Frobenius norm, or
 the  infinity norm,  or the element of  largest absolute value  of an
 n by n symmetric band matrix A,  with k super-diagonals.
Returns
ZLANSB
    ZLANSB = ( 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 ZLANSB as described
          above.
[in]UPLO
          UPLO is CHARACTER*1
          Specifies whether the upper or lower triangular part of the
          band matrix A is supplied.
          = 'U':  Upper triangular part is supplied
          = 'L':  Lower triangular part is supplied
[in]N
          N is INTEGER
          The order of the matrix A.  N >= 0.  When N = 0, ZLANSB is
          set to zero.
[in]K
          K is INTEGER
          The number of super-diagonals or sub-diagonals of the
          band matrix A.  K >= 0.
[in]AB
          AB is COMPLEX*16 array, dimension (LDAB,N)
          The upper or lower triangle of the symmetric band matrix A,
          stored in the first K+1 rows of AB.  The j-th column of A is
          stored in the j-th column of the array AB as follows:
          if UPLO = 'U', AB(k+1+i-j,j) = A(i,j) for max(1,j-k)<=i<=j;
          if UPLO = 'L', AB(1+i-j,j)   = A(i,j) for j<=i<=min(n,j+k).
[in]LDAB
          LDAB is INTEGER
          The leading dimension of the array AB.  LDAB >= K+1.
[out]WORK
          WORK is DOUBLE PRECISION array, dimension (MAX(1,LWORK)),
          where LWORK >= N when NORM = 'I' or '1' or 'O'; otherwise,
          WORK is not referenced.
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Date
September 2012

Definition at line 132 of file zlansb.f.

132 *
133 * -- LAPACK auxiliary routine (version 3.4.2) --
134 * -- LAPACK is a software package provided by Univ. of Tennessee, --
135 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
136 * September 2012
137 *
138 * .. Scalar Arguments ..
139  CHARACTER norm, uplo
140  INTEGER k, ldab, n
141 * ..
142 * .. Array Arguments ..
143  DOUBLE PRECISION work( * )
144  COMPLEX*16 ab( ldab, * )
145 * ..
146 *
147 * =====================================================================
148 *
149 * .. Parameters ..
150  DOUBLE PRECISION one, zero
151  parameter ( one = 1.0d+0, zero = 0.0d+0 )
152 * ..
153 * .. Local Scalars ..
154  INTEGER i, j, l
155  DOUBLE PRECISION absa, scale, sum, value
156 * ..
157 * .. External Functions ..
158  LOGICAL lsame, disnan
159  EXTERNAL lsame, disnan
160 * ..
161 * .. External Subroutines ..
162  EXTERNAL zlassq
163 * ..
164 * .. Intrinsic Functions ..
165  INTRINSIC abs, max, min, sqrt
166 * ..
167 * .. Executable Statements ..
168 *
169  IF( n.EQ.0 ) THEN
170  VALUE = zero
171  ELSE IF( lsame( norm, 'M' ) ) THEN
172 *
173 * Find max(abs(A(i,j))).
174 *
175  VALUE = zero
176  IF( lsame( uplo, 'U' ) ) THEN
177  DO 20 j = 1, n
178  DO 10 i = max( k+2-j, 1 ), k + 1
179  sum = abs( ab( i, j ) )
180  IF( VALUE .LT. sum .OR. disnan( sum ) ) VALUE = sum
181  10 CONTINUE
182  20 CONTINUE
183  ELSE
184  DO 40 j = 1, n
185  DO 30 i = 1, min( n+1-j, k+1 )
186  sum = abs( ab( i, j ) )
187  IF( VALUE .LT. sum .OR. disnan( sum ) ) VALUE = sum
188  30 CONTINUE
189  40 CONTINUE
190  END IF
191  ELSE IF( ( lsame( norm, 'I' ) ) .OR. ( lsame( norm, 'O' ) ) .OR.
192  $ ( norm.EQ.'1' ) ) THEN
193 *
194 * Find normI(A) ( = norm1(A), since A is symmetric).
195 *
196  VALUE = zero
197  IF( lsame( uplo, 'U' ) ) THEN
198  DO 60 j = 1, n
199  sum = zero
200  l = k + 1 - j
201  DO 50 i = max( 1, j-k ), j - 1
202  absa = abs( ab( l+i, j ) )
203  sum = sum + absa
204  work( i ) = work( i ) + absa
205  50 CONTINUE
206  work( j ) = sum + abs( ab( k+1, j ) )
207  60 CONTINUE
208  DO 70 i = 1, n
209  sum = work( i )
210  IF( VALUE .LT. sum .OR. disnan( sum ) ) VALUE = sum
211  70 CONTINUE
212  ELSE
213  DO 80 i = 1, n
214  work( i ) = zero
215  80 CONTINUE
216  DO 100 j = 1, n
217  sum = work( j ) + abs( ab( 1, j ) )
218  l = 1 - j
219  DO 90 i = j + 1, min( n, j+k )
220  absa = abs( ab( l+i, j ) )
221  sum = sum + absa
222  work( i ) = work( i ) + absa
223  90 CONTINUE
224  IF( VALUE .LT. sum .OR. disnan( sum ) ) VALUE = sum
225  100 CONTINUE
226  END IF
227  ELSE IF( ( lsame( norm, 'F' ) ) .OR. ( lsame( norm, 'E' ) ) ) THEN
228 *
229 * Find normF(A).
230 *
231  scale = zero
232  sum = one
233  IF( k.GT.0 ) THEN
234  IF( lsame( uplo, 'U' ) ) THEN
235  DO 110 j = 2, n
236  CALL zlassq( min( j-1, k ), ab( max( k+2-j, 1 ), j ),
237  $ 1, scale, sum )
238  110 CONTINUE
239  l = k + 1
240  ELSE
241  DO 120 j = 1, n - 1
242  CALL zlassq( min( n-j, k ), ab( 2, j ), 1, scale,
243  $ sum )
244  120 CONTINUE
245  l = 1
246  END IF
247  sum = 2*sum
248  ELSE
249  l = 1
250  END IF
251  CALL zlassq( n, ab( l, 1 ), ldab, scale, sum )
252  VALUE = scale*sqrt( sum )
253  END IF
254 *
255  zlansb = VALUE
256  RETURN
257 *
258 * End of ZLANSB
259 *
logical function disnan(DIN)
DISNAN tests input for NaN.
Definition: disnan.f:61
subroutine zlassq(N, X, INCX, SCALE, SUMSQ)
ZLASSQ updates a sum of squares represented in scaled form.
Definition: zlassq.f:108
double precision function zlansb(NORM, UPLO, N, K, AB, LDAB, WORK)
ZLANSB returns the value of the 1-norm, or the Frobenius norm, or the infinity norm, or the element of largest absolute value of a symmetric band matrix.
Definition: zlansb.f:132
logical function lsame(CA, CB)
LSAME
Definition: lsame.f:55

Here is the call graph for this function: