annotate libcruft/lapack/zlauu2.f @ 5340:15843d76156d

[project @ 2005-05-06 16:26:58 by jwe]
author jwe
date Fri, 06 May 2005 16:26:59 +0000
parents
children 68db500cb558
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5340
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
1 SUBROUTINE ZLAUU2( UPLO, N, A, LDA, INFO )
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
2 *
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
3 * -- LAPACK auxiliary routine (version 3.0) --
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
4 * Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd.,
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
5 * Courant Institute, Argonne National Lab, and Rice University
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
6 * September 30, 1994
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
7 *
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
8 * .. Scalar Arguments ..
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
9 CHARACTER UPLO
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
10 INTEGER INFO, LDA, N
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
11 * ..
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
12 * .. Array Arguments ..
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
13 COMPLEX*16 A( LDA, * )
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
14 * ..
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
15 *
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
16 * Purpose
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
17 * =======
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
18 *
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
19 * ZLAUU2 computes the product U * U' or L' * L, where the triangular
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
20 * factor U or L is stored in the upper or lower triangular part of
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
21 * the array A.
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
22 *
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
23 * If UPLO = 'U' or 'u' then the upper triangle of the result is stored,
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
24 * overwriting the factor U in A.
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
25 * If UPLO = 'L' or 'l' then the lower triangle of the result is stored,
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
26 * overwriting the factor L in A.
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
27 *
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
28 * This is the unblocked form of the algorithm, calling Level 2 BLAS.
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
29 *
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
30 * Arguments
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
31 * =========
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
32 *
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
33 * UPLO (input) CHARACTER*1
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
34 * Specifies whether the triangular factor stored in the array A
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
35 * is upper or lower triangular:
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
36 * = 'U': Upper triangular
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
37 * = 'L': Lower triangular
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
38 *
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
39 * N (input) INTEGER
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
40 * The order of the triangular factor U or L. N >= 0.
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
41 *
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
42 * A (input/output) COMPLEX*16 array, dimension (LDA,N)
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
43 * On entry, the triangular factor U or L.
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
44 * On exit, if UPLO = 'U', the upper triangle of A is
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
45 * overwritten with the upper triangle of the product U * U';
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
46 * if UPLO = 'L', the lower triangle of A is overwritten with
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
47 * the lower triangle of the product L' * L.
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
48 *
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
49 * LDA (input) INTEGER
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
50 * The leading dimension of the array A. LDA >= max(1,N).
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
51 *
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
52 * INFO (output) INTEGER
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
53 * = 0: successful exit
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
54 * < 0: if INFO = -k, the k-th argument had an illegal value
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
55 *
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
56 * =====================================================================
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
57 *
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
58 * .. Parameters ..
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
59 COMPLEX*16 ONE
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
60 PARAMETER ( ONE = ( 1.0D+0, 0.0D+0 ) )
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
61 * ..
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
62 * .. Local Scalars ..
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
63 LOGICAL UPPER
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
64 INTEGER I
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
65 DOUBLE PRECISION AII
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
66 * ..
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
67 * .. External Functions ..
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
68 LOGICAL LSAME
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
69 COMPLEX*16 ZDOTC
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
70 EXTERNAL LSAME, ZDOTC
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
71 * ..
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
72 * .. External Subroutines ..
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
73 EXTERNAL XERBLA, ZDSCAL, ZGEMV, ZLACGV
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
74 * ..
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
75 * .. Intrinsic Functions ..
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
76 INTRINSIC DBLE, DCMPLX, MAX
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
77 * ..
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
78 * .. Executable Statements ..
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
79 *
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
80 * Test the input parameters.
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
81 *
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
82 INFO = 0
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
83 UPPER = LSAME( UPLO, 'U' )
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
84 IF( .NOT.UPPER .AND. .NOT.LSAME( UPLO, 'L' ) ) THEN
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
85 INFO = -1
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
86 ELSE IF( N.LT.0 ) THEN
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
87 INFO = -2
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
88 ELSE IF( LDA.LT.MAX( 1, N ) ) THEN
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
89 INFO = -4
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
90 END IF
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
91 IF( INFO.NE.0 ) THEN
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
92 CALL XERBLA( 'ZLAUU2', -INFO )
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
93 RETURN
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
94 END IF
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
95 *
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
96 * Quick return if possible
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
97 *
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
98 IF( N.EQ.0 )
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
99 $ RETURN
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
100 *
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
101 IF( UPPER ) THEN
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
102 *
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
103 * Compute the product U * U'.
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
104 *
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
105 DO 10 I = 1, N
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
106 AII = A( I, I )
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
107 IF( I.LT.N ) THEN
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
108 A( I, I ) = AII*AII + DBLE( ZDOTC( N-I, A( I, I+1 ), LDA,
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
109 $ A( I, I+1 ), LDA ) )
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
110 CALL ZLACGV( N-I, A( I, I+1 ), LDA )
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
111 CALL ZGEMV( 'No transpose', I-1, N-I, ONE, A( 1, I+1 ),
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
112 $ LDA, A( I, I+1 ), LDA, DCMPLX( AII ),
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
113 $ A( 1, I ), 1 )
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
114 CALL ZLACGV( N-I, A( I, I+1 ), LDA )
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
115 ELSE
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
116 CALL ZDSCAL( I, AII, A( 1, I ), 1 )
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
117 END IF
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
118 10 CONTINUE
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
119 *
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
120 ELSE
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
121 *
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
122 * Compute the product L' * L.
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
123 *
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
124 DO 20 I = 1, N
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
125 AII = A( I, I )
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
126 IF( I.LT.N ) THEN
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
127 A( I, I ) = AII*AII + DBLE( ZDOTC( N-I, A( I+1, I ), 1,
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
128 $ A( I+1, I ), 1 ) )
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
129 CALL ZLACGV( I-1, A( I, 1 ), LDA )
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
130 CALL ZGEMV( 'Conjugate transpose', N-I, I-1, ONE,
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
131 $ A( I+1, 1 ), LDA, A( I+1, I ), 1,
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
132 $ DCMPLX( AII ), A( I, 1 ), LDA )
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
133 CALL ZLACGV( I-1, A( I, 1 ), LDA )
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
134 ELSE
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
135 CALL ZDSCAL( I, AII, A( I, 1 ), LDA )
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
136 END IF
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
137 20 CONTINUE
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
138 END IF
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
139 *
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
140 RETURN
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
141 *
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
142 * End of ZLAUU2
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
143 *
15843d76156d [project @ 2005-05-06 16:26:58 by jwe]
jwe
parents:
diff changeset
144 END