LAPACK 3.12.1
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches
spttrs.f
Go to the documentation of this file.
1*> \brief \b SPTTRS
2*
3* =========== DOCUMENTATION ===========
4*
5* Online html documentation available at
6* http://www.netlib.org/lapack/explore-html/
7*
8*> Download SPTTRS + dependencies
9*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/spttrs.f">
10*> [TGZ]</a>
11*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/spttrs.f">
12*> [ZIP]</a>
13*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/spttrs.f">
14*> [TXT]</a>
15*
16* Definition:
17* ===========
18*
19* SUBROUTINE SPTTRS( N, NRHS, D, E, B, LDB, INFO )
20*
21* .. Scalar Arguments ..
22* INTEGER INFO, LDB, N, NRHS
23* ..
24* .. Array Arguments ..
25* REAL B( LDB, * ), D( * ), E( * )
26* ..
27*
28*
29*> \par Purpose:
30* =============
31*>
32*> \verbatim
33*>
34*> SPTTRS solves a tridiagonal system of the form
35*> A * X = B
36*> using the L*D*L**T factorization of A computed by SPTTRF. D is a
37*> diagonal matrix specified in the vector D, L is a unit bidiagonal
38*> matrix whose subdiagonal is specified in the vector E, and X and B
39*> are N by NRHS matrices.
40*> \endverbatim
41*
42* Arguments:
43* ==========
44*
45*> \param[in] N
46*> \verbatim
47*> N is INTEGER
48*> The order of the tridiagonal matrix A. N >= 0.
49*> \endverbatim
50*>
51*> \param[in] NRHS
52*> \verbatim
53*> NRHS is INTEGER
54*> The number of right hand sides, i.e., the number of columns
55*> of the matrix B. NRHS >= 0.
56*> \endverbatim
57*>
58*> \param[in] D
59*> \verbatim
60*> D is REAL array, dimension (N)
61*> The n diagonal elements of the diagonal matrix D from the
62*> L*D*L**T factorization of A.
63*> \endverbatim
64*>
65*> \param[in] E
66*> \verbatim
67*> E is REAL array, dimension (N-1)
68*> The (n-1) subdiagonal elements of the unit bidiagonal factor
69*> L from the L*D*L**T factorization of A. E can also be regarded
70*> as the superdiagonal of the unit bidiagonal factor U from the
71*> factorization A = U**T*D*U.
72*> \endverbatim
73*>
74*> \param[in,out] B
75*> \verbatim
76*> B is REAL array, dimension (LDB,NRHS)
77*> On entry, the right hand side vectors B for the system of
78*> linear equations.
79*> On exit, the solution vectors, X.
80*> \endverbatim
81*>
82*> \param[in] LDB
83*> \verbatim
84*> LDB is INTEGER
85*> The leading dimension of the array B. LDB >= max(1,N).
86*> \endverbatim
87*>
88*> \param[out] INFO
89*> \verbatim
90*> INFO is INTEGER
91*> = 0: successful exit
92*> < 0: if INFO = -k, the k-th argument had an illegal value
93*> \endverbatim
94*
95* Authors:
96* ========
97*
98*> \author Univ. of Tennessee
99*> \author Univ. of California Berkeley
100*> \author Univ. of Colorado Denver
101*> \author NAG Ltd.
102*
103*> \ingroup pttrs
104*
105* =====================================================================
106 SUBROUTINE spttrs( N, NRHS, D, E, B, LDB, INFO )
107*
108* -- LAPACK computational routine --
109* -- LAPACK is a software package provided by Univ. of Tennessee, --
110* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
111*
112* .. Scalar Arguments ..
113 INTEGER INFO, LDB, N, NRHS
114* ..
115* .. Array Arguments ..
116 REAL B( LDB, * ), D( * ), E( * )
117* ..
118*
119* =====================================================================
120*
121* .. Local Scalars ..
122 INTEGER J, JB, NB
123* ..
124* .. External Functions ..
125 INTEGER ILAENV
126 EXTERNAL ilaenv
127* ..
128* .. External Subroutines ..
129 EXTERNAL sptts2, xerbla
130* ..
131* .. Intrinsic Functions ..
132 INTRINSIC max, min
133* ..
134* .. Executable Statements ..
135*
136* Test the input arguments.
137*
138 info = 0
139 IF( n.LT.0 ) THEN
140 info = -1
141 ELSE IF( nrhs.LT.0 ) THEN
142 info = -2
143 ELSE IF( ldb.LT.max( 1, n ) ) THEN
144 info = -6
145 END IF
146 IF( info.NE.0 ) THEN
147 CALL xerbla( 'SPTTRS', -info )
148 RETURN
149 END IF
150*
151* Quick return if possible
152*
153 IF( n.EQ.0 .OR. nrhs.EQ.0 )
154 $ RETURN
155*
156* Determine the number of right-hand sides to solve at a time.
157*
158 IF( nrhs.EQ.1 ) THEN
159 nb = 1
160 ELSE
161 nb = max( 1, ilaenv( 1, 'SPTTRS', ' ', n, nrhs, -1, -1 ) )
162 END IF
163*
164 IF( nb.GE.nrhs ) THEN
165 CALL sptts2( n, nrhs, d, e, b, ldb )
166 ELSE
167 DO 10 j = 1, nrhs, nb
168 jb = min( nrhs-j+1, nb )
169 CALL sptts2( n, jb, d, e, b( 1, j ), ldb )
170 10 CONTINUE
171 END IF
172*
173 RETURN
174*
175* End of SPTTRS
176*
177 END
subroutine xerbla(srname, info)
Definition cblat2.f:3285
subroutine spttrs(n, nrhs, d, e, b, ldb, info)
SPTTRS
Definition spttrs.f:107
subroutine sptts2(n, nrhs, d, e, b, ldb)
SPTTS2 solves a tridiagonal system of the form AX=B using the L D LH factorization computed by spttrf...
Definition sptts2.f:100