3 /* Table of constant values */
5 static real c_b7 = 1.f;
6 static integer c__1 = 1;
8 /* Subroutine */ int slauu2_(char *uplo, integer *n, real *a, integer *lda,
11 /* System generated locals */
12 integer a_dim1, a_offset, i__1, i__2, i__3;
17 extern doublereal sdot_(integer *, real *, integer *, real *, integer *);
18 extern logical lsame_(char *, char *);
19 extern /* Subroutine */ int sscal_(integer *, real *, real *, integer *),
20 sgemv_(char *, integer *, integer *, real *, real *, integer *,
21 real *, integer *, real *, real *, integer *);
23 extern /* Subroutine */ int xerbla_(char *, integer *);
26 /* -- LAPACK auxiliary routine (version 3.1) -- */
27 /* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. */
30 /* .. Scalar Arguments .. */
32 /* .. Array Arguments .. */
38 /* SLAUU2 computes the product U * U' or L' * L, where the triangular */
39 /* factor U or L is stored in the upper or lower triangular part of */
42 /* If UPLO = 'U' or 'u' then the upper triangle of the result is stored, */
43 /* overwriting the factor U in A. */
44 /* If UPLO = 'L' or 'l' then the lower triangle of the result is stored, */
45 /* overwriting the factor L in A. */
47 /* This is the unblocked form of the algorithm, calling Level 2 BLAS. */
52 /* UPLO (input) CHARACTER*1 */
53 /* Specifies whether the triangular factor stored in the array A */
54 /* is upper or lower triangular: */
55 /* = 'U': Upper triangular */
56 /* = 'L': Lower triangular */
58 /* N (input) INTEGER */
59 /* The order of the triangular factor U or L. N >= 0. */
61 /* A (input/output) REAL array, dimension (LDA,N) */
62 /* On entry, the triangular factor U or L. */
63 /* On exit, if UPLO = 'U', the upper triangle of A is */
64 /* overwritten with the upper triangle of the product U * U'; */
65 /* if UPLO = 'L', the lower triangle of A is overwritten with */
66 /* the lower triangle of the product L' * L. */
68 /* LDA (input) INTEGER */
69 /* The leading dimension of the array A. LDA >= max(1,N). */
71 /* INFO (output) INTEGER */
72 /* = 0: successful exit */
73 /* < 0: if INFO = -k, the k-th argument had an illegal value */
75 /* ===================================================================== */
77 /* .. Parameters .. */
79 /* .. Local Scalars .. */
81 /* .. External Functions .. */
83 /* .. External Subroutines .. */
85 /* .. Intrinsic Functions .. */
87 /* .. Executable Statements .. */
89 /* Test the input parameters. */
91 /* Parameter adjustments */
93 a_offset = 1 + a_dim1;
98 upper = lsame_(uplo, "U");
99 if (! upper && ! lsame_(uplo, "L")) {
103 } else if (*lda < max(1,*n)) {
108 xerbla_("SLAUU2", &i__1);
112 /* Quick return if possible */
120 /* Compute the product U * U'. */
123 for (i__ = 1; i__ <= i__1; ++i__) {
124 aii = a[i__ + i__ * a_dim1];
127 a[i__ + i__ * a_dim1] = sdot_(&i__2, &a[i__ + i__ * a_dim1],
128 lda, &a[i__ + i__ * a_dim1], lda);
131 sgemv_("No transpose", &i__2, &i__3, &c_b7, &a[(i__ + 1) *
132 a_dim1 + 1], lda, &a[i__ + (i__ + 1) * a_dim1], lda, &
133 aii, &a[i__ * a_dim1 + 1], &c__1);
135 sscal_(&i__, &aii, &a[i__ * a_dim1 + 1], &c__1);
142 /* Compute the product L' * L. */
145 for (i__ = 1; i__ <= i__1; ++i__) {
146 aii = a[i__ + i__ * a_dim1];
149 a[i__ + i__ * a_dim1] = sdot_(&i__2, &a[i__ + i__ * a_dim1], &
150 c__1, &a[i__ + i__ * a_dim1], &c__1);
153 sgemv_("Transpose", &i__2, &i__3, &c_b7, &a[i__ + 1 + a_dim1],
154 lda, &a[i__ + 1 + i__ * a_dim1], &c__1, &aii, &a[i__
157 sscal_(&i__, &aii, &a[i__ + a_dim1], lda);