LAPACK 3.12.1
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches
dlanst.f
Go to the documentation of this file.
1*> \brief \b DLANST returns the value of the 1-norm, or the Frobenius norm, or the infinity norm, or the element of largest absolute value of a real symmetric tridiagonal matrix.
2*
3* =========== DOCUMENTATION ===========
4*
5* Online html documentation available at
6* http://www.netlib.org/lapack/explore-html/
7*
8*> Download DLANST + dependencies
9*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/dlanst.f">
10*> [TGZ]</a>
11*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/dlanst.f">
12*> [ZIP]</a>
13*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dlanst.f">
14*> [TXT]</a>
15*
16* Definition:
17* ===========
18*
19* DOUBLE PRECISION FUNCTION DLANST( NORM, N, D, E )
20*
21* .. Scalar Arguments ..
22* CHARACTER NORM
23* INTEGER N
24* ..
25* .. Array Arguments ..
26* DOUBLE PRECISION D( * ), E( * )
27* ..
28*
29*
30*> \par Purpose:
31* =============
32*>
33*> \verbatim
34*>
35*> DLANST returns the value of the one norm, or the Frobenius norm, or
36*> the infinity norm, or the element of largest absolute value of a
37*> real symmetric tridiagonal matrix A.
38*> \endverbatim
39*>
40*> \return DLANST
41*> \verbatim
42*>
43*> DLANST = ( max(abs(A(i,j))), NORM = 'M' or 'm'
44*> (
45*> ( norm1(A), NORM = '1', 'O' or 'o'
46*> (
47*> ( normI(A), NORM = 'I' or 'i'
48*> (
49*> ( normF(A), NORM = 'F', 'f', 'E' or 'e'
50*>
51*> where norm1 denotes the one norm of a matrix (maximum column sum),
52*> normI denotes the infinity norm of a matrix (maximum row sum) and
53*> normF denotes the Frobenius norm of a matrix (square root of sum of
54*> squares). Note that max(abs(A(i,j))) is not a consistent matrix norm.
55*> \endverbatim
56*
57* Arguments:
58* ==========
59*
60*> \param[in] NORM
61*> \verbatim
62*> NORM is CHARACTER*1
63*> Specifies the value to be returned in DLANST as described
64*> above.
65*> \endverbatim
66*>
67*> \param[in] N
68*> \verbatim
69*> N is INTEGER
70*> The order of the matrix A. N >= 0. When N = 0, DLANST is
71*> set to zero.
72*> \endverbatim
73*>
74*> \param[in] D
75*> \verbatim
76*> D is DOUBLE PRECISION array, dimension (N)
77*> The diagonal elements of A.
78*> \endverbatim
79*>
80*> \param[in] E
81*> \verbatim
82*> E is DOUBLE PRECISION array, dimension (N-1)
83*> The (n-1) sub-diagonal or super-diagonal elements of A.
84*> \endverbatim
85*
86* Authors:
87* ========
88*
89*> \author Univ. of Tennessee
90*> \author Univ. of California Berkeley
91*> \author Univ. of Colorado Denver
92*> \author NAG Ltd.
93*
94*> \ingroup lanht
95*
96* =====================================================================
97 DOUBLE PRECISION FUNCTION dlanst( NORM, N, D, E )
98*
99* -- LAPACK auxiliary routine --
100* -- LAPACK is a software package provided by Univ. of Tennessee, --
101* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
102*
103* .. Scalar Arguments ..
104 CHARACTER norm
105 INTEGER n
106* ..
107* .. Array Arguments ..
108 DOUBLE PRECISION d( * ), e( * )
109* ..
110*
111* =====================================================================
112*
113* .. Parameters ..
114 DOUBLE PRECISION one, zero
115 parameter( one = 1.0d+0, zero = 0.0d+0 )
116* ..
117* .. Local Scalars ..
118 INTEGER i
119 DOUBLE PRECISION anorm, scale, sum
120* ..
121* .. External Functions ..
122 LOGICAL lsame, disnan
123 EXTERNAL lsame, disnan
124* ..
125* .. External Subroutines ..
126 EXTERNAL dlassq
127* ..
128* .. Intrinsic Functions ..
129 INTRINSIC abs, sqrt
130* ..
131* .. Executable Statements ..
132*
133 IF( n.LE.0 ) THEN
134 anorm = zero
135 ELSE IF( lsame( norm, 'M' ) ) THEN
136*
137* Find max(abs(A(i,j))).
138*
139 anorm = abs( d( n ) )
140 DO 10 i = 1, n - 1
141 sum = abs( d( i ) )
142 IF( anorm .LT. sum .OR. disnan( sum ) ) anorm = sum
143 sum = abs( e( i ) )
144 IF( anorm .LT. sum .OR. disnan( sum ) ) anorm = sum
145 10 CONTINUE
146 ELSE IF( lsame( norm, 'O' ) .OR. norm.EQ.'1' .OR.
147 $ lsame( norm, 'I' ) ) THEN
148*
149* Find norm1(A).
150*
151 IF( n.EQ.1 ) THEN
152 anorm = abs( d( 1 ) )
153 ELSE
154 anorm = abs( d( 1 ) )+abs( e( 1 ) )
155 sum = abs( e( n-1 ) )+abs( d( n ) )
156 IF( anorm .LT. sum .OR. disnan( sum ) ) anorm = sum
157 DO 20 i = 2, n - 1
158 sum = abs( d( i ) )+abs( e( i ) )+abs( e( i-1 ) )
159 IF( anorm .LT. sum .OR. disnan( sum ) ) anorm = sum
160 20 CONTINUE
161 END IF
162 ELSE IF( ( lsame( norm, 'F' ) ) .OR.
163 $ ( lsame( norm, 'E' ) ) ) THEN
164*
165* Find normF(A).
166*
167 scale = zero
168 sum = one
169 IF( n.GT.1 ) THEN
170 CALL dlassq( n-1, e, 1, scale, sum )
171 sum = 2*sum
172 END IF
173 CALL dlassq( n, d, 1, scale, sum )
174 anorm = scale*sqrt( sum )
175 END IF
176*
177 dlanst = anorm
178 RETURN
179*
180* End of DLANST
181*
182 END
logical function disnan(din)
DISNAN tests input for NaN.
Definition disnan.f:57
double precision function dlanst(norm, n, d, e)
DLANST returns the value of the 1-norm, or the Frobenius norm, or the infinity norm,...
Definition dlanst.f:98
subroutine dlassq(n, x, incx, scale, sumsq)
DLASSQ updates a sum of squares represented in scaled form.
Definition dlassq.f90:122
logical function lsame(ca, cb)
LSAME
Definition lsame.f:48