LAPACK  3.8.0
LAPACK: Linear Algebra PACKage

◆ dlansb()

double precision function dlansb ( character  NORM,
character  UPLO,
integer  N,
integer  K,
double precision, dimension( ldab, * )  AB,
integer  LDAB,
double precision, dimension( * )  WORK 
)

DLANSB 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 DLANSB + dependencies [TGZ] [ZIP] [TXT]

Purpose:
 DLANSB  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
DLANSB
    DLANSB = ( 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 DLANSB 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, DLANSB 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 DOUBLE PRECISION 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 131 of file dlansb.f.

131 *
132 * -- LAPACK auxiliary routine (version 3.7.0) --
133 * -- LAPACK is a software package provided by Univ. of Tennessee, --
134 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
135 * December 2016
136 *
137 * .. Scalar Arguments ..
138  CHARACTER norm, uplo
139  INTEGER k, ldab, n
140 * ..
141 * .. Array Arguments ..
142  DOUBLE PRECISION ab( ldab, * ), work( * )
143 * ..
144 *
145 * =====================================================================
146 *
147 * .. Parameters ..
148  DOUBLE PRECISION one, zero
149  parameter( one = 1.0d+0, zero = 0.0d+0 )
150 * ..
151 * .. Local Scalars ..
152  INTEGER i, j, l
153  DOUBLE PRECISION absa, scale, sum, value
154 * ..
155 * .. External Subroutines ..
156  EXTERNAL dlassq
157 * ..
158 * .. External Functions ..
159  LOGICAL lsame, disnan
160  EXTERNAL lsame, disnan
161 * ..
162 * .. Intrinsic Functions ..
163  INTRINSIC abs, max, min, sqrt
164 * ..
165 * .. Executable Statements ..
166 *
167  IF( n.EQ.0 ) THEN
168  VALUE = zero
169  ELSE IF( lsame( norm, 'M' ) ) THEN
170 *
171 * Find max(abs(A(i,j))).
172 *
173  VALUE = zero
174  IF( lsame( uplo, 'U' ) ) THEN
175  DO 20 j = 1, n
176  DO 10 i = max( k+2-j, 1 ), k + 1
177  sum = abs( ab( i, j ) )
178  IF( VALUE .LT. sum .OR. disnan( sum ) ) VALUE = sum
179  10 CONTINUE
180  20 CONTINUE
181  ELSE
182  DO 40 j = 1, n
183  DO 30 i = 1, min( n+1-j, k+1 )
184  sum = abs( ab( i, j ) )
185  IF( VALUE .LT. sum .OR. disnan( sum ) ) VALUE = sum
186  30 CONTINUE
187  40 CONTINUE
188  END IF
189  ELSE IF( ( lsame( norm, 'I' ) ) .OR. ( lsame( norm, 'O' ) ) .OR.
190  $ ( norm.EQ.'1' ) ) THEN
191 *
192 * Find normI(A) ( = norm1(A), since A is symmetric).
193 *
194  VALUE = zero
195  IF( lsame( uplo, 'U' ) ) THEN
196  DO 60 j = 1, n
197  sum = zero
198  l = k + 1 - j
199  DO 50 i = max( 1, j-k ), j - 1
200  absa = abs( ab( l+i, j ) )
201  sum = sum + absa
202  work( i ) = work( i ) + absa
203  50 CONTINUE
204  work( j ) = sum + abs( ab( k+1, j ) )
205  60 CONTINUE
206  DO 70 i = 1, n
207  sum = work( i )
208  IF( VALUE .LT. sum .OR. disnan( sum ) ) VALUE = sum
209  70 CONTINUE
210  ELSE
211  DO 80 i = 1, n
212  work( i ) = zero
213  80 CONTINUE
214  DO 100 j = 1, n
215  sum = work( j ) + abs( ab( 1, j ) )
216  l = 1 - j
217  DO 90 i = j + 1, min( n, j+k )
218  absa = abs( ab( l+i, j ) )
219  sum = sum + absa
220  work( i ) = work( i ) + absa
221  90 CONTINUE
222  IF( VALUE .LT. sum .OR. disnan( sum ) ) VALUE = sum
223  100 CONTINUE
224  END IF
225  ELSE IF( ( lsame( norm, 'F' ) ) .OR. ( lsame( norm, 'E' ) ) ) THEN
226 *
227 * Find normF(A).
228 *
229  scale = zero
230  sum = one
231  IF( k.GT.0 ) THEN
232  IF( lsame( uplo, 'U' ) ) THEN
233  DO 110 j = 2, n
234  CALL dlassq( min( j-1, k ), ab( max( k+2-j, 1 ), j ),
235  $ 1, scale, sum )
236  110 CONTINUE
237  l = k + 1
238  ELSE
239  DO 120 j = 1, n - 1
240  CALL dlassq( min( n-j, k ), ab( 2, j ), 1, scale,
241  $ sum )
242  120 CONTINUE
243  l = 1
244  END IF
245  sum = 2*sum
246  ELSE
247  l = 1
248  END IF
249  CALL dlassq( n, ab( l, 1 ), ldab, scale, sum )
250  VALUE = scale*sqrt( sum )
251  END IF
252 *
253  dlansb = VALUE
254  RETURN
255 *
256 * End of DLANSB
257 *
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 dlansb(NORM, UPLO, N, K, AB, LDAB, WORK)
DLANSB 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: dlansb.f:131
Here is the call graph for this function: