LAPACK 3.12.1
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches

◆ spttrs()

subroutine spttrs ( integer n,
integer nrhs,
real, dimension( * ) d,
real, dimension( * ) e,
real, dimension( ldb, * ) b,
integer ldb,
integer info )

SPTTRS

Download SPTTRS + dependencies [TGZ] [ZIP] [TXT]

Purpose:
!>
!> SPTTRS solves a tridiagonal system of the form
!>    A * X = B
!> using the L*D*L**T factorization of A computed by SPTTRF.  D is a
!> diagonal matrix specified in the vector D, L is a unit bidiagonal
!> matrix whose subdiagonal is specified in the vector E, and X and B
!> are N by NRHS matrices.
!> 
Parameters
[in]N
!>          N is INTEGER
!>          The order of the tridiagonal matrix A.  N >= 0.
!> 
[in]NRHS
!>          NRHS is INTEGER
!>          The number of right hand sides, i.e., the number of columns
!>          of the matrix B.  NRHS >= 0.
!> 
[in]D
!>          D is REAL array, dimension (N)
!>          The n diagonal elements of the diagonal matrix D from the
!>          L*D*L**T factorization of A.
!> 
[in]E
!>          E is REAL array, dimension (N-1)
!>          The (n-1) subdiagonal elements of the unit bidiagonal factor
!>          L from the L*D*L**T factorization of A.  E can also be regarded
!>          as the superdiagonal of the unit bidiagonal factor U from the
!>          factorization A = U**T*D*U.
!> 
[in,out]B
!>          B is REAL array, dimension (LDB,NRHS)
!>          On entry, the right hand side vectors B for the system of
!>          linear equations.
!>          On exit, the solution vectors, X.
!> 
[in]LDB
!>          LDB is INTEGER
!>          The leading dimension of the array B.  LDB >= max(1,N).
!> 
[out]INFO
!>          INFO is INTEGER
!>          = 0: successful exit
!>          < 0: if INFO = -k, the k-th argument had an illegal value
!> 
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.

Definition at line 106 of file spttrs.f.

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*
subroutine xerbla(srname, info)
Definition cblat2.f:3285
integer function ilaenv(ispec, name, opts, n1, n2, n3, n4)
ILAENV
Definition ilaenv.f:160
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
Here is the call graph for this function:
Here is the caller graph for this function: