LAPACK 3.12.1
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches
zpptrs.f
Go to the documentation of this file.
1*> \brief \b ZPPTRS
2*
3* =========== DOCUMENTATION ===========
4*
5* Online html documentation available at
6* http://www.netlib.org/lapack/explore-html/
7*
8*> Download ZPPTRS + dependencies
9*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/zpptrs.f">
10*> [TGZ]</a>
11*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/zpptrs.f">
12*> [ZIP]</a>
13*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zpptrs.f">
14*> [TXT]</a>
15*
16* Definition:
17* ===========
18*
19* SUBROUTINE ZPPTRS( 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* COMPLEX*16 AP( * ), B( LDB, * )
27* ..
28*
29*
30*> \par Purpose:
31* =============
32*>
33*> \verbatim
34*>
35*> ZPPTRS solves a system of linear equations A*X = B with a Hermitian
36*> positive definite matrix A in packed storage using the Cholesky
37*> factorization A = U**H * U or A = L * L**H computed by ZPPTRF.
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 COMPLEX*16 array, dimension (N*(N+1)/2)
66*> The triangular factor U or L from the Cholesky factorization
67*> A = U**H * U or A = L * L**H, 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 COMPLEX*16 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 zpptrs( 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 COMPLEX*16 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 xerbla, ztpsv
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( 'ZPPTRS', -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**H * U.
163*
164 DO 10 i = 1, nrhs
165*
166* Solve U**H *X = B, overwriting B with X.
167*
168 CALL ztpsv( 'Upper', 'Conjugate transpose', 'Non-unit',
169 $ n,
170 $ ap, b( 1, i ), 1 )
171*
172* Solve U*X = B, overwriting B with X.
173*
174 CALL ztpsv( 'Upper', 'No transpose', 'Non-unit', n, ap,
175 $ b( 1, i ), 1 )
176 10 CONTINUE
177 ELSE
178*
179* Solve A*X = B where A = L * L**H.
180*
181 DO 20 i = 1, nrhs
182*
183* Solve L*Y = B, overwriting B with X.
184*
185 CALL ztpsv( 'Lower', 'No transpose', 'Non-unit', n, ap,
186 $ b( 1, i ), 1 )
187*
188* Solve L**H *X = Y, overwriting B with X.
189*
190 CALL ztpsv( 'Lower', 'Conjugate transpose', 'Non-unit',
191 $ n,
192 $ ap, b( 1, i ), 1 )
193 20 CONTINUE
194 END IF
195*
196 RETURN
197*
198* End of ZPPTRS
199*
200 END
subroutine xerbla(srname, info)
Definition cblat2.f:3285
subroutine zpptrs(uplo, n, nrhs, ap, b, ldb, info)
ZPPTRS
Definition zpptrs.f:106
subroutine ztpsv(uplo, trans, diag, n, ap, x, incx)
ZTPSV
Definition ztpsv.f:144