LAPACK 3.12.1
LAPACK: Linear Algebra PACKage
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages

◆ zpptrs()

subroutine zpptrs ( character uplo,
integer n,
integer nrhs,
complex*16, dimension( * ) ap,
complex*16, dimension( ldb, * ) b,
integer ldb,
integer info )

ZPPTRS

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

Purpose:
!> !> ZPPTRS solves a system of linear equations A*X = B with a Hermitian !> positive definite matrix A in packed storage using the Cholesky !> factorization A = U**H * U or A = L * L**H computed by ZPPTRF. !>
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 COMPLEX*16 array, dimension (N*(N+1)/2) !> The triangular factor U or L from the Cholesky factorization !> A = U**H * U or A = L * L**H, 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 COMPLEX*16 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 zpptrs.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 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*
subroutine xerbla(srname, info)
Definition cblat2.f:3285
logical function lsame(ca, cb)
LSAME
Definition lsame.f:48
subroutine ztpsv(uplo, trans, diag, n, ap, x, incx)
ZTPSV
Definition ztpsv.f:144
Here is the call graph for this function:
Here is the caller graph for this function: