Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #include "f2c.h"
00014 #include "blaswrap.h"
00015
00016 int zla_geamv__(integer *trans, integer *m, integer *n,
00017 doublereal *alpha, doublecomplex *a, integer *lda, doublecomplex *x,
00018 integer *incx, doublereal *beta, doublereal *y, integer *incy)
00019 {
00020
00021 integer a_dim1, a_offset, i__1, i__2, i__3;
00022 doublereal d__1, d__2;
00023
00024
00025 double d_imag(doublecomplex *), d_sign(doublereal *, doublereal *);
00026
00027
00028 extern integer ilatrans_(char *);
00029 integer i__, j;
00030 logical symb_zero__;
00031 integer iy, jx, kx, ky, info;
00032 doublereal temp;
00033 integer lenx, leny;
00034 doublereal safe1;
00035 extern doublereal dlamch_(char *);
00036 extern int xerbla_(char *, integer *);
00037
00038
00039
00040
00041
00042
00043
00044
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
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 a_dim1 = *lda;
00166 a_offset = 1 + a_dim1;
00167 a -= a_offset;
00168 --x;
00169 --y;
00170
00171
00172 info = 0;
00173 if (! (*trans == ilatrans_("N") || *trans == ilatrans_("T") || *trans == ilatrans_("C"))) {
00174 info = 1;
00175 } else if (*m < 0) {
00176 info = 2;
00177 } else if (*n < 0) {
00178 info = 3;
00179 } else if (*lda < max(1,*m)) {
00180 info = 6;
00181 } else if (*incx == 0) {
00182 info = 8;
00183 } else if (*incy == 0) {
00184 info = 11;
00185 }
00186 if (info != 0) {
00187 xerbla_("ZLA_GEAMV ", &info);
00188 return 0;
00189 }
00190
00191
00192
00193 if (*m == 0 || *n == 0 || *alpha == 0. && *beta == 1.) {
00194 return 0;
00195 }
00196
00197
00198
00199
00200 if (*trans == ilatrans_("N")) {
00201 lenx = *n;
00202 leny = *m;
00203 } else {
00204 lenx = *m;
00205 leny = *n;
00206 }
00207 if (*incx > 0) {
00208 kx = 1;
00209 } else {
00210 kx = 1 - (lenx - 1) * *incx;
00211 }
00212 if (*incy > 0) {
00213 ky = 1;
00214 } else {
00215 ky = 1 - (leny - 1) * *incy;
00216 }
00217
00218
00219
00220
00221 safe1 = dlamch_("Safe minimum");
00222 safe1 = (*n + 1) * safe1;
00223
00224
00225
00226
00227
00228
00229
00230 iy = ky;
00231 if (*incx == 1) {
00232 i__1 = leny;
00233 for (i__ = 1; i__ <= i__1; ++i__) {
00234 if (*beta == 0.) {
00235 symb_zero__ = TRUE_;
00236 y[iy] = 0.;
00237 } else if (y[iy] == 0.) {
00238 symb_zero__ = TRUE_;
00239 } else {
00240 symb_zero__ = FALSE_;
00241 y[iy] = *beta * (d__1 = y[iy], abs(d__1));
00242 }
00243 if (*alpha != 0.) {
00244 i__2 = lenx;
00245 for (j = 1; j <= i__2; ++j) {
00246 if (*trans == ilatrans_("N")) {
00247 i__3 = i__ + j * a_dim1;
00248 temp = (d__1 = a[i__3].r, abs(d__1)) + (d__2 = d_imag(
00249 &a[i__ + j * a_dim1]), abs(d__2));
00250 } else {
00251 i__3 = j + i__ * a_dim1;
00252 temp = (d__1 = a[i__3].r, abs(d__1)) + (d__2 = d_imag(
00253 &a[j + i__ * a_dim1]), abs(d__2));
00254 }
00255 i__3 = j;
00256 symb_zero__ = symb_zero__ && (x[i__3].r == 0. && x[i__3]
00257 .i == 0. || temp == 0.);
00258 i__3 = j;
00259 y[iy] += *alpha * ((d__1 = x[i__3].r, abs(d__1)) + (d__2 =
00260 d_imag(&x[j]), abs(d__2))) * temp;
00261 }
00262 }
00263 if (! symb_zero__) {
00264 y[iy] += d_sign(&safe1, &y[iy]);
00265 }
00266 iy += *incy;
00267 }
00268 } else {
00269 i__1 = leny;
00270 for (i__ = 1; i__ <= i__1; ++i__) {
00271 if (*beta == 0.) {
00272 symb_zero__ = TRUE_;
00273 y[iy] = 0.;
00274 } else if (y[iy] == 0.) {
00275 symb_zero__ = TRUE_;
00276 } else {
00277 symb_zero__ = FALSE_;
00278 y[iy] = *beta * (d__1 = y[iy], abs(d__1));
00279 }
00280 if (*alpha != 0.) {
00281 jx = kx;
00282 i__2 = lenx;
00283 for (j = 1; j <= i__2; ++j) {
00284 if (*trans == ilatrans_("N")) {
00285 i__3 = i__ + j * a_dim1;
00286 temp = (d__1 = a[i__3].r, abs(d__1)) + (d__2 = d_imag(
00287 &a[i__ + j * a_dim1]), abs(d__2));
00288 } else {
00289 i__3 = j + i__ * a_dim1;
00290 temp = (d__1 = a[i__3].r, abs(d__1)) + (d__2 = d_imag(
00291 &a[j + i__ * a_dim1]), abs(d__2));
00292 }
00293 i__3 = jx;
00294 symb_zero__ = symb_zero__ && (x[i__3].r == 0. && x[i__3]
00295 .i == 0. || temp == 0.);
00296 i__3 = jx;
00297 y[iy] += *alpha * ((d__1 = x[i__3].r, abs(d__1)) + (d__2 =
00298 d_imag(&x[jx]), abs(d__2))) * temp;
00299 jx += *incx;
00300 }
00301 }
00302 if (! symb_zero__) {
00303 y[iy] += d_sign(&safe1, &y[iy]);
00304 }
00305 iy += *incy;
00306 }
00307 }
00308
00309 return 0;
00310
00311
00312
00313 }