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

◆ zpotrs()

subroutine zpotrs ( character uplo,
integer n,
integer nrhs,
complex*16, dimension( lda, * ) a,
integer lda,
complex*16, dimension( ldb, * ) b,
integer ldb,
integer info )

ZPOTRS

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

Purpose:
!> !> ZPOTRS solves a system of linear equations A*X = B with a Hermitian !> positive definite matrix A using the Cholesky factorization !> A = U**H * U or A = L * L**H computed by ZPOTRF. !>
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]A
!> A is COMPLEX*16 array, dimension (LDA,N) !> The triangular factor U or L from the Cholesky factorization !> A = U**H * U or A = L * L**H, as computed by ZPOTRF. !>
[in]LDA
!> LDA is INTEGER !> The leading dimension of the array A. LDA >= max(1,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 107 of file zpotrs.f.

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