3 * =========== DOCUMENTATION ===========
5 * Online html documentation available at
6 * http://www.netlib.org/lapack/explore-html/
9 *> Download CPOTRF + dependencies
10 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/cpotrf.f">
12 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/cpotrf.f">
14 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/cpotrf.f">
21 * SUBROUTINE CPOTRF( UPLO, N, A, LDA, INFO )
23 * .. Scalar Arguments ..
25 * INTEGER INFO, LDA, N
27 * .. Array Arguments ..
37 *> CPOTRF computes the Cholesky factorization of a complex Hermitian
38 *> positive definite matrix A.
40 *> The factorization has the form
41 *> A = U**H * U, if UPLO = 'U', or
42 *> A = L * L**H, if UPLO = 'L',
43 *> where U is an upper triangular matrix and L is lower triangular.
45 *> This is the block version of the algorithm, calling Level 3 BLAS.
53 *> UPLO is CHARACTER*1
54 *> = 'U': Upper triangle of A is stored;
55 *> = 'L': Lower triangle of A is stored.
61 *> The order of the matrix A. N >= 0.
66 *> A is COMPLEX array, dimension (LDA,N)
67 *> On entry, the Hermitian matrix A. If UPLO = 'U', the leading
68 *> N-by-N upper triangular part of A contains the upper
69 *> triangular part of the matrix A, and the strictly lower
70 *> triangular part of A is not referenced. If UPLO = 'L', the
71 *> leading N-by-N lower triangular part of A contains the lower
72 *> triangular part of the matrix A, and the strictly upper
73 *> triangular part of A is not referenced.
75 *> On exit, if INFO = 0, the factor U or L from the Cholesky
76 *> factorization A = U**H*U or A = L*L**H.
82 *> The leading dimension of the array A. LDA >= max(1,N).
88 *> = 0: successful exit
89 *> < 0: if INFO = -i, the i-th argument had an illegal value
90 *> > 0: if INFO = i, the leading minor of order i is not
91 *> positive definite, and the factorization could not be
98 *> \author Univ. of Tennessee
99 *> \author Univ. of California Berkeley
100 *> \author Univ. of Colorado Denver
103 *> \date November 2015
105 *> \ingroup complexPOcomputational
107 * =====================================================================
108 SUBROUTINE CPOTRF( UPLO, N, A, LDA, INFO )
110 * -- LAPACK computational routine (version 3.6.0) --
111 * -- LAPACK is a software package provided by Univ. of Tennessee, --
112 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
115 * .. Scalar Arguments ..
119 * .. Array Arguments ..
123 * =====================================================================
128 PARAMETER ( ONE = 1.0E+0, CONE = ( 1.0E+0, 0.0E+0 ) )
130 * .. Local Scalars ..
134 * .. External Functions ..
137 EXTERNAL LSAME, ILAENV
139 * .. External Subroutines ..
140 EXTERNAL CGEMM, CHERK, CPOTRF2, 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( LDA.LT.MAX( 1, N ) ) THEN
159 CALL XERBLA( 'CPOTRF', -INFO )
163 * Quick return if possible
168 * Determine the block size for this environment.
170 NB = ILAENV( 1, 'CPOTRF', UPLO, N, -1, -1, -1 )
171 IF( NB.LE.1 .OR. NB.GE.N ) THEN
173 * Use unblocked code.
175 CALL CPOTRF2( UPLO, N, A, LDA, INFO )
182 * Compute the Cholesky factorization A = U**H *U.
186 * Update and factorize the current diagonal block and test
187 * for non-positive-definiteness.
189 JB = MIN( NB, N-J+1 )
190 CALL CHERK( 'Upper', 'Conjugate transpose', JB, J-1,
191 $ -ONE, A( 1, J ), LDA, ONE, A( J, J ), LDA )
192 CALL CPOTRF2( 'Upper', JB, A( J, J ), LDA, INFO )
197 * Compute the current block row.
199 CALL CGEMM( 'Conjugate transpose', 'No transpose', JB,
200 $ N-J-JB+1, J-1, -CONE, A( 1, J ), LDA,
201 $ A( 1, J+JB ), LDA, CONE, A( J, J+JB ),
203 CALL CTRSM( 'Left', 'Upper', 'Conjugate transpose',
204 $ 'Non-unit', JB, N-J-JB+1, CONE, A( J, J ),
205 $ LDA, A( J, J+JB ), LDA )
211 * Compute the Cholesky factorization A = L*L**H.
215 * Update and factorize the current diagonal block and test
216 * for non-positive-definiteness.
218 JB = MIN( NB, N-J+1 )
219 CALL CHERK( 'Lower', 'No transpose', JB, J-1, -ONE,
220 $ A( J, 1 ), LDA, ONE, A( J, J ), LDA )
221 CALL CPOTRF2( 'Lower', JB, A( J, J ), LDA, INFO )
226 * Compute the current block column.
228 CALL CGEMM( 'No transpose', 'Conjugate transpose',
229 $ N-J-JB+1, JB, J-1, -CONE, A( J+JB, 1 ),
230 $ LDA, A( J, 1 ), LDA, CONE, A( J+JB, J ),
232 CALL CTRSM( 'Right', 'Lower', 'Conjugate transpose',
233 $ 'Non-unit', N-J-JB+1, JB, CONE, A( J, J ),
234 $ LDA, A( J+JB, J ), LDA )