LAPACK  3.9.0 LAPACK: Linear Algebra PACKage

## ◆ cpotrs()

 subroutine cpotrs ( character UPLO, integer N, integer NRHS, complex, dimension( lda, * ) A, integer LDA, complex, dimension( ldb, * ) B, integer LDB, integer INFO )

CPOTRS

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```
Date
December 2016

Definition at line 112 of file cpotrs.f.

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