00001
00002
00003
00004
00005
00006 #include "f2c.h"
00007 #include "cblasimpexp.h"
00008
00009
00010 int __IMPEXP__ dtrmv_(uplo, trans, diag, n, a, lda, x, incx, uplo_len,
00011 trans_len, diag_len)
00012 char *uplo, *trans, *diag;
00013 integer *n;
00014 doublereal *a;
00015 integer *lda;
00016 doublereal *x;
00017 integer *incx;
00018 ftnlen uplo_len;
00019 ftnlen trans_len;
00020 ftnlen diag_len;
00021 {
00022
00023 integer a_dim1, a_offset, i__1, i__2;
00024
00025
00026 static integer info;
00027 static doublereal temp;
00028 static integer i, j;
00029 extern logical lsame_();
00030 static integer ix, jx, kx;
00031 extern int xerbla_();
00032 static logical nounit;
00033
00034
00035
00036
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 a_dim1 = *lda;
00155 a_offset = a_dim1 + 1;
00156 a -= a_offset;
00157 --x;
00158
00159
00160 info = 0;
00161 if (! lsame_(uplo, "U", 1L, 1L) && ! lsame_(uplo, "L", 1L, 1L)) {
00162 info = 1;
00163 } else if (! lsame_(trans, "N", 1L, 1L) && ! lsame_(trans, "T", 1L, 1L) &&
00164 ! lsame_(trans, "C", 1L, 1L)) {
00165 info = 2;
00166 } else if (! lsame_(diag, "U", 1L, 1L) && ! lsame_(diag, "N", 1L, 1L)) {
00167 info = 3;
00168 } else if (*n < 0) {
00169 info = 4;
00170 } else if (*lda < max(1,*n)) {
00171 info = 6;
00172 } else if (*incx == 0) {
00173 info = 8;
00174 }
00175 if (info != 0) {
00176 xerbla_("DTRMV ", &info, 6L);
00177 return 0;
00178 }
00179
00180
00181
00182 if (*n == 0) {
00183 return 0;
00184 }
00185
00186 nounit = lsame_(diag, "N", 1L, 1L);
00187
00188
00189
00190
00191 if (*incx <= 0) {
00192 kx = 1 - (*n - 1) * *incx;
00193 } else if (*incx != 1) {
00194 kx = 1;
00195 }
00196
00197
00198
00199
00200 if (lsame_(trans, "N", 1L, 1L)) {
00201
00202
00203
00204 if (lsame_(uplo, "U", 1L, 1L)) {
00205 if (*incx == 1) {
00206 i__1 = *n;
00207 for (j = 1; j <= i__1; ++j) {
00208 if (x[j] != 0.) {
00209 temp = x[j];
00210 i__2 = j - 1;
00211 for (i = 1; i <= i__2; ++i) {
00212 x[i] += temp * a[i + j * a_dim1];
00213
00214 }
00215 if (nounit) {
00216 x[j] *= a[j + j * a_dim1];
00217 }
00218 }
00219
00220 }
00221 } else {
00222 jx = kx;
00223 i__1 = *n;
00224 for (j = 1; j <= i__1; ++j) {
00225 if (x[jx] != 0.) {
00226 temp = x[jx];
00227 ix = kx;
00228 i__2 = j - 1;
00229 for (i = 1; i <= i__2; ++i) {
00230 x[ix] += temp * a[i + j * a_dim1];
00231 ix += *incx;
00232
00233 }
00234 if (nounit) {
00235 x[jx] *= a[j + j * a_dim1];
00236 }
00237 }
00238 jx += *incx;
00239
00240 }
00241 }
00242 } else {
00243 if (*incx == 1) {
00244 for (j = *n; j >= 1; --j) {
00245 if (x[j] != 0.) {
00246 temp = x[j];
00247 i__1 = j + 1;
00248 for (i = *n; i >= i__1; --i) {
00249 x[i] += temp * a[i + j * a_dim1];
00250
00251 }
00252 if (nounit) {
00253 x[j] *= a[j + j * a_dim1];
00254 }
00255 }
00256
00257 }
00258 } else {
00259 kx += (*n - 1) * *incx;
00260 jx = kx;
00261 for (j = *n; j >= 1; --j) {
00262 if (x[jx] != 0.) {
00263 temp = x[jx];
00264 ix = kx;
00265 i__1 = j + 1;
00266 for (i = *n; i >= i__1; --i) {
00267 x[ix] += temp * a[i + j * a_dim1];
00268 ix -= *incx;
00269
00270 }
00271 if (nounit) {
00272 x[jx] *= a[j + j * a_dim1];
00273 }
00274 }
00275 jx -= *incx;
00276
00277 }
00278 }
00279 }
00280 } else {
00281
00282
00283
00284 if (lsame_(uplo, "U", 1L, 1L)) {
00285 if (*incx == 1) {
00286 for (j = *n; j >= 1; --j) {
00287 temp = x[j];
00288 if (nounit) {
00289 temp *= a[j + j * a_dim1];
00290 }
00291 for (i = j - 1; i >= 1; --i) {
00292 temp += a[i + j * a_dim1] * x[i];
00293
00294 }
00295 x[j] = temp;
00296
00297 }
00298 } else {
00299 jx = kx + (*n - 1) * *incx;
00300 for (j = *n; j >= 1; --j) {
00301 temp = x[jx];
00302 ix = jx;
00303 if (nounit) {
00304 temp *= a[j + j * a_dim1];
00305 }
00306 for (i = j - 1; i >= 1; --i) {
00307 ix -= *incx;
00308 temp += a[i + j * a_dim1] * x[ix];
00309
00310 }
00311 x[jx] = temp;
00312 jx -= *incx;
00313
00314 }
00315 }
00316 } else {
00317 if (*incx == 1) {
00318 i__1 = *n;
00319 for (j = 1; j <= i__1; ++j) {
00320 temp = x[j];
00321 if (nounit) {
00322 temp *= a[j + j * a_dim1];
00323 }
00324 i__2 = *n;
00325 for (i = j + 1; i <= i__2; ++i) {
00326 temp += a[i + j * a_dim1] * x[i];
00327
00328 }
00329 x[j] = temp;
00330
00331 }
00332 } else {
00333 jx = kx;
00334 i__1 = *n;
00335 for (j = 1; j <= i__1; ++j) {
00336 temp = x[jx];
00337 ix = jx;
00338 if (nounit) {
00339 temp *= a[j + j * a_dim1];
00340 }
00341 i__2 = *n;
00342 for (i = j + 1; i <= i__2; ++i) {
00343 ix += *incx;
00344 temp += a[i + j * a_dim1] * x[ix];
00345
00346 }
00347 x[jx] = temp;
00348 jx += *incx;
00349
00350 }
00351 }
00352 }
00353 }
00354
00355 return 0;
00356
00357
00358
00359 }
00360