00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #include "f2c.h"
00014 #include "blaswrap.h"
00015
00016
00017
00018 static integer c__1 = 1;
00019 static integer c_n1 = -1;
00020 static doublereal c_b15 = 1.;
00021
00022 int dlauum_(char *uplo, integer *n, doublereal *a, integer *
00023 lda, integer *info)
00024 {
00025
00026 integer a_dim1, a_offset, i__1, i__2, i__3, i__4;
00027
00028
00029 integer i__, ib, nb;
00030 extern int dgemm_(char *, char *, integer *, integer *,
00031 integer *, doublereal *, doublereal *, integer *, doublereal *,
00032 integer *, doublereal *, doublereal *, integer *);
00033 extern logical lsame_(char *, char *);
00034 extern int dtrmm_(char *, char *, char *, char *,
00035 integer *, integer *, doublereal *, doublereal *, integer *,
00036 doublereal *, integer *);
00037 logical upper;
00038 extern int dsyrk_(char *, char *, integer *, integer *,
00039 doublereal *, doublereal *, integer *, doublereal *, doublereal *,
00040 integer *), dlauu2_(char *, integer *,
00041 doublereal *, integer *, integer *), xerbla_(char *,
00042 integer *);
00043 extern integer ilaenv_(integer *, char *, char *, integer *, integer *,
00044 integer *, integer *);
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113 a_dim1 = *lda;
00114 a_offset = 1 + a_dim1;
00115 a -= a_offset;
00116
00117
00118 *info = 0;
00119 upper = lsame_(uplo, "U");
00120 if (! upper && ! lsame_(uplo, "L")) {
00121 *info = -1;
00122 } else if (*n < 0) {
00123 *info = -2;
00124 } else if (*lda < max(1,*n)) {
00125 *info = -4;
00126 }
00127 if (*info != 0) {
00128 i__1 = -(*info);
00129 xerbla_("DLAUUM", &i__1);
00130 return 0;
00131 }
00132
00133
00134
00135 if (*n == 0) {
00136 return 0;
00137 }
00138
00139
00140
00141 nb = ilaenv_(&c__1, "DLAUUM", uplo, n, &c_n1, &c_n1, &c_n1);
00142
00143 if (nb <= 1 || nb >= *n) {
00144
00145
00146
00147 dlauu2_(uplo, n, &a[a_offset], lda, info);
00148 } else {
00149
00150
00151
00152 if (upper) {
00153
00154
00155
00156 i__1 = *n;
00157 i__2 = nb;
00158 for (i__ = 1; i__2 < 0 ? i__ >= i__1 : i__ <= i__1; i__ += i__2) {
00159
00160 i__3 = nb, i__4 = *n - i__ + 1;
00161 ib = min(i__3,i__4);
00162 i__3 = i__ - 1;
00163 dtrmm_("Right", "Upper", "Transpose", "Non-unit", &i__3, &ib,
00164 &c_b15, &a[i__ + i__ * a_dim1], lda, &a[i__ * a_dim1
00165 + 1], lda)
00166 ;
00167 dlauu2_("Upper", &ib, &a[i__ + i__ * a_dim1], lda, info);
00168 if (i__ + ib <= *n) {
00169 i__3 = i__ - 1;
00170 i__4 = *n - i__ - ib + 1;
00171 dgemm_("No transpose", "Transpose", &i__3, &ib, &i__4, &
00172 c_b15, &a[(i__ + ib) * a_dim1 + 1], lda, &a[i__ +
00173 (i__ + ib) * a_dim1], lda, &c_b15, &a[i__ *
00174 a_dim1 + 1], lda);
00175 i__3 = *n - i__ - ib + 1;
00176 dsyrk_("Upper", "No transpose", &ib, &i__3, &c_b15, &a[
00177 i__ + (i__ + ib) * a_dim1], lda, &c_b15, &a[i__ +
00178 i__ * a_dim1], lda);
00179 }
00180
00181 }
00182 } else {
00183
00184
00185
00186 i__2 = *n;
00187 i__1 = nb;
00188 for (i__ = 1; i__1 < 0 ? i__ >= i__2 : i__ <= i__2; i__ += i__1) {
00189
00190 i__3 = nb, i__4 = *n - i__ + 1;
00191 ib = min(i__3,i__4);
00192 i__3 = i__ - 1;
00193 dtrmm_("Left", "Lower", "Transpose", "Non-unit", &ib, &i__3, &
00194 c_b15, &a[i__ + i__ * a_dim1], lda, &a[i__ + a_dim1],
00195 lda);
00196 dlauu2_("Lower", &ib, &a[i__ + i__ * a_dim1], lda, info);
00197 if (i__ + ib <= *n) {
00198 i__3 = i__ - 1;
00199 i__4 = *n - i__ - ib + 1;
00200 dgemm_("Transpose", "No transpose", &ib, &i__3, &i__4, &
00201 c_b15, &a[i__ + ib + i__ * a_dim1], lda, &a[i__ +
00202 ib + a_dim1], lda, &c_b15, &a[i__ + a_dim1], lda);
00203 i__3 = *n - i__ - ib + 1;
00204 dsyrk_("Lower", "Transpose", &ib, &i__3, &c_b15, &a[i__ +
00205 ib + i__ * a_dim1], lda, &c_b15, &a[i__ + i__ *
00206 a_dim1], lda);
00207 }
00208
00209 }
00210 }
00211 }
00212
00213 return 0;
00214
00215
00216
00217 }