3 * =========== DOCUMENTATION ===========
5 * Online html documentation available at
6 * http://www.netlib.org/lapack/explore-html/
9 *> Download DPOTRF + dependencies
10 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/dpotrf.f">
12 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/dpotrf.f">
14 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dpotrf.f">
21 * SUBROUTINE DPOTRF( UPLO, N, A, LDA, INFO )
23 * .. Scalar Arguments ..
25 * INTEGER INFO, LDA, N
27 * .. Array Arguments ..
28 * DOUBLE PRECISION A( LDA, * )
37 *> DPOTRF computes the Cholesky factorization of a real symmetric
38 *> positive definite matrix A.
40 *> The factorization has the form
41 *> A = U**T * U, if UPLO = 'U', or
42 *> A = L * L**T, 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 DOUBLE PRECISION array, dimension (LDA,N)
67 *> On entry, the symmetric 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**T*U or A = L*L**T.
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 doublePOcomputational
107 * =====================================================================
108 SUBROUTINE DPOTRF( 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 ..
120 DOUBLE PRECISION A( LDA, * )
123 * =====================================================================
127 PARAMETER ( ONE = 1.0D+0 )
129 * .. Local Scalars ..
133 * .. External Functions ..
136 EXTERNAL LSAME, ILAENV
138 * .. External Subroutines ..
139 EXTERNAL DGEMM, DPOTRF2, DSYRK, DTRSM, XERBLA
141 * .. Intrinsic Functions ..
144 * .. Executable Statements ..
146 * Test the input parameters.
149 UPPER = LSAME( UPLO, 'U' )
150 IF( .NOT.UPPER .AND. .NOT.LSAME( UPLO, 'L' ) ) THEN
152 ELSE IF( N.LT.0 ) THEN
154 ELSE IF( LDA.LT.MAX( 1, N ) ) THEN
158 CALL XERBLA( 'DPOTRF', -INFO )
162 * Quick return if possible
167 * Determine the block size for this environment.
169 NB = ILAENV( 1, 'DPOTRF', UPLO, N, -1, -1, -1 )
170 IF( NB.LE.1 .OR. NB.GE.N ) THEN
172 * Use unblocked code.
174 CALL DPOTRF2( UPLO, N, A, LDA, INFO )
181 * Compute the Cholesky factorization A = U**T*U.
185 * Update and factorize the current diagonal block and test
186 * for non-positive-definiteness.
188 JB = MIN( NB, N-J+1 )
189 CALL DSYRK( 'Upper', 'Transpose', JB, J-1, -ONE,
190 $ A( 1, J ), LDA, ONE, A( J, J ), LDA )
191 CALL DPOTRF2( 'Upper', JB, A( J, J ), LDA, INFO )
196 * Compute the current block row.
198 CALL DGEMM( 'Transpose', 'No transpose', JB, N-J-JB+1,
199 $ J-1, -ONE, A( 1, J ), LDA, A( 1, J+JB ),
200 $ LDA, ONE, A( J, J+JB ), LDA )
201 CALL DTRSM( 'Left', 'Upper', 'Transpose', 'Non-unit',
202 $ JB, N-J-JB+1, ONE, A( J, J ), LDA,
203 $ A( J, J+JB ), LDA )
209 * Compute the Cholesky factorization A = L*L**T.
213 * Update and factorize the current diagonal block and test
214 * for non-positive-definiteness.
216 JB = MIN( NB, N-J+1 )
217 CALL DSYRK( 'Lower', 'No transpose', JB, J-1, -ONE,
218 $ A( J, 1 ), LDA, ONE, A( J, J ), LDA )
219 CALL DPOTRF2( 'Lower', JB, A( J, J ), LDA, INFO )
224 * Compute the current block column.
226 CALL DGEMM( 'No transpose', 'Transpose', N-J-JB+1, JB,
227 $ J-1, -ONE, A( J+JB, 1 ), LDA, A( J, 1 ),
228 $ LDA, ONE, A( J+JB, J ), LDA )
229 CALL DTRSM( 'Right', 'Lower', 'Transpose', 'Non-unit',
230 $ N-J-JB+1, JB, ONE, A( J, J ), LDA,
231 $ A( J+JB, J ), LDA )