LAPACK 3.12.1
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches
dpptrs.f
Go to the documentation of this file.
1*> \brief \b DPPTRS
2*
3* =========== DOCUMENTATION ===========
4*
5* Online html documentation available at
6* http://www.netlib.org/lapack/explore-html/
7*
8*> Download DPPTRS + dependencies
9*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/dpptrs.f">
10*> [TGZ]</a>
11*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/dpptrs.f">
12*> [ZIP]</a>
13*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dpptrs.f">
14*> [TXT]</a>
15*
16* Definition:
17* ===========
18*
19* SUBROUTINE DPPTRS( UPLO, N, NRHS, AP, B, LDB, INFO )
20*
21* .. Scalar Arguments ..
22* CHARACTER UPLO
23* INTEGER INFO, LDB, N, NRHS
24* ..
25* .. Array Arguments ..
26* DOUBLE PRECISION AP( * ), B( LDB, * )
27* ..
28*
29*
30*> \par Purpose:
31* =============
32*>
33*> \verbatim
34*>
35*> DPPTRS solves a system of linear equations A*X = B with a symmetric
36*> positive definite matrix A in packed storage using the Cholesky
37*> factorization A = U**T*U or A = L*L**T computed by DPPTRF.
38*> \endverbatim
39*
40* Arguments:
41* ==========
42*
43*> \param[in] UPLO
44*> \verbatim
45*> UPLO is CHARACTER*1
46*> = 'U': Upper triangle of A is stored;
47*> = 'L': Lower triangle of A is stored.
48*> \endverbatim
49*>
50*> \param[in] N
51*> \verbatim
52*> N is INTEGER
53*> The order of the matrix A. N >= 0.
54*> \endverbatim
55*>
56*> \param[in] NRHS
57*> \verbatim
58*> NRHS is INTEGER
59*> The number of right hand sides, i.e., the number of columns
60*> of the matrix B. NRHS >= 0.
61*> \endverbatim
62*>
63*> \param[in] AP
64*> \verbatim
65*> AP is DOUBLE PRECISION array, dimension (N*(N+1)/2)
66*> The triangular factor U or L from the Cholesky factorization
67*> A = U**T*U or A = L*L**T, packed columnwise in a linear
68*> array. The j-th column of U or L is stored in the array AP
69*> as follows:
70*> if UPLO = 'U', AP(i + (j-1)*j/2) = U(i,j) for 1<=i<=j;
71*> if UPLO = 'L', AP(i + (j-1)*(2n-j)/2) = L(i,j) for j<=i<=n.
72*> \endverbatim
73*>
74*> \param[in,out] B
75*> \verbatim
76*> B is DOUBLE PRECISION array, dimension (LDB,NRHS)
77*> On entry, the right hand side matrix B.
78*> On exit, the solution matrix X.
79*> \endverbatim
80*>
81*> \param[in] LDB
82*> \verbatim
83*> LDB is INTEGER
84*> The leading dimension of the array B. LDB >= max(1,N).
85*> \endverbatim
86*>
87*> \param[out] INFO
88*> \verbatim
89*> INFO is INTEGER
90*> = 0: successful exit
91*> < 0: if INFO = -i, the i-th argument had an illegal value
92*> \endverbatim
93*
94* Authors:
95* ========
96*
97*> \author Univ. of Tennessee
98*> \author Univ. of California Berkeley
99*> \author Univ. of Colorado Denver
100*> \author NAG Ltd.
101*
102*> \ingroup pptrs
103*
104* =====================================================================
105 SUBROUTINE dpptrs( UPLO, N, NRHS, AP, B, LDB, INFO )
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*
198 END
subroutine xerbla(srname, info)
Definition cblat2.f:3285
subroutine dpptrs(uplo, n, nrhs, ap, b, ldb, info)
DPPTRS
Definition dpptrs.f:106
subroutine dtpsv(uplo, trans, diag, n, ap, x, incx)
DTPSV
Definition dtpsv.f:144