1 *> \brief \b SLANSB 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.
3 * =========== DOCUMENTATION ===========
5 * Online html documentation available at
6 * http://www.netlib.org/lapack/explore-html/
9 *> Download SLANSB + dependencies
10 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/slansb.f">
12 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/slansb.f">
14 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/slansb.f">
21 * REAL FUNCTION SLANSB( NORM, UPLO, N, K, AB, LDAB,
24 * .. Scalar Arguments ..
25 * CHARACTER NORM, UPLO
28 * .. Array Arguments ..
29 * REAL AB( LDAB, * ), WORK( * )
38 *> SLANSB returns the value of the one norm, or the Frobenius norm, or
39 *> the infinity norm, or the element of largest absolute value of an
40 *> n by n symmetric band matrix A, with k super-diagonals.
46 *> SLANSB = ( max(abs(A(i,j))), NORM = 'M' or 'm'
48 *> ( norm1(A), NORM = '1', 'O' or 'o'
50 *> ( normI(A), NORM = 'I' or 'i'
52 *> ( normF(A), NORM = 'F', 'f', 'E' or 'e'
54 *> where norm1 denotes the one norm of a matrix (maximum column sum),
55 *> normI denotes the infinity norm of a matrix (maximum row sum) and
56 *> normF denotes the Frobenius norm of a matrix (square root of sum of
57 *> squares). Note that max(abs(A(i,j))) is not a consistent matrix norm.
65 *> NORM is CHARACTER*1
66 *> Specifies the value to be returned in SLANSB as described
72 *> UPLO is CHARACTER*1
73 *> Specifies whether the upper or lower triangular part of the
74 *> band matrix A is supplied.
75 *> = 'U': Upper triangular part is supplied
76 *> = 'L': Lower triangular part is supplied
82 *> The order of the matrix A. N >= 0. When N = 0, SLANSB is
89 *> The number of super-diagonals or sub-diagonals of the
90 *> band matrix A. K >= 0.
95 *> AB is REAL array, dimension (LDAB,N)
96 *> The upper or lower triangle of the symmetric band matrix A,
97 *> stored in the first K+1 rows of AB. The j-th column of A is
98 *> stored in the j-th column of the array AB as follows:
99 *> if UPLO = 'U', AB(k+1+i-j,j) = A(i,j) for max(1,j-k)<=i<=j;
100 *> if UPLO = 'L', AB(1+i-j,j) = A(i,j) for j<=i<=min(n,j+k).
106 *> The leading dimension of the array AB. LDAB >= K+1.
111 *> WORK is REAL array, dimension (MAX(1,LWORK)),
112 *> where LWORK >= N when NORM = 'I' or '1' or 'O'; otherwise,
113 *> WORK is not referenced.
119 *> \author Univ. of Tennessee
120 *> \author Univ. of California Berkeley
121 *> \author Univ. of Colorado Denver
124 *> \date September 2012
126 *> \ingroup realOTHERauxiliary
128 * =====================================================================
129 REAL FUNCTION SLANSB( NORM, UPLO, N, K, AB, LDAB,
132 * -- LAPACK auxiliary routine (version 3.4.2) --
133 * -- LAPACK is a software package provided by Univ. of Tennessee, --
134 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
137 * .. Scalar Arguments ..
141 * .. Array Arguments ..
142 REAL AB( LDAB, * ), WORK( * )
145 * =====================================================================
149 PARAMETER ( ONE = 1.0E+0, ZERO = 0.0E+0 )
151 * .. Local Scalars ..
153 REAL ABSA, SCALE, SUM, VALUE
155 * .. External Subroutines ..
158 * .. External Functions ..
159 LOGICAL LSAME, SISNAN
160 EXTERNAL LSAME, SISNAN
162 * .. Intrinsic Functions ..
163 INTRINSIC ABS, MAX, MIN, SQRT
165 * .. Executable Statements ..
169 ELSE IF( LSAME( NORM, 'M' ) ) THEN
171 * Find max(abs(A(i,j))).
174 IF( LSAME( UPLO, 'U' ) ) THEN
176 DO 10 I = MAX( K+2-J, 1 ), K + 1
177 SUM = ABS( AB( I, J ) )
178 IF( VALUE .LT. SUM .OR. SISNAN( SUM ) ) VALUE = SUM
183 DO 30 I = 1, MIN( N+1-J, K+1 )
184 SUM = ABS( AB( I, J ) )
185 IF( VALUE .LT. SUM .OR. SISNAN( SUM ) ) VALUE = SUM
189 ELSE IF( ( LSAME( NORM, 'I' ) ) .OR. ( LSAME( NORM, 'O' ) ) .OR.
190 $ ( NORM.EQ.'1' ) ) THEN
192 * Find normI(A) ( = norm1(A), since A is symmetric).
195 IF( LSAME( UPLO, 'U' ) ) THEN
199 DO 50 I = MAX( 1, J-K ), J - 1
200 ABSA = ABS( AB( L+I, J ) )
202 WORK( I ) = WORK( I ) + ABSA
204 WORK( J ) = SUM + ABS( AB( K+1, J ) )
208 IF( VALUE .LT. SUM .OR. SISNAN( SUM ) ) VALUE = SUM
215 SUM = WORK( J ) + ABS( AB( 1, J ) )
217 DO 90 I = J + 1, MIN( N, J+K )
218 ABSA = ABS( AB( L+I, J ) )
220 WORK( I ) = WORK( I ) + ABSA
222 IF( VALUE .LT. SUM .OR. SISNAN( SUM ) ) VALUE = SUM
225 ELSE IF( ( LSAME( NORM, 'F' ) ) .OR. ( LSAME( NORM, 'E' ) ) ) THEN
232 IF( LSAME( UPLO, 'U' ) ) THEN
234 CALL SLASSQ( MIN( J-1, K ), AB( MAX( K+2-J, 1 ), J ),
240 CALL SLASSQ( MIN( N-J, K ), AB( 2, J ), 1, SCALE,
249 CALL SLASSQ( N, AB( L, 1 ), LDAB, SCALE, SUM )
250 VALUE = SCALE*SQRT( SUM )