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 dlatm6_(integer *type__, integer *n, doublereal *a,
00028 integer *lda, doublereal *b, doublereal *x, integer *ldx, doublereal *
00029 y, integer *ldy, doublereal *alpha, doublereal *beta, doublereal *wx,
00030 doublereal *wy, doublereal *s, doublereal *dif)
00031 {
00032
00033 integer a_dim1, a_offset, b_dim1, b_offset, x_dim1, x_offset, y_dim1,
00034 y_offset, i__1, i__2;
00035
00036
00037 double sqrt(doublereal);
00038
00039
00040 integer i__, j;
00041 doublereal z__[144] ;
00042 integer info;
00043 doublereal work[100];
00044 extern int dlakf2_(integer *, integer *, doublereal *,
00045 integer *, doublereal *, doublereal *, doublereal *, doublereal *,
00046 integer *), dgesvd_(char *, char *, integer *, integer *,
00047 doublereal *, integer *, doublereal *, doublereal *, integer *,
00048 doublereal *, integer *, doublereal *, integer *, integer *), dlacpy_(char *, integer *, integer *, doublereal
00049 *, integer *, doublereal *, integer *);
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
00167
00168 b_dim1 = *lda;
00169 b_offset = 1 + b_dim1;
00170 b -= b_offset;
00171 a_dim1 = *lda;
00172 a_offset = 1 + a_dim1;
00173 a -= a_offset;
00174 x_dim1 = *ldx;
00175 x_offset = 1 + x_dim1;
00176 x -= x_offset;
00177 y_dim1 = *ldy;
00178 y_offset = 1 + y_dim1;
00179 y -= y_offset;
00180 --s;
00181 --dif;
00182
00183
00184 i__1 = *n;
00185 for (i__ = 1; i__ <= i__1; ++i__) {
00186 i__2 = *n;
00187 for (j = 1; j <= i__2; ++j) {
00188
00189 if (i__ == j) {
00190 a[i__ + i__ * a_dim1] = (doublereal) i__ + *alpha;
00191 b[i__ + i__ * b_dim1] = 1.;
00192 } else {
00193 a[i__ + j * a_dim1] = 0.;
00194 b[i__ + j * b_dim1] = 0.;
00195 }
00196
00197
00198 }
00199
00200 }
00201
00202
00203
00204 dlacpy_("F", n, n, &b[b_offset], lda, &y[y_offset], ldy);
00205 y[y_dim1 + 3] = -(*wy);
00206 y[y_dim1 + 4] = *wy;
00207 y[y_dim1 + 5] = -(*wy);
00208 y[(y_dim1 << 1) + 3] = -(*wy);
00209 y[(y_dim1 << 1) + 4] = *wy;
00210 y[(y_dim1 << 1) + 5] = -(*wy);
00211
00212 dlacpy_("F", n, n, &b[b_offset], lda, &x[x_offset], ldx);
00213 x[x_dim1 * 3 + 1] = -(*wx);
00214 x[(x_dim1 << 2) + 1] = -(*wx);
00215 x[x_dim1 * 5 + 1] = *wx;
00216 x[x_dim1 * 3 + 2] = *wx;
00217 x[(x_dim1 << 2) + 2] = -(*wx);
00218 x[x_dim1 * 5 + 2] = -(*wx);
00219
00220
00221
00222 b[b_dim1 * 3 + 1] = *wx + *wy;
00223 b[b_dim1 * 3 + 2] = -(*wx) + *wy;
00224 b[(b_dim1 << 2) + 1] = *wx - *wy;
00225 b[(b_dim1 << 2) + 2] = *wx - *wy;
00226 b[b_dim1 * 5 + 1] = -(*wx) + *wy;
00227 b[b_dim1 * 5 + 2] = *wx + *wy;
00228 if (*type__ == 1) {
00229 a[a_dim1 * 3 + 1] = *wx * a[a_dim1 + 1] + *wy * a[a_dim1 * 3 + 3];
00230 a[a_dim1 * 3 + 2] = -(*wx) * a[(a_dim1 << 1) + 2] + *wy * a[a_dim1 *
00231 3 + 3];
00232 a[(a_dim1 << 2) + 1] = *wx * a[a_dim1 + 1] - *wy * a[(a_dim1 << 2) +
00233 4];
00234 a[(a_dim1 << 2) + 2] = *wx * a[(a_dim1 << 1) + 2] - *wy * a[(a_dim1 <<
00235 2) + 4];
00236 a[a_dim1 * 5 + 1] = -(*wx) * a[a_dim1 + 1] + *wy * a[a_dim1 * 5 + 5];
00237 a[a_dim1 * 5 + 2] = *wx * a[(a_dim1 << 1) + 2] + *wy * a[a_dim1 * 5 +
00238 5];
00239 } else if (*type__ == 2) {
00240 a[a_dim1 * 3 + 1] = *wx * 2. + *wy;
00241 a[a_dim1 * 3 + 2] = *wy;
00242 a[(a_dim1 << 2) + 1] = -(*wy) * (*alpha + 2. + *beta);
00243 a[(a_dim1 << 2) + 2] = *wx * 2. - *wy * (*alpha + 2. + *beta);
00244 a[a_dim1 * 5 + 1] = *wx * -2. + *wy * (*alpha - *beta);
00245 a[a_dim1 * 5 + 2] = *wy * (*alpha - *beta);
00246 a[a_dim1 + 1] = 1.;
00247 a[(a_dim1 << 1) + 1] = -1.;
00248 a[a_dim1 + 2] = 1.;
00249 a[(a_dim1 << 1) + 2] = a[a_dim1 + 1];
00250 a[a_dim1 * 3 + 3] = 1.;
00251 a[(a_dim1 << 2) + 4] = *alpha + 1.;
00252 a[a_dim1 * 5 + 4] = *beta + 1.;
00253 a[(a_dim1 << 2) + 5] = -a[a_dim1 * 5 + 4];
00254 a[a_dim1 * 5 + 5] = a[(a_dim1 << 2) + 4];
00255 }
00256
00257
00258
00259 if (*type__ == 1) {
00260
00261 s[1] = 1. / sqrt((*wy * 3. * *wy + 1.) / (a[a_dim1 + 1] * a[a_dim1 +
00262 1] + 1.));
00263 s[2] = 1. / sqrt((*wy * 3. * *wy + 1.) / (a[(a_dim1 << 1) + 2] * a[(
00264 a_dim1 << 1) + 2] + 1.));
00265 s[3] = 1. / sqrt((*wx * 2. * *wx + 1.) / (a[a_dim1 * 3 + 3] * a[
00266 a_dim1 * 3 + 3] + 1.));
00267 s[4] = 1. / sqrt((*wx * 2. * *wx + 1.) / (a[(a_dim1 << 2) + 4] * a[(
00268 a_dim1 << 2) + 4] + 1.));
00269 s[5] = 1. / sqrt((*wx * 2. * *wx + 1.) / (a[a_dim1 * 5 + 5] * a[
00270 a_dim1 * 5 + 5] + 1.));
00271
00272 dlakf2_(&c__1, &c__4, &a[a_offset], lda, &a[(a_dim1 << 1) + 2], &b[
00273 b_offset], &b[(b_dim1 << 1) + 2], z__, &c__12);
00274 dgesvd_("N", "N", &c__8, &c__8, z__, &c__12, work, &work[8], &c__1, &
00275 work[9], &c__1, &work[10], &c__40, &info);
00276 dif[1] = work[7];
00277
00278 dlakf2_(&c__4, &c__1, &a[a_offset], lda, &a[a_dim1 * 5 + 5], &b[
00279 b_offset], &b[b_dim1 * 5 + 5], z__, &c__12);
00280 dgesvd_("N", "N", &c__8, &c__8, z__, &c__12, work, &work[8], &c__1, &
00281 work[9], &c__1, &work[10], &c__40, &info);
00282 dif[5] = work[7];
00283
00284 } else if (*type__ == 2) {
00285
00286 s[1] = 1. / sqrt(*wy * *wy + .33333333333333331);
00287 s[2] = s[1];
00288 s[3] = 1. / sqrt(*wx * *wx + .5);
00289 s[4] = 1. / sqrt((*wx * 2. * *wx + 1.) / ((*alpha + 1.) * (*alpha +
00290 1.) + 1. + (*beta + 1.) * (*beta + 1.)));
00291 s[5] = s[4];
00292
00293 dlakf2_(&c__2, &c__3, &a[a_offset], lda, &a[a_dim1 * 3 + 3], &b[
00294 b_offset], &b[b_dim1 * 3 + 3], z__, &c__12);
00295 dgesvd_("N", "N", &c__12, &c__12, z__, &c__12, work, &work[12], &c__1,
00296 &work[13], &c__1, &work[14], &c__60, &info);
00297 dif[1] = work[11];
00298
00299 dlakf2_(&c__3, &c__2, &a[a_offset], lda, &a[(a_dim1 << 2) + 4], &b[
00300 b_offset], &b[(b_dim1 << 2) + 4], z__, &c__12);
00301 dgesvd_("N", "N", &c__12, &c__12, z__, &c__12, work, &work[12], &c__1,
00302 &work[13], &c__1, &work[14], &c__60, &info);
00303 dif[5] = work[11];
00304
00305 }
00306
00307 return 0;
00308
00309
00310
00311 }