LAPACK 3.12.1
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches
dlangt.f
Go to the documentation of this file.
1*> \brief \b DLANGT returns the value of the 1-norm, Frobenius norm, infinity-norm, or the largest absolute value of any element of a general tridiagonal matrix.
2*
3* =========== DOCUMENTATION ===========
4*
5* Online html documentation available at
6* http://www.netlib.org/lapack/explore-html/
7*
8*> Download DLANGT + dependencies
9*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/dlangt.f">
10*> [TGZ]</a>
11*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/dlangt.f">
12*> [ZIP]</a>
13*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dlangt.f">
14*> [TXT]</a>
15*
16* Definition:
17* ===========
18*
19* DOUBLE PRECISION FUNCTION DLANGT( NORM, N, DL, D, DU )
20*
21* .. Scalar Arguments ..
22* CHARACTER NORM
23* INTEGER N
24* ..
25* .. Array Arguments ..
26* DOUBLE PRECISION D( * ), DL( * ), DU( * )
27* ..
28*
29*
30*> \par Purpose:
31* =============
32*>
33*> \verbatim
34*>
35*> DLANGT 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 tridiagonal matrix A.
38*> \endverbatim
39*>
40*> \return DLANGT
41*> \verbatim
42*>
43*> DLANGT = ( 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 DLANGT 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, DLANGT is
71*> set to zero.
72*> \endverbatim
73*>
74*> \param[in] DL
75*> \verbatim
76*> DL is DOUBLE PRECISION array, dimension (N-1)
77*> The (n-1) sub-diagonal elements of A.
78*> \endverbatim
79*>
80*> \param[in] D
81*> \verbatim
82*> D is DOUBLE PRECISION array, dimension (N)
83*> The diagonal elements of A.
84*> \endverbatim
85*>
86*> \param[in] DU
87*> \verbatim
88*> DU is DOUBLE PRECISION array, dimension (N-1)
89*> The (n-1) super-diagonal elements of A.
90*> \endverbatim
91*
92* Authors:
93* ========
94*
95*> \author Univ. of Tennessee
96*> \author Univ. of California Berkeley
97*> \author Univ. of Colorado Denver
98*> \author NAG Ltd.
99*
100*> \ingroup langt
101*
102* =====================================================================
103 DOUBLE PRECISION FUNCTION dlangt( NORM, N, DL, D, DU )
104*
105* -- LAPACK auxiliary routine --
106* -- LAPACK is a software package provided by Univ. of Tennessee, --
107* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
108*
109* .. Scalar Arguments ..
110 CHARACTER norm
111 INTEGER n
112* ..
113* .. Array Arguments ..
114 DOUBLE PRECISION d( * ), dl( * ), du( * )
115* ..
116*
117* =====================================================================
118*
119* .. Parameters ..
120 DOUBLE PRECISION one, zero
121 parameter( one = 1.0d+0, zero = 0.0d+0 )
122* ..
123* .. Local Scalars ..
124 INTEGER i
125 DOUBLE PRECISION anorm, scale, sum, temp
126* ..
127* .. External Functions ..
128 LOGICAL lsame, disnan
129 EXTERNAL lsame, disnan
130* ..
131* .. External Subroutines ..
132 EXTERNAL dlassq
133* ..
134* .. Intrinsic Functions ..
135 INTRINSIC abs, sqrt
136* ..
137* .. Executable Statements ..
138*
139 IF( n.LE.0 ) THEN
140 anorm = zero
141 ELSE IF( lsame( norm, 'M' ) ) THEN
142*
143* Find max(abs(A(i,j))).
144*
145 anorm = abs( d( n ) )
146 DO 10 i = 1, n - 1
147 IF( anorm.LT.abs( dl( i ) ) .OR.
148 $ disnan( abs( dl( i ) ) ) )
149 $ anorm = abs(dl(i))
150 IF( anorm.LT.abs( d( i ) ) .OR. disnan( abs( d( i ) ) ) )
151 $ anorm = abs(d(i))
152 IF( anorm.LT.abs( du( i ) ) .OR.
153 $ disnan(abs( du( i ) ) ) )
154 $ anorm = abs(du(i))
155 10 CONTINUE
156 ELSE IF( lsame( norm, 'O' ) .OR. norm.EQ.'1' ) THEN
157*
158* Find norm1(A).
159*
160 IF( n.EQ.1 ) THEN
161 anorm = abs( d( 1 ) )
162 ELSE
163 anorm = abs( d( 1 ) )+abs( dl( 1 ) )
164 temp = abs( d( n ) )+abs( du( n-1 ) )
165 IF( anorm .LT. temp .OR. disnan( temp ) ) anorm = temp
166 DO 20 i = 2, n - 1
167 temp = abs( d( i ) )+abs( dl( i ) )+abs( du( i-1 ) )
168 IF( anorm .LT. temp .OR. disnan( temp ) ) anorm = temp
169 20 CONTINUE
170 END IF
171 ELSE IF( lsame( norm, 'I' ) ) THEN
172*
173* Find normI(A).
174*
175 IF( n.EQ.1 ) THEN
176 anorm = abs( d( 1 ) )
177 ELSE
178 anorm = abs( d( 1 ) )+abs( du( 1 ) )
179 temp = abs( d( n ) )+abs( dl( n-1 ) )
180 IF( anorm .LT. temp .OR. disnan( temp ) ) anorm = temp
181 DO 30 i = 2, n - 1
182 temp = abs( d( i ) )+abs( du( i ) )+abs( dl( i-1 ) )
183 IF( anorm .LT. temp .OR. disnan( temp ) ) anorm = temp
184 30 CONTINUE
185 END IF
186 ELSE IF( ( lsame( norm, 'F' ) ) .OR.
187 $ ( lsame( norm, 'E' ) ) ) THEN
188*
189* Find normF(A).
190*
191 scale = zero
192 sum = one
193 CALL dlassq( n, d, 1, scale, sum )
194 IF( n.GT.1 ) THEN
195 CALL dlassq( n-1, dl, 1, scale, sum )
196 CALL dlassq( n-1, du, 1, scale, sum )
197 END IF
198 anorm = scale*sqrt( sum )
199 END IF
200*
201 dlangt = anorm
202 RETURN
203*
204* End of DLANGT
205*
206 END
logical function disnan(din)
DISNAN tests input for NaN.
Definition disnan.f:57
double precision function dlangt(norm, n, dl, d, du)
DLANGT returns the value of the 1-norm, Frobenius norm, infinity-norm, or the largest absolute value ...
Definition dlangt.f:104
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