1 *> \brief \b SLANGT returns the value of the 1-norm, Frobenius norm, infinity-norm, or the largest absolute value of any element of a general tridiagonal matrix.
3 * =========== DOCUMENTATION ===========
5 * Online html documentation available at
6 * http://www.netlib.org/lapack/explore-html/
9 *> Download SLANGT + dependencies
10 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/slangt.f">
12 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/slangt.f">
14 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/slangt.f">
21 * REAL FUNCTION SLANGT( NORM, N, DL, D, DU )
23 * .. Scalar Arguments ..
27 * .. Array Arguments ..
28 * REAL D( * ), DL( * ), DU( * )
37 *> SLANGT returns the value of the one norm, or the Frobenius norm, or
38 *> the infinity norm, or the element of largest absolute value of a
39 *> real tridiagonal matrix A.
45 *> SLANGT = ( max(abs(A(i,j))), NORM = 'M' or 'm'
47 *> ( norm1(A), NORM = '1', 'O' or 'o'
49 *> ( normI(A), NORM = 'I' or 'i'
51 *> ( normF(A), NORM = 'F', 'f', 'E' or 'e'
53 *> where norm1 denotes the one norm of a matrix (maximum column sum),
54 *> normI denotes the infinity norm of a matrix (maximum row sum) and
55 *> normF denotes the Frobenius norm of a matrix (square root of sum of
56 *> squares). Note that max(abs(A(i,j))) is not a consistent matrix norm.
64 *> NORM is CHARACTER*1
65 *> Specifies the value to be returned in SLANGT as described
72 *> The order of the matrix A. N >= 0. When N = 0, SLANGT is
78 *> DL is REAL array, dimension (N-1)
79 *> The (n-1) sub-diagonal elements of A.
84 *> D is REAL array, dimension (N)
85 *> The diagonal elements of A.
90 *> DU is REAL array, dimension (N-1)
91 *> The (n-1) super-diagonal elements of A.
97 *> \author Univ. of Tennessee
98 *> \author Univ. of California Berkeley
99 *> \author Univ. of Colorado Denver
102 *> \date September 2012
104 *> \ingroup realOTHERauxiliary
106 * =====================================================================
107 REAL FUNCTION SLANGT( NORM, N, DL, D, DU )
109 * -- LAPACK auxiliary routine (version 3.4.2) --
110 * -- LAPACK is a software package provided by Univ. of Tennessee, --
111 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
114 * .. Scalar Arguments ..
118 * .. Array Arguments ..
119 REAL D( * ), DL( * ), DU( * )
122 * =====================================================================
126 PARAMETER ( ONE = 1.0E+0, ZERO = 0.0E+0 )
128 * .. Local Scalars ..
130 REAL ANORM, SCALE, SUM, TEMP
132 * .. External Functions ..
133 LOGICAL LSAME, SISNAN
134 EXTERNAL LSAME, SISNAN
136 * .. External Subroutines ..
139 * .. Intrinsic Functions ..
142 * .. Executable Statements ..
146 ELSE IF( LSAME( NORM, 'M' ) ) THEN
148 * Find max(abs(A(i,j))).
150 ANORM = ABS( D( N ) )
152 IF( ANORM.LT.ABS( DL( I ) ) .OR. SISNAN( ABS( DL( I ) ) ) )
154 IF( ANORM.LT.ABS( D( I ) ) .OR. SISNAN( ABS( D( I ) ) ) )
156 IF( ANORM.LT.ABS( DU( I ) ) .OR. SISNAN (ABS( DU( I ) ) ) )
159 ELSE IF( LSAME( NORM, 'O' ) .OR. NORM.EQ.'1' ) THEN
164 ANORM = ABS( D( 1 ) )
166 ANORM = ABS( D( 1 ) )+ABS( DL( 1 ) )
167 TEMP = ABS( D( N ) )+ABS( DU( N-1 ) )
168 IF( ANORM .LT. TEMP .OR. SISNAN( TEMP ) ) ANORM = TEMP
170 TEMP = ABS( D( I ) )+ABS( DL( I ) )+ABS( DU( I-1 ) )
171 IF( ANORM .LT. TEMP .OR. SISNAN( TEMP ) ) ANORM = TEMP
174 ELSE IF( LSAME( NORM, 'I' ) ) THEN
179 ANORM = ABS( D( 1 ) )
181 ANORM = ABS( D( 1 ) )+ABS( DU( 1 ) )
182 TEMP = ABS( D( N ) )+ABS( DL( N-1 ) )
183 IF( ANORM .LT. TEMP .OR. SISNAN( TEMP ) ) ANORM = TEMP
185 TEMP = ABS( D( I ) )+ABS( DU( I ) )+ABS( DL( I-1 ) )
186 IF( ANORM .LT. TEMP .OR. SISNAN( TEMP ) ) ANORM = TEMP
189 ELSE IF( ( LSAME( NORM, 'F' ) ) .OR. ( LSAME( NORM, 'E' ) ) ) THEN
195 CALL SLASSQ( N, D, 1, SCALE, SUM )
197 CALL SLASSQ( N-1, DL, 1, SCALE, SUM )
198 CALL SLASSQ( N-1, DU, 1, SCALE, SUM )
200 ANORM = SCALE*SQRT( SUM )