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

◆ dpptrs()

subroutine dpptrs ( character uplo,
integer n,
integer nrhs,
double precision, dimension( * ) ap,
double precision, dimension( ldb, * ) b,
integer ldb,
integer info )

DPPTRS

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

Purpose:
!>
!> DPPTRS solves a system of linear equations A*X = B with a symmetric
!> positive definite matrix A in packed storage using the Cholesky
!> factorization A = U**T*U or A = L*L**T computed by DPPTRF.
!> 
Parameters
[in]UPLO
!>          UPLO is CHARACTER*1
!>          = 'U':  Upper triangle of A is stored;
!>          = 'L':  Lower triangle of A is stored.
!> 
[in]N
!>          N is INTEGER
!>          The order of the 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]AP
!>          AP is DOUBLE PRECISION array, dimension (N*(N+1)/2)
!>          The triangular factor U or L from the Cholesky factorization
!>          A = U**T*U or A = L*L**T, packed columnwise in a linear
!>          array.  The j-th column of U or L is stored in the array AP
!>          as follows:
!>          if UPLO = 'U', AP(i + (j-1)*j/2) = U(i,j) for 1<=i<=j;
!>          if UPLO = 'L', AP(i + (j-1)*(2n-j)/2) = L(i,j) for j<=i<=n.
!> 
[in,out]B
!>          B is DOUBLE PRECISION array, dimension (LDB,NRHS)
!>          On entry, the right hand side matrix B.
!>          On exit, the solution matrix 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 = -i, the i-th argument had an illegal value
!> 
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.

Definition at line 105 of file dpptrs.f.

106*
107* -- LAPACK computational routine --
108* -- LAPACK is a software package provided by Univ. of Tennessee, --
109* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
110*
111* .. Scalar Arguments ..
112 CHARACTER UPLO
113 INTEGER INFO, LDB, N, NRHS
114* ..
115* .. Array Arguments ..
116 DOUBLE PRECISION AP( * ), B( LDB, * )
117* ..
118*
119* =====================================================================
120*
121* .. Local Scalars ..
122 LOGICAL UPPER
123 INTEGER I
124* ..
125* .. External Functions ..
126 LOGICAL LSAME
127 EXTERNAL lsame
128* ..
129* .. External Subroutines ..
130 EXTERNAL dtpsv, xerbla
131* ..
132* .. Intrinsic Functions ..
133 INTRINSIC max
134* ..
135* .. Executable Statements ..
136*
137* Test the input parameters.
138*
139 info = 0
140 upper = lsame( uplo, 'U' )
141 IF( .NOT.upper .AND. .NOT.lsame( uplo, 'L' ) ) THEN
142 info = -1
143 ELSE IF( n.LT.0 ) THEN
144 info = -2
145 ELSE IF( nrhs.LT.0 ) THEN
146 info = -3
147 ELSE IF( ldb.LT.max( 1, n ) ) THEN
148 info = -6
149 END IF
150 IF( info.NE.0 ) THEN
151 CALL xerbla( 'DPPTRS', -info )
152 RETURN
153 END IF
154*
155* Quick return if possible
156*
157 IF( n.EQ.0 .OR. nrhs.EQ.0 )
158 $ RETURN
159*
160 IF( upper ) THEN
161*
162* Solve A*X = B where A = U**T * U.
163*
164 DO 10 i = 1, nrhs
165*
166* Solve U**T *X = B, overwriting B with X.
167*
168 CALL dtpsv( 'Upper', 'Transpose', 'Non-unit', n, ap,
169 $ b( 1, i ), 1 )
170*
171* Solve U*X = B, overwriting B with X.
172*
173 CALL dtpsv( 'Upper', 'No transpose', 'Non-unit', n, ap,
174 $ b( 1, i ), 1 )
175 10 CONTINUE
176 ELSE
177*
178* Solve A*X = B where A = L * L**T.
179*
180 DO 20 i = 1, nrhs
181*
182* Solve L*Y = B, overwriting B with X.
183*
184 CALL dtpsv( 'Lower', 'No transpose', 'Non-unit', n, ap,
185 $ b( 1, i ), 1 )
186*
187* Solve L**T *X = Y, overwriting B with X.
188*
189 CALL dtpsv( 'Lower', 'Transpose', 'Non-unit', n, ap,
190 $ b( 1, i ), 1 )
191 20 CONTINUE
192 END IF
193*
194 RETURN
195*
196* End of DPPTRS
197*
subroutine xerbla(srname, info)
Definition cblat2.f:3285
logical function lsame(ca, cb)
LSAME
Definition lsame.f:48
subroutine dtpsv(uplo, trans, diag, n, ap, x, incx)
DTPSV
Definition dtpsv.f:144
Here is the call graph for this function:
Here is the caller graph for this function: