3 * =========== DOCUMENTATION ===========
5 * Online html documentation available at
6 * http://www.netlib.org/lapack/explore-html/
9 *> Download CPOTRS + dependencies
10 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/cpotrs.f">
12 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/cpotrs.f">
14 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/cpotrs.f">
21 * SUBROUTINE CPOTRS( UPLO, N, NRHS, A, LDA, B, LDB, INFO )
23 * .. Scalar Arguments ..
25 * INTEGER INFO, LDA, LDB, N, NRHS
27 * .. Array Arguments ..
28 * COMPLEX A( LDA, * ), B( LDB, * )
37 *> CPOTRS solves a system of linear equations A*X = B with a Hermitian
38 *> positive definite matrix A using the Cholesky factorization
39 *> A = U**H*U or A = L*L**H computed by CPOTRF.
47 *> UPLO is CHARACTER*1
48 *> = 'U': Upper triangle of A is stored;
49 *> = 'L': Lower triangle of A is stored.
55 *> The order of the matrix A. N >= 0.
61 *> The number of right hand sides, i.e., the number of columns
62 *> of the matrix B. NRHS >= 0.
67 *> A is COMPLEX array, dimension (LDA,N)
68 *> The triangular factor U or L from the Cholesky factorization
69 *> A = U**H*U or A = L*L**H, as computed by CPOTRF.
75 *> The leading dimension of the array A. LDA >= max(1,N).
80 *> B is COMPLEX array, dimension (LDB,NRHS)
81 *> On entry, the right hand side matrix B.
82 *> On exit, the solution matrix X.
88 *> The leading dimension of the array B. LDB >= max(1,N).
94 *> = 0: successful exit
95 *> < 0: if INFO = -i, the i-th argument had an illegal value
101 *> \author Univ. of Tennessee
102 *> \author Univ. of California Berkeley
103 *> \author Univ. of Colorado Denver
106 *> \date November 2011
108 *> \ingroup complexPOcomputational
110 * =====================================================================
111 SUBROUTINE CPOTRS( UPLO, N, NRHS, A, LDA, B, LDB, INFO )
113 * -- LAPACK computational routine (version 3.4.0) --
114 * -- LAPACK is a software package provided by Univ. of Tennessee, --
115 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
118 * .. Scalar Arguments ..
120 INTEGER INFO, LDA, LDB, N, NRHS
122 * .. Array Arguments ..
123 COMPLEX A( LDA, * ), B( LDB, * )
126 * =====================================================================
130 PARAMETER ( ONE = ( 1.0E+0, 0.0E+0 ) )
132 * .. Local Scalars ..
135 * .. External Functions ..
139 * .. External Subroutines ..
140 EXTERNAL CTRSM, XERBLA
142 * .. Intrinsic Functions ..
145 * .. Executable Statements ..
147 * Test the input parameters.
150 UPPER = LSAME( UPLO, 'U' )
151 IF( .NOT.UPPER .AND. .NOT.LSAME( UPLO, 'L' ) ) THEN
153 ELSE IF( N.LT.0 ) THEN
155 ELSE IF( NRHS.LT.0 ) THEN
157 ELSE IF( LDA.LT.MAX( 1, N ) ) THEN
159 ELSE IF( LDB.LT.MAX( 1, N ) ) THEN
163 CALL XERBLA( 'CPOTRS', -INFO )
167 * Quick return if possible
169 IF( N.EQ.0 .OR. NRHS.EQ.0 )
174 * Solve A*X = B where A = U**H *U.
176 * Solve U**H *X = B, overwriting B with X.
178 CALL CTRSM( 'Left', 'Upper', 'Conjugate transpose', 'Non-unit',
179 $ N, NRHS, ONE, A, LDA, B, LDB )
181 * Solve U*X = B, overwriting B with X.
183 CALL CTRSM( 'Left', 'Upper', 'No transpose', 'Non-unit', N,
184 $ NRHS, ONE, A, LDA, B, LDB )
187 * Solve A*X = B where A = L*L**H.
189 * Solve L*X = B, overwriting B with X.
191 CALL CTRSM( 'Left', 'Lower', 'No transpose', 'Non-unit', N,
192 $ NRHS, ONE, A, LDA, B, LDB )
194 * Solve L**H *X = B, overwriting B with X.
196 CALL CTRSM( 'Left', 'Lower', 'Conjugate transpose', 'Non-unit',
197 $ N, NRHS, ONE, A, LDA, B, LDB )