3 /* Table of constant values */
5 static integer c__1 = 1;
6 static integer c_n1 = -1;
7 static real c_b15 = 1.f;
9 /* Subroutine */ int slauum_(char *uplo, integer *n, real *a, integer *lda,
12 /* System generated locals */
13 integer a_dim1, a_offset, i__1, i__2, i__3, i__4;
17 extern logical lsame_(char *, char *);
18 extern /* Subroutine */ int sgemm_(char *, char *, integer *, integer *,
19 integer *, real *, real *, integer *, real *, integer *, real *,
22 extern /* Subroutine */ int strmm_(char *, char *, char *, char *,
23 integer *, integer *, real *, real *, integer *, real *, integer *
24 ), ssyrk_(char *, char *, integer
25 *, integer *, real *, real *, integer *, real *, real *, integer *
26 ), slauu2_(char *, integer *, real *, integer *,
27 integer *), xerbla_(char *, integer *);
28 extern integer ilaenv_(integer *, char *, char *, integer *, integer *,
29 integer *, integer *);
32 /* -- LAPACK auxiliary routine (version 3.1) -- */
33 /* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. */
36 /* .. Scalar Arguments .. */
38 /* .. Array Arguments .. */
44 /* SLAUUM computes the product U * U' or L' * L, where the triangular */
45 /* factor U or L is stored in the upper or lower triangular part of */
48 /* If UPLO = 'U' or 'u' then the upper triangle of the result is stored, */
49 /* overwriting the factor U in A. */
50 /* If UPLO = 'L' or 'l' then the lower triangle of the result is stored, */
51 /* overwriting the factor L in A. */
53 /* This is the blocked form of the algorithm, calling Level 3 BLAS. */
58 /* UPLO (input) CHARACTER*1 */
59 /* Specifies whether the triangular factor stored in the array A */
60 /* is upper or lower triangular: */
61 /* = 'U': Upper triangular */
62 /* = 'L': Lower triangular */
64 /* N (input) INTEGER */
65 /* The order of the triangular factor U or L. N >= 0. */
67 /* A (input/output) REAL array, dimension (LDA,N) */
68 /* On entry, the triangular factor U or L. */
69 /* On exit, if UPLO = 'U', the upper triangle of A is */
70 /* overwritten with the upper triangle of the product U * U'; */
71 /* if UPLO = 'L', the lower triangle of A is overwritten with */
72 /* the lower triangle of the product L' * L. */
74 /* LDA (input) INTEGER */
75 /* The leading dimension of the array A. LDA >= max(1,N). */
77 /* INFO (output) INTEGER */
78 /* = 0: successful exit */
79 /* < 0: if INFO = -k, the k-th argument had an illegal value */
81 /* ===================================================================== */
83 /* .. Parameters .. */
85 /* .. Local Scalars .. */
87 /* .. External Functions .. */
89 /* .. External Subroutines .. */
91 /* .. Intrinsic Functions .. */
93 /* .. Executable Statements .. */
95 /* Test the input parameters. */
97 /* Parameter adjustments */
99 a_offset = 1 + a_dim1;
104 upper = lsame_(uplo, "U");
105 if (! upper && ! lsame_(uplo, "L")) {
109 } else if (*lda < max(1,*n)) {
114 xerbla_("SLAUUM", &i__1);
118 /* Quick return if possible */
124 /* Determine the block size for this environment. */
126 nb = ilaenv_(&c__1, "SLAUUM", uplo, n, &c_n1, &c_n1, &c_n1);
128 if (nb <= 1 || nb >= *n) {
130 /* Use unblocked code */
132 slauu2_(uplo, n, &a[a_offset], lda, info);
135 /* Use blocked code */
139 /* Compute the product U * U'. */
143 for (i__ = 1; i__2 < 0 ? i__ >= i__1 : i__ <= i__1; i__ += i__2) {
145 i__3 = nb, i__4 = *n - i__ + 1;
148 strmm_("Right", "Upper", "Transpose", "Non-unit", &i__3, &ib,
149 &c_b15, &a[i__ + i__ * a_dim1], lda, &a[i__ * a_dim1
152 slauu2_("Upper", &ib, &a[i__ + i__ * a_dim1], lda, info);
153 if (i__ + ib <= *n) {
155 i__4 = *n - i__ - ib + 1;
156 sgemm_("No transpose", "Transpose", &i__3, &ib, &i__4, &
157 c_b15, &a[(i__ + ib) * a_dim1 + 1], lda, &a[i__ +
158 (i__ + ib) * a_dim1], lda, &c_b15, &a[i__ *
160 i__3 = *n - i__ - ib + 1;
161 ssyrk_("Upper", "No transpose", &ib, &i__3, &c_b15, &a[
162 i__ + (i__ + ib) * a_dim1], lda, &c_b15, &a[i__ +
169 /* Compute the product L' * L. */
173 for (i__ = 1; i__1 < 0 ? i__ >= i__2 : i__ <= i__2; i__ += i__1) {
175 i__3 = nb, i__4 = *n - i__ + 1;
178 strmm_("Left", "Lower", "Transpose", "Non-unit", &ib, &i__3, &
179 c_b15, &a[i__ + i__ * a_dim1], lda, &a[i__ + a_dim1],
181 slauu2_("Lower", &ib, &a[i__ + i__ * a_dim1], lda, info);
182 if (i__ + ib <= *n) {
184 i__4 = *n - i__ - ib + 1;
185 sgemm_("Transpose", "No transpose", &ib, &i__3, &i__4, &
186 c_b15, &a[i__ + ib + i__ * a_dim1], lda, &a[i__ +
187 ib + a_dim1], lda, &c_b15, &a[i__ + a_dim1], lda);
188 i__3 = *n - i__ - ib + 1;
189 ssyrk_("Lower", "Transpose", &ib, &i__3, &c_b15, &a[i__ +
190 ib + i__ * a_dim1], lda, &c_b15, &a[i__ + i__ *