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