1: *> \brief \b ZPOTRF
2: *
3: * =========== DOCUMENTATION ===========
4: *
5: * Online html documentation available at
6: * http://www.netlib.org/lapack/explore-html/
7: *
8: *> \htmlonly
9: *> Download ZPOTRF + dependencies
10: *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/zpotrf.f">
11: *> [TGZ]</a>
12: *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/zpotrf.f">
13: *> [ZIP]</a>
14: *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zpotrf.f">
15: *> [TXT]</a>
16: *> \endhtmlonly
17: *
18: * Definition:
19: * ===========
20: *
21: * SUBROUTINE ZPOTRF( UPLO, N, A, LDA, INFO )
22: *
23: * .. Scalar Arguments ..
24: * CHARACTER UPLO
25: * INTEGER INFO, LDA, N
26: * ..
27: * .. Array Arguments ..
28: * COMPLEX*16 A( LDA, * )
29: * ..
30: *
31: *
32: *> \par Purpose:
33: * =============
34: *>
35: *> \verbatim
36: *>
37: *> ZPOTRF computes the Cholesky factorization of a complex Hermitian
38: *> positive definite matrix A.
39: *>
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.
44: *>
45: *> This is the block version of the algorithm, calling Level 3 BLAS.
46: *> \endverbatim
47: *
48: * Arguments:
49: * ==========
50: *
51: *> \param[in] UPLO
52: *> \verbatim
53: *> UPLO is CHARACTER*1
54: *> = 'U': Upper triangle of A is stored;
55: *> = 'L': Lower triangle of A is stored.
56: *> \endverbatim
57: *>
58: *> \param[in] N
59: *> \verbatim
60: *> N is INTEGER
61: *> The order of the matrix A. N >= 0.
62: *> \endverbatim
63: *>
64: *> \param[in,out] A
65: *> \verbatim
66: *> A is COMPLEX*16 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.
74: *>
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.
77: *> \endverbatim
78: *>
79: *> \param[in] LDA
80: *> \verbatim
81: *> LDA is INTEGER
82: *> The leading dimension of the array A. LDA >= max(1,N).
83: *> \endverbatim
84: *>
85: *> \param[out] INFO
86: *> \verbatim
87: *> INFO is INTEGER
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
92: *> completed.
93: *> \endverbatim
94: *
95: * Authors:
96: * ========
97: *
98: *> \author Univ. of Tennessee
99: *> \author Univ. of California Berkeley
100: *> \author Univ. of Colorado Denver
101: *> \author NAG Ltd.
102: *
103: *> \ingroup complex16POcomputational
104: *
105: * =====================================================================
106: SUBROUTINE ZPOTRF( UPLO, N, A, LDA, INFO )
107: *
108: * -- LAPACK computational routine --
109: * -- LAPACK is a software package provided by Univ. of Tennessee, --
110: * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
111: *
112: * .. Scalar Arguments ..
113: CHARACTER UPLO
114: INTEGER INFO, LDA, N
115: * ..
116: * .. Array Arguments ..
117: COMPLEX*16 A( LDA, * )
118: * ..
119: *
120: * =====================================================================
121: *
122: * .. Parameters ..
123: DOUBLE PRECISION ONE
124: COMPLEX*16 CONE
125: PARAMETER ( ONE = 1.0D+0, CONE = ( 1.0D+0, 0.0D+0 ) )
126: * ..
127: * .. Local Scalars ..
128: LOGICAL UPPER
129: INTEGER J, JB, NB
130: * ..
131: * .. External Functions ..
132: LOGICAL LSAME
133: INTEGER ILAENV
134: EXTERNAL LSAME, ILAENV
135: * ..
136: * .. External Subroutines ..
137: EXTERNAL XERBLA, ZGEMM, ZHERK, ZPOTRF2, ZTRSM
138: * ..
139: * .. Intrinsic Functions ..
140: INTRINSIC MAX, MIN
141: * ..
142: * .. Executable Statements ..
143: *
144: * Test the input parameters.
145: *
146: INFO = 0
147: UPPER = LSAME( UPLO, 'U' )
148: IF( .NOT.UPPER .AND. .NOT.LSAME( UPLO, 'L' ) ) THEN
149: INFO = -1
150: ELSE IF( N.LT.0 ) THEN
151: INFO = -2
152: ELSE IF( LDA.LT.MAX( 1, N ) ) THEN
153: INFO = -4
154: END IF
155: IF( INFO.NE.0 ) THEN
156: CALL XERBLA( 'ZPOTRF', -INFO )
157: RETURN
158: END IF
159: *
160: * Quick return if possible
161: *
162: IF( N.EQ.0 )
163: $ RETURN
164: *
165: * Determine the block size for this environment.
166: *
167: NB = ILAENV( 1, 'ZPOTRF', UPLO, N, -1, -1, -1 )
168: IF( NB.LE.1 .OR. NB.GE.N ) THEN
169: *
170: * Use unblocked code.
171: *
172: CALL ZPOTRF2( UPLO, N, A, LDA, INFO )
173: ELSE
174: *
175: * Use blocked code.
176: *
177: IF( UPPER ) THEN
178: *
179: * Compute the Cholesky factorization A = U**H *U.
180: *
181: DO 10 J = 1, N, NB
182: *
183: * Update and factorize the current diagonal block and test
184: * for non-positive-definiteness.
185: *
186: JB = MIN( NB, N-J+1 )
187: CALL ZHERK( 'Upper', 'Conjugate transpose', JB, J-1,
188: $ -ONE, A( 1, J ), LDA, ONE, A( J, J ), LDA )
189: CALL ZPOTRF2( 'Upper', JB, A( J, J ), LDA, INFO )
190: IF( INFO.NE.0 )
191: $ GO TO 30
192: IF( J+JB.LE.N ) THEN
193: *
194: * Compute the current block row.
195: *
196: CALL ZGEMM( 'Conjugate transpose', 'No transpose', JB,
197: $ N-J-JB+1, J-1, -CONE, A( 1, J ), LDA,
198: $ A( 1, J+JB ), LDA, CONE, A( J, J+JB ),
199: $ LDA )
200: CALL ZTRSM( 'Left', 'Upper', 'Conjugate transpose',
201: $ 'Non-unit', JB, N-J-JB+1, CONE, A( J, J ),
202: $ LDA, A( J, J+JB ), LDA )
203: END IF
204: 10 CONTINUE
205: *
206: ELSE
207: *
208: * Compute the Cholesky factorization A = L*L**H.
209: *
210: DO 20 J = 1, N, NB
211: *
212: * Update and factorize the current diagonal block and test
213: * for non-positive-definiteness.
214: *
215: JB = MIN( NB, N-J+1 )
216: CALL ZHERK( 'Lower', 'No transpose', JB, J-1, -ONE,
217: $ A( J, 1 ), LDA, ONE, A( J, J ), LDA )
218: CALL ZPOTRF2( 'Lower', JB, A( J, J ), LDA, INFO )
219: IF( INFO.NE.0 )
220: $ GO TO 30
221: IF( J+JB.LE.N ) THEN
222: *
223: * Compute the current block column.
224: *
225: CALL ZGEMM( 'No transpose', 'Conjugate transpose',
226: $ N-J-JB+1, JB, J-1, -CONE, A( J+JB, 1 ),
227: $ LDA, A( J, 1 ), LDA, CONE, A( J+JB, J ),
228: $ LDA )
229: CALL ZTRSM( 'Right', 'Lower', 'Conjugate transpose',
230: $ 'Non-unit', N-J-JB+1, JB, CONE, A( J, J ),
231: $ LDA, A( J+JB, J ), LDA )
232: END IF
233: 20 CONTINUE
234: END IF
235: END IF
236: GO TO 40
237: *
238: 30 CONTINUE
239: INFO = INFO + J - 1
240: *
241: 40 CONTINUE
242: RETURN
243: *
244: * End of ZPOTRF
245: *
246: END
CVSweb interface <joel.bertrand@systella.fr>