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

◆ cpotrs()

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

CPOTRS

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

Purpose:
!>
!> CPOTRS 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 CPOTRF.
!> 
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 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 CPOTRF.
!> 
[in]LDA
!>          LDA is INTEGER
!>          The leading dimension of the array A.  LDA >= max(1,N).
!> 
[in,out]B
!>          B is COMPLEX 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 cpotrs.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 A( LDA, * ), B( LDB, * )
119* ..
120*
121* =====================================================================
122*
123* .. Parameters ..
124 COMPLEX ONE
125 parameter( one = ( 1.0e+0, 0.0e+0 ) )
126* ..
127* .. Local Scalars ..
128 LOGICAL UPPER
129* ..
130* .. External Functions ..
131 LOGICAL LSAME
132 EXTERNAL lsame
133* ..
134* .. External Subroutines ..
135 EXTERNAL ctrsm, xerbla
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( 'CPOTRS', -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 ctrsm( '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 ctrsm( '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 ctrsm( '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 ctrsm( '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 CPOTRS
200*
subroutine xerbla(srname, info)
Definition cblat2.f:3285
logical function lsame(ca, cb)
LSAME
Definition lsame.f:48
subroutine ctrsm(side, uplo, transa, diag, m, n, alpha, a, lda, b, ldb)
CTRSM
Definition ctrsm.f:180
Here is the call graph for this function:
Here is the caller graph for this function: