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__4 = 4;
00020 static integer c__12 = 12;
00021 static integer c__8 = 8;
00022 static integer c__40 = 40;
00023 static integer c__2 = 2;
00024 static integer c__3 = 3;
00025 static integer c__60 = 60;
00026
00027 int slatm6_(integer *type__, integer *n, real *a, integer *
00028 lda, real *b, real *x, integer *ldx, real *y, integer *ldy, real *
00029 alpha, real *beta, real *wx, real *wy, real *s, real *dif)
00030 {
00031
00032 integer a_dim1, a_offset, b_dim1, b_offset, x_dim1, x_offset, y_dim1,
00033 y_offset, i__1, i__2;
00034
00035
00036 double sqrt(doublereal);
00037
00038
00039 integer i__, j;
00040 real z__[144] ;
00041 integer info;
00042 real work[100];
00043 extern int slakf2_(integer *, integer *, real *, integer
00044 *, real *, real *, real *, real *, integer *), sgesvd_(char *,
00045 char *, integer *, integer *, real *, integer *, real *, real *,
00046 integer *, real *, integer *, real *, integer *, integer *), slacpy_(char *, integer *, integer *, real *,
00047 integer *, real *, integer *);
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
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162
00163
00164
00165
00166 b_dim1 = *lda;
00167 b_offset = 1 + b_dim1;
00168 b -= b_offset;
00169 a_dim1 = *lda;
00170 a_offset = 1 + a_dim1;
00171 a -= a_offset;
00172 x_dim1 = *ldx;
00173 x_offset = 1 + x_dim1;
00174 x -= x_offset;
00175 y_dim1 = *ldy;
00176 y_offset = 1 + y_dim1;
00177 y -= y_offset;
00178 --s;
00179 --dif;
00180
00181
00182 i__1 = *n;
00183 for (i__ = 1; i__ <= i__1; ++i__) {
00184 i__2 = *n;
00185 for (j = 1; j <= i__2; ++j) {
00186
00187 if (i__ == j) {
00188 a[i__ + i__ * a_dim1] = (real) i__ + *alpha;
00189 b[i__ + i__ * b_dim1] = 1.f;
00190 } else {
00191 a[i__ + j * a_dim1] = 0.f;
00192 b[i__ + j * b_dim1] = 0.f;
00193 }
00194
00195
00196 }
00197
00198 }
00199
00200
00201
00202 slacpy_("F", n, n, &b[b_offset], lda, &y[y_offset], ldy);
00203 y[y_dim1 + 3] = -(*wy);
00204 y[y_dim1 + 4] = *wy;
00205 y[y_dim1 + 5] = -(*wy);
00206 y[(y_dim1 << 1) + 3] = -(*wy);
00207 y[(y_dim1 << 1) + 4] = *wy;
00208 y[(y_dim1 << 1) + 5] = -(*wy);
00209
00210 slacpy_("F", n, n, &b[b_offset], lda, &x[x_offset], ldx);
00211 x[x_dim1 * 3 + 1] = -(*wx);
00212 x[(x_dim1 << 2) + 1] = -(*wx);
00213 x[x_dim1 * 5 + 1] = *wx;
00214 x[x_dim1 * 3 + 2] = *wx;
00215 x[(x_dim1 << 2) + 2] = -(*wx);
00216 x[x_dim1 * 5 + 2] = -(*wx);
00217
00218
00219
00220 b[b_dim1 * 3 + 1] = *wx + *wy;
00221 b[b_dim1 * 3 + 2] = -(*wx) + *wy;
00222 b[(b_dim1 << 2) + 1] = *wx - *wy;
00223 b[(b_dim1 << 2) + 2] = *wx - *wy;
00224 b[b_dim1 * 5 + 1] = -(*wx) + *wy;
00225 b[b_dim1 * 5 + 2] = *wx + *wy;
00226 if (*type__ == 1) {
00227 a[a_dim1 * 3 + 1] = *wx * a[a_dim1 + 1] + *wy * a[a_dim1 * 3 + 3];
00228 a[a_dim1 * 3 + 2] = -(*wx) * a[(a_dim1 << 1) + 2] + *wy * a[a_dim1 *
00229 3 + 3];
00230 a[(a_dim1 << 2) + 1] = *wx * a[a_dim1 + 1] - *wy * a[(a_dim1 << 2) +
00231 4];
00232 a[(a_dim1 << 2) + 2] = *wx * a[(a_dim1 << 1) + 2] - *wy * a[(a_dim1 <<
00233 2) + 4];
00234 a[a_dim1 * 5 + 1] = -(*wx) * a[a_dim1 + 1] + *wy * a[a_dim1 * 5 + 5];
00235 a[a_dim1 * 5 + 2] = *wx * a[(a_dim1 << 1) + 2] + *wy * a[a_dim1 * 5 +
00236 5];
00237 } else if (*type__ == 2) {
00238 a[a_dim1 * 3 + 1] = *wx * 2.f + *wy;
00239 a[a_dim1 * 3 + 2] = *wy;
00240 a[(a_dim1 << 2) + 1] = -(*wy) * (*alpha + 2.f + *beta);
00241 a[(a_dim1 << 2) + 2] = *wx * 2.f - *wy * (*alpha + 2.f + *beta);
00242 a[a_dim1 * 5 + 1] = *wx * -2.f + *wy * (*alpha - *beta);
00243 a[a_dim1 * 5 + 2] = *wy * (*alpha - *beta);
00244 a[a_dim1 + 1] = 1.f;
00245 a[(a_dim1 << 1) + 1] = -1.f;
00246 a[a_dim1 + 2] = 1.f;
00247 a[(a_dim1 << 1) + 2] = a[a_dim1 + 1];
00248 a[a_dim1 * 3 + 3] = 1.f;
00249 a[(a_dim1 << 2) + 4] = *alpha + 1.f;
00250 a[a_dim1 * 5 + 4] = *beta + 1.f;
00251 a[(a_dim1 << 2) + 5] = -a[a_dim1 * 5 + 4];
00252 a[a_dim1 * 5 + 5] = a[(a_dim1 << 2) + 4];
00253 }
00254
00255
00256
00257 if (*type__ == 1) {
00258
00259 s[1] = 1.f / sqrt((*wy * 3.f * *wy + 1.f) / (a[a_dim1 + 1] * a[a_dim1
00260 + 1] + 1.f));
00261 s[2] = 1.f / sqrt((*wy * 3.f * *wy + 1.f) / (a[(a_dim1 << 1) + 2] * a[
00262 (a_dim1 << 1) + 2] + 1.f));
00263 s[3] = 1.f / sqrt((*wx * 2.f * *wx + 1.f) / (a[a_dim1 * 3 + 3] * a[
00264 a_dim1 * 3 + 3] + 1.f));
00265 s[4] = 1.f / sqrt((*wx * 2.f * *wx + 1.f) / (a[(a_dim1 << 2) + 4] * a[
00266 (a_dim1 << 2) + 4] + 1.f));
00267 s[5] = 1.f / sqrt((*wx * 2.f * *wx + 1.f) / (a[a_dim1 * 5 + 5] * a[
00268 a_dim1 * 5 + 5] + 1.f));
00269
00270 slakf2_(&c__1, &c__4, &a[a_offset], lda, &a[(a_dim1 << 1) + 2], &b[
00271 b_offset], &b[(b_dim1 << 1) + 2], z__, &c__12);
00272 sgesvd_("N", "N", &c__8, &c__8, z__, &c__12, work, &work[8], &c__1, &
00273 work[9], &c__1, &work[10], &c__40, &info);
00274 dif[1] = work[7];
00275
00276 slakf2_(&c__4, &c__1, &a[a_offset], lda, &a[a_dim1 * 5 + 5], &b[
00277 b_offset], &b[b_dim1 * 5 + 5], z__, &c__12);
00278 sgesvd_("N", "N", &c__8, &c__8, z__, &c__12, work, &work[8], &c__1, &
00279 work[9], &c__1, &work[10], &c__40, &info);
00280 dif[5] = work[7];
00281
00282 } else if (*type__ == 2) {
00283
00284 s[1] = 1.f / sqrt(*wy * *wy + .33333333333333331f);
00285 s[2] = s[1];
00286 s[3] = 1.f / sqrt(*wx * *wx + .5f);
00287 s[4] = 1.f / sqrt((*wx * 2.f * *wx + 1.f) / ((*alpha + 1.f) * (*alpha
00288 + 1.f) + 1.f + (*beta + 1.f) * (*beta + 1.f)));
00289 s[5] = s[4];
00290
00291 slakf2_(&c__2, &c__3, &a[a_offset], lda, &a[a_dim1 * 3 + 3], &b[
00292 b_offset], &b[b_dim1 * 3 + 3], z__, &c__12);
00293 sgesvd_("N", "N", &c__12, &c__12, z__, &c__12, work, &work[12], &c__1,
00294 &work[13], &c__1, &work[14], &c__60, &info);
00295 dif[1] = work[11];
00296
00297 slakf2_(&c__3, &c__2, &a[a_offset], lda, &a[(a_dim1 << 2) + 4], &b[
00298 b_offset], &b[(b_dim1 << 2) + 4], z__, &c__12);
00299 sgesvd_("N", "N", &c__12, &c__12, z__, &c__12, work, &work[12], &c__1,
00300 &work[13], &c__1, &work[14], &c__60, &info);
00301 dif[5] = work[11];
00302
00303 }
00304
00305 return 0;
00306
00307
00308
00309 }