LAPACK  3.9.0
LAPACK: Linear Algebra PACKage

◆ zlansb()

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
December 2016

Definition at line 132 of file zlansb.f.

132 *
133 * -- LAPACK auxiliary routine (version 3.7.0) --
134 * -- LAPACK is a software package provided by Univ. of Tennessee, --
135 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
136 * December 2016
137 *
138  IMPLICIT NONE
139 * .. Scalar Arguments ..
140  CHARACTER NORM, UPLO
141  INTEGER K, LDAB, N
142 * ..
143 * .. Array Arguments ..
144  DOUBLE PRECISION WORK( * )
145  COMPLEX*16 AB( LDAB, * )
146 * ..
147 *
148 * =====================================================================
149 *
150 * .. Parameters ..
151  DOUBLE PRECISION ONE, ZERO
152  parameter( one = 1.0d+0, zero = 0.0d+0 )
153 * ..
154 * .. Local Scalars ..
155  INTEGER I, J, L
156  DOUBLE PRECISION ABSA, SUM, VALUE
157 * ..
158 * .. Local Arrays ..
159  DOUBLE PRECISION SSQ( 2 ), COLSSQ( 2 )
160 * ..
161 * .. External Functions ..
162  LOGICAL LSAME, DISNAN
163  EXTERNAL lsame, disnan
164 * ..
165 * .. External Subroutines ..
166  EXTERNAL zlassq, dcombssq
167 * ..
168 * .. Intrinsic Functions ..
169  INTRINSIC abs, max, min, sqrt
170 * ..
171 * .. Executable Statements ..
172 *
173  IF( n.EQ.0 ) THEN
174  VALUE = zero
175  ELSE IF( lsame( norm, 'M' ) ) THEN
176 *
177 * Find max(abs(A(i,j))).
178 *
179  VALUE = zero
180  IF( lsame( uplo, 'U' ) ) THEN
181  DO 20 j = 1, n
182  DO 10 i = max( k+2-j, 1 ), k + 1
183  sum = abs( ab( i, j ) )
184  IF( VALUE .LT. sum .OR. disnan( sum ) ) VALUE = sum
185  10 CONTINUE
186  20 CONTINUE
187  ELSE
188  DO 40 j = 1, n
189  DO 30 i = 1, min( n+1-j, k+1 )
190  sum = abs( ab( i, j ) )
191  IF( VALUE .LT. sum .OR. disnan( sum ) ) VALUE = sum
192  30 CONTINUE
193  40 CONTINUE
194  END IF
195  ELSE IF( ( lsame( norm, 'I' ) ) .OR. ( lsame( norm, 'O' ) ) .OR.
196  $ ( norm.EQ.'1' ) ) THEN
197 *
198 * Find normI(A) ( = norm1(A), since A is symmetric).
199 *
200  VALUE = zero
201  IF( lsame( uplo, 'U' ) ) THEN
202  DO 60 j = 1, n
203  sum = zero
204  l = k + 1 - j
205  DO 50 i = max( 1, j-k ), j - 1
206  absa = abs( ab( l+i, j ) )
207  sum = sum + absa
208  work( i ) = work( i ) + absa
209  50 CONTINUE
210  work( j ) = sum + abs( ab( k+1, j ) )
211  60 CONTINUE
212  DO 70 i = 1, n
213  sum = work( i )
214  IF( VALUE .LT. sum .OR. disnan( sum ) ) VALUE = sum
215  70 CONTINUE
216  ELSE
217  DO 80 i = 1, n
218  work( i ) = zero
219  80 CONTINUE
220  DO 100 j = 1, n
221  sum = work( j ) + abs( ab( 1, j ) )
222  l = 1 - j
223  DO 90 i = j + 1, min( n, j+k )
224  absa = abs( ab( l+i, j ) )
225  sum = sum + absa
226  work( i ) = work( i ) + absa
227  90 CONTINUE
228  IF( VALUE .LT. sum .OR. disnan( sum ) ) VALUE = sum
229  100 CONTINUE
230  END IF
231  ELSE IF( ( lsame( norm, 'F' ) ) .OR. ( lsame( norm, 'E' ) ) ) THEN
232 *
233 * Find normF(A).
234 * SSQ(1) is scale
235 * SSQ(2) is sum-of-squares
236 * For better accuracy, sum each column separately.
237 *
238  ssq( 1 ) = zero
239  ssq( 2 ) = one
240 *
241 * Sum off-diagonals
242 *
243  IF( k.GT.0 ) THEN
244  IF( lsame( uplo, 'U' ) ) THEN
245  DO 110 j = 2, n
246  colssq( 1 ) = zero
247  colssq( 2 ) = one
248  CALL zlassq( min( j-1, k ), ab( max( k+2-j, 1 ), j ),
249  $ 1, colssq( 1 ), colssq( 2 ) )
250  CALL dcombssq( ssq, colssq )
251  110 CONTINUE
252  l = k + 1
253  ELSE
254  DO 120 j = 1, n - 1
255  colssq( 1 ) = zero
256  colssq( 2 ) = one
257  CALL zlassq( min( n-j, k ), ab( 2, j ), 1,
258  $ colssq( 1 ), colssq( 2 ) )
259  CALL dcombssq( ssq, colssq )
260  120 CONTINUE
261  l = 1
262  END IF
263  ssq( 2 ) = 2*ssq( 2 )
264  ELSE
265  l = 1
266  END IF
267 *
268 * Sum diagonal
269 *
270  colssq( 1 ) = zero
271  colssq( 2 ) = one
272  CALL zlassq( n, ab( l, 1 ), ldab, colssq( 1 ), colssq( 2 ) )
273  CALL dcombssq( ssq, colssq )
274  VALUE = ssq( 1 )*sqrt( ssq( 2 ) )
275  END IF
276 *
277  zlansb = VALUE
278  RETURN
279 *
280 * End of ZLANSB
281 *
Here is the call graph for this function:
zlassq
subroutine zlassq(N, X, INCX, SCALE, SUMSQ)
ZLASSQ updates a sum of squares represented in scaled form.
Definition: zlassq.f:108
disnan
logical function disnan(DIN)
DISNAN tests input for NaN.
Definition: disnan.f:61
lsame
logical function lsame(CA, CB)
LSAME
Definition: lsame.f:55
zlansb
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,...
Definition: zlansb.f:132
dcombssq
subroutine dcombssq(V1, V2)
DCOMBSSQ adds two scaled sum of squares quantities.
Definition: dcombssq.f:62