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 doublecomplex c_b1 = {1.,0.};
00019 static integer c__1 = 1;
00020 static integer c_n1 = -1;
00021 static doublereal c_b21 = 1.;
00022
00023 int zlauum_(char *uplo, integer *n, doublecomplex *a,
00024 integer *lda, integer *info)
00025 {
00026
00027 integer a_dim1, a_offset, i__1, i__2, i__3, i__4;
00028
00029
00030 integer i__, ib, nb;
00031 extern logical lsame_(char *, char *);
00032 extern int zgemm_(char *, char *, integer *, integer *,
00033 integer *, doublecomplex *, doublecomplex *, integer *,
00034 doublecomplex *, integer *, doublecomplex *, doublecomplex *,
00035 integer *), zherk_(char *, char *, integer *,
00036 integer *, doublereal *, doublecomplex *, integer *, doublereal *,
00037 doublecomplex *, integer *);
00038 logical upper;
00039 extern int ztrmm_(char *, char *, char *, char *,
00040 integer *, integer *, doublecomplex *, doublecomplex *, integer *,
00041 doublecomplex *, integer *),
00042 zlauu2_(char *, integer *, doublecomplex *, integer *, integer *), xerbla_(char *, 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_("ZLAUUM", &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, "ZLAUUM", uplo, n, &c_n1, &c_n1, &c_n1);
00142
00143 if (nb <= 1 || nb >= *n) {
00144
00145
00146
00147 zlauu2_(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 ztrmm_("Right", "Upper", "Conjugate transpose", "Non-unit", &
00164 i__3, &ib, &c_b1, &a[i__ + i__ * a_dim1], lda, &a[i__
00165 * a_dim1 + 1], lda);
00166 zlauu2_("Upper", &ib, &a[i__ + i__ * a_dim1], lda, info);
00167 if (i__ + ib <= *n) {
00168 i__3 = i__ - 1;
00169 i__4 = *n - i__ - ib + 1;
00170 zgemm_("No transpose", "Conjugate transpose", &i__3, &ib,
00171 &i__4, &c_b1, &a[(i__ + ib) * a_dim1 + 1], lda, &
00172 a[i__ + (i__ + ib) * a_dim1], lda, &c_b1, &a[i__ *
00173 a_dim1 + 1], lda);
00174 i__3 = *n - i__ - ib + 1;
00175 zherk_("Upper", "No transpose", &ib, &i__3, &c_b21, &a[
00176 i__ + (i__ + ib) * a_dim1], lda, &c_b21, &a[i__ +
00177 i__ * a_dim1], lda);
00178 }
00179
00180 }
00181 } else {
00182
00183
00184
00185 i__2 = *n;
00186 i__1 = nb;
00187 for (i__ = 1; i__1 < 0 ? i__ >= i__2 : i__ <= i__2; i__ += i__1) {
00188
00189 i__3 = nb, i__4 = *n - i__ + 1;
00190 ib = min(i__3,i__4);
00191 i__3 = i__ - 1;
00192 ztrmm_("Left", "Lower", "Conjugate transpose", "Non-unit", &
00193 ib, &i__3, &c_b1, &a[i__ + i__ * a_dim1], lda, &a[i__
00194 + a_dim1], lda);
00195 zlauu2_("Lower", &ib, &a[i__ + i__ * a_dim1], lda, info);
00196 if (i__ + ib <= *n) {
00197 i__3 = i__ - 1;
00198 i__4 = *n - i__ - ib + 1;
00199 zgemm_("Conjugate transpose", "No transpose", &ib, &i__3,
00200 &i__4, &c_b1, &a[i__ + ib + i__ * a_dim1], lda, &
00201 a[i__ + ib + a_dim1], lda, &c_b1, &a[i__ + a_dim1]
00202 , lda);
00203 i__3 = *n - i__ - ib + 1;
00204 zherk_("Lower", "Conjugate transpose", &ib, &i__3, &c_b21,
00205 &a[i__ + ib + i__ * a_dim1], lda, &c_b21, &a[i__
00206 + i__ * a_dim1], lda);
00207 }
00208
00209 }
00210 }
00211 }
00212
00213 return 0;
00214
00215
00216
00217 }