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 dlagtm_(char *trans, integer *n, integer *nrhs,
00017 doublereal *alpha, doublereal *dl, doublereal *d__, doublereal *du,
00018 doublereal *x, integer *ldx, doublereal *beta, doublereal *b, integer
00019 *ldb)
00020 {
00021
00022 integer b_dim1, b_offset, x_dim1, x_offset, i__1, i__2;
00023
00024
00025 integer i__, j;
00026 extern logical lsame_(char *, char *);
00027
00028
00029
00030
00031
00032
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 --dl;
00107 --d__;
00108 --du;
00109 x_dim1 = *ldx;
00110 x_offset = 1 + x_dim1;
00111 x -= x_offset;
00112 b_dim1 = *ldb;
00113 b_offset = 1 + b_dim1;
00114 b -= b_offset;
00115
00116
00117 if (*n == 0) {
00118 return 0;
00119 }
00120
00121
00122
00123 if (*beta == 0.) {
00124 i__1 = *nrhs;
00125 for (j = 1; j <= i__1; ++j) {
00126 i__2 = *n;
00127 for (i__ = 1; i__ <= i__2; ++i__) {
00128 b[i__ + j * b_dim1] = 0.;
00129
00130 }
00131
00132 }
00133 } else if (*beta == -1.) {
00134 i__1 = *nrhs;
00135 for (j = 1; j <= i__1; ++j) {
00136 i__2 = *n;
00137 for (i__ = 1; i__ <= i__2; ++i__) {
00138 b[i__ + j * b_dim1] = -b[i__ + j * b_dim1];
00139
00140 }
00141
00142 }
00143 }
00144
00145 if (*alpha == 1.) {
00146 if (lsame_(trans, "N")) {
00147
00148
00149
00150 i__1 = *nrhs;
00151 for (j = 1; j <= i__1; ++j) {
00152 if (*n == 1) {
00153 b[j * b_dim1 + 1] += d__[1] * x[j * x_dim1 + 1];
00154 } else {
00155 b[j * b_dim1 + 1] = b[j * b_dim1 + 1] + d__[1] * x[j *
00156 x_dim1 + 1] + du[1] * x[j * x_dim1 + 2];
00157 b[*n + j * b_dim1] = b[*n + j * b_dim1] + dl[*n - 1] * x[*
00158 n - 1 + j * x_dim1] + d__[*n] * x[*n + j * x_dim1]
00159 ;
00160 i__2 = *n - 1;
00161 for (i__ = 2; i__ <= i__2; ++i__) {
00162 b[i__ + j * b_dim1] = b[i__ + j * b_dim1] + dl[i__ -
00163 1] * x[i__ - 1 + j * x_dim1] + d__[i__] * x[
00164 i__ + j * x_dim1] + du[i__] * x[i__ + 1 + j *
00165 x_dim1];
00166
00167 }
00168 }
00169
00170 }
00171 } else {
00172
00173
00174
00175 i__1 = *nrhs;
00176 for (j = 1; j <= i__1; ++j) {
00177 if (*n == 1) {
00178 b[j * b_dim1 + 1] += d__[1] * x[j * x_dim1 + 1];
00179 } else {
00180 b[j * b_dim1 + 1] = b[j * b_dim1 + 1] + d__[1] * x[j *
00181 x_dim1 + 1] + dl[1] * x[j * x_dim1 + 2];
00182 b[*n + j * b_dim1] = b[*n + j * b_dim1] + du[*n - 1] * x[*
00183 n - 1 + j * x_dim1] + d__[*n] * x[*n + j * x_dim1]
00184 ;
00185 i__2 = *n - 1;
00186 for (i__ = 2; i__ <= i__2; ++i__) {
00187 b[i__ + j * b_dim1] = b[i__ + j * b_dim1] + du[i__ -
00188 1] * x[i__ - 1 + j * x_dim1] + d__[i__] * x[
00189 i__ + j * x_dim1] + dl[i__] * x[i__ + 1 + j *
00190 x_dim1];
00191
00192 }
00193 }
00194
00195 }
00196 }
00197 } else if (*alpha == -1.) {
00198 if (lsame_(trans, "N")) {
00199
00200
00201
00202 i__1 = *nrhs;
00203 for (j = 1; j <= i__1; ++j) {
00204 if (*n == 1) {
00205 b[j * b_dim1 + 1] -= d__[1] * x[j * x_dim1 + 1];
00206 } else {
00207 b[j * b_dim1 + 1] = b[j * b_dim1 + 1] - d__[1] * x[j *
00208 x_dim1 + 1] - du[1] * x[j * x_dim1 + 2];
00209 b[*n + j * b_dim1] = b[*n + j * b_dim1] - dl[*n - 1] * x[*
00210 n - 1 + j * x_dim1] - d__[*n] * x[*n + j * x_dim1]
00211 ;
00212 i__2 = *n - 1;
00213 for (i__ = 2; i__ <= i__2; ++i__) {
00214 b[i__ + j * b_dim1] = b[i__ + j * b_dim1] - dl[i__ -
00215 1] * x[i__ - 1 + j * x_dim1] - d__[i__] * x[
00216 i__ + j * x_dim1] - du[i__] * x[i__ + 1 + j *
00217 x_dim1];
00218
00219 }
00220 }
00221
00222 }
00223 } else {
00224
00225
00226
00227 i__1 = *nrhs;
00228 for (j = 1; j <= i__1; ++j) {
00229 if (*n == 1) {
00230 b[j * b_dim1 + 1] -= d__[1] * x[j * x_dim1 + 1];
00231 } else {
00232 b[j * b_dim1 + 1] = b[j * b_dim1 + 1] - d__[1] * x[j *
00233 x_dim1 + 1] - dl[1] * x[j * x_dim1 + 2];
00234 b[*n + j * b_dim1] = b[*n + j * b_dim1] - du[*n - 1] * x[*
00235 n - 1 + j * x_dim1] - d__[*n] * x[*n + j * x_dim1]
00236 ;
00237 i__2 = *n - 1;
00238 for (i__ = 2; i__ <= i__2; ++i__) {
00239 b[i__ + j * b_dim1] = b[i__ + j * b_dim1] - du[i__ -
00240 1] * x[i__ - 1 + j * x_dim1] - d__[i__] * x[
00241 i__ + j * x_dim1] - dl[i__] * x[i__ + 1 + j *
00242 x_dim1];
00243
00244 }
00245 }
00246
00247 }
00248 }
00249 }
00250 return 0;
00251
00252
00253
00254 }