ztbsv.c 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611
  1. /* ztbsv.f -- translated by f2c (version 20061008).
  2. You must link the resulting object file with libf2c:
  3. on Microsoft Windows system, link with libf2c.lib;
  4. on Linux or Unix systems, link with .../path/to/libf2c.a -lm
  5. or, if you install libf2c.a in a standard place, with -lf2c -lm
  6. -- in that order, at the end of the command line, as in
  7. cc *.o -lf2c -lm
  8. Source for libf2c is in /netlib/f2c/libf2c.zip, e.g.,
  9. http://www.netlib.org/f2c/libf2c.zip
  10. */
  11. #include "f2c.h"
  12. #include "blaswrap.h"
  13. /* Subroutine */ int ztbsv_(char *uplo, char *trans, char *diag, integer *n,
  14. integer *k, doublecomplex *a, integer *lda, doublecomplex *x, integer
  15. *incx)
  16. {
  17. /* System generated locals */
  18. integer a_dim1, a_offset, i__1, i__2, i__3, i__4, i__5;
  19. doublecomplex z__1, z__2, z__3;
  20. /* Builtin functions */
  21. void z_div(doublecomplex *, doublecomplex *, doublecomplex *), d_cnjg(
  22. doublecomplex *, doublecomplex *);
  23. /* Local variables */
  24. integer i__, j, l, ix, jx, kx, info;
  25. doublecomplex temp;
  26. extern logical lsame_(char *, char *);
  27. integer kplus1;
  28. extern /* Subroutine */ int xerbla_(char *, integer *);
  29. logical noconj, nounit;
  30. /* .. Scalar Arguments .. */
  31. /* .. */
  32. /* .. Array Arguments .. */
  33. /* .. */
  34. /* Purpose */
  35. /* ======= */
  36. /* ZTBSV solves one of the systems of equations */
  37. /* A*x = b, or A'*x = b, or conjg( A' )*x = b, */
  38. /* where b and x are n element vectors and A is an n by n unit, or */
  39. /* non-unit, upper or lower triangular band matrix, with ( k + 1 ) */
  40. /* diagonals. */
  41. /* No test for singularity or near-singularity is included in this */
  42. /* routine. Such tests must be performed before calling this routine. */
  43. /* Arguments */
  44. /* ========== */
  45. /* UPLO - CHARACTER*1. */
  46. /* On entry, UPLO specifies whether the matrix is an upper or */
  47. /* lower triangular matrix as follows: */
  48. /* UPLO = 'U' or 'u' A is an upper triangular matrix. */
  49. /* UPLO = 'L' or 'l' A is a lower triangular matrix. */
  50. /* Unchanged on exit. */
  51. /* TRANS - CHARACTER*1. */
  52. /* On entry, TRANS specifies the equations to be solved as */
  53. /* follows: */
  54. /* TRANS = 'N' or 'n' A*x = b. */
  55. /* TRANS = 'T' or 't' A'*x = b. */
  56. /* TRANS = 'C' or 'c' conjg( A' )*x = b. */
  57. /* Unchanged on exit. */
  58. /* DIAG - CHARACTER*1. */
  59. /* On entry, DIAG specifies whether or not A is unit */
  60. /* triangular as follows: */
  61. /* DIAG = 'U' or 'u' A is assumed to be unit triangular. */
  62. /* DIAG = 'N' or 'n' A is not assumed to be unit */
  63. /* triangular. */
  64. /* Unchanged on exit. */
  65. /* N - INTEGER. */
  66. /* On entry, N specifies the order of the matrix A. */
  67. /* N must be at least zero. */
  68. /* Unchanged on exit. */
  69. /* K - INTEGER. */
  70. /* On entry with UPLO = 'U' or 'u', K specifies the number of */
  71. /* super-diagonals of the matrix A. */
  72. /* On entry with UPLO = 'L' or 'l', K specifies the number of */
  73. /* sub-diagonals of the matrix A. */
  74. /* K must satisfy 0 .le. K. */
  75. /* Unchanged on exit. */
  76. /* A - COMPLEX*16 array of DIMENSION ( LDA, n ). */
  77. /* Before entry with UPLO = 'U' or 'u', the leading ( k + 1 ) */
  78. /* by n part of the array A must contain the upper triangular */
  79. /* band part of the matrix of coefficients, supplied column by */
  80. /* column, with the leading diagonal of the matrix in row */
  81. /* ( k + 1 ) of the array, the first super-diagonal starting at */
  82. /* position 2 in row k, and so on. The top left k by k triangle */
  83. /* of the array A is not referenced. */
  84. /* The following program segment will transfer an upper */
  85. /* triangular band matrix from conventional full matrix storage */
  86. /* to band storage: */
  87. /* DO 20, J = 1, N */
  88. /* M = K + 1 - J */
  89. /* DO 10, I = MAX( 1, J - K ), J */
  90. /* A( M + I, J ) = matrix( I, J ) */
  91. /* 10 CONTINUE */
  92. /* 20 CONTINUE */
  93. /* Before entry with UPLO = 'L' or 'l', the leading ( k + 1 ) */
  94. /* by n part of the array A must contain the lower triangular */
  95. /* band part of the matrix of coefficients, supplied column by */
  96. /* column, with the leading diagonal of the matrix in row 1 of */
  97. /* the array, the first sub-diagonal starting at position 1 in */
  98. /* row 2, and so on. The bottom right k by k triangle of the */
  99. /* array A is not referenced. */
  100. /* The following program segment will transfer a lower */
  101. /* triangular band matrix from conventional full matrix storage */
  102. /* to band storage: */
  103. /* DO 20, J = 1, N */
  104. /* M = 1 - J */
  105. /* DO 10, I = J, MIN( N, J + K ) */
  106. /* A( M + I, J ) = matrix( I, J ) */
  107. /* 10 CONTINUE */
  108. /* 20 CONTINUE */
  109. /* Note that when DIAG = 'U' or 'u' the elements of the array A */
  110. /* corresponding to the diagonal elements of the matrix are not */
  111. /* referenced, but are assumed to be unity. */
  112. /* Unchanged on exit. */
  113. /* LDA - INTEGER. */
  114. /* On entry, LDA specifies the first dimension of A as declared */
  115. /* in the calling (sub) program. LDA must be at least */
  116. /* ( k + 1 ). */
  117. /* Unchanged on exit. */
  118. /* X - COMPLEX*16 array of dimension at least */
  119. /* ( 1 + ( n - 1 )*abs( INCX ) ). */
  120. /* Before entry, the incremented array X must contain the n */
  121. /* element right-hand side vector b. On exit, X is overwritten */
  122. /* with the solution vector x. */
  123. /* INCX - INTEGER. */
  124. /* On entry, INCX specifies the increment for the elements of */
  125. /* X. INCX must not be zero. */
  126. /* Unchanged on exit. */
  127. /* Level 2 Blas routine. */
  128. /* -- Written on 22-October-1986. */
  129. /* Jack Dongarra, Argonne National Lab. */
  130. /* Jeremy Du Croz, Nag Central Office. */
  131. /* Sven Hammarling, Nag Central Office. */
  132. /* Richard Hanson, Sandia National Labs. */
  133. /* .. Parameters .. */
  134. /* .. */
  135. /* .. Local Scalars .. */
  136. /* .. */
  137. /* .. External Functions .. */
  138. /* .. */
  139. /* .. External Subroutines .. */
  140. /* .. */
  141. /* .. Intrinsic Functions .. */
  142. /* .. */
  143. /* Test the input parameters. */
  144. /* Parameter adjustments */
  145. a_dim1 = *lda;
  146. a_offset = 1 + a_dim1;
  147. a -= a_offset;
  148. --x;
  149. /* Function Body */
  150. info = 0;
  151. if (! lsame_(uplo, "U") && ! lsame_(uplo, "L")) {
  152. info = 1;
  153. } else if (! lsame_(trans, "N") && ! lsame_(trans,
  154. "T") && ! lsame_(trans, "C")) {
  155. info = 2;
  156. } else if (! lsame_(diag, "U") && ! lsame_(diag,
  157. "N")) {
  158. info = 3;
  159. } else if (*n < 0) {
  160. info = 4;
  161. } else if (*k < 0) {
  162. info = 5;
  163. } else if (*lda < *k + 1) {
  164. info = 7;
  165. } else if (*incx == 0) {
  166. info = 9;
  167. }
  168. if (info != 0) {
  169. xerbla_("ZTBSV ", &info);
  170. return 0;
  171. }
  172. /* Quick return if possible. */
  173. if (*n == 0) {
  174. return 0;
  175. }
  176. noconj = lsame_(trans, "T");
  177. nounit = lsame_(diag, "N");
  178. /* Set up the start point in X if the increment is not unity. This */
  179. /* will be ( N - 1 )*INCX too small for descending loops. */
  180. if (*incx <= 0) {
  181. kx = 1 - (*n - 1) * *incx;
  182. } else if (*incx != 1) {
  183. kx = 1;
  184. }
  185. /* Start the operations. In this version the elements of A are */
  186. /* accessed by sequentially with one pass through A. */
  187. if (lsame_(trans, "N")) {
  188. /* Form x := inv( A )*x. */
  189. if (lsame_(uplo, "U")) {
  190. kplus1 = *k + 1;
  191. if (*incx == 1) {
  192. for (j = *n; j >= 1; --j) {
  193. i__1 = j;
  194. if (x[i__1].r != 0. || x[i__1].i != 0.) {
  195. l = kplus1 - j;
  196. if (nounit) {
  197. i__1 = j;
  198. z_div(&z__1, &x[j], &a[kplus1 + j * a_dim1]);
  199. x[i__1].r = z__1.r, x[i__1].i = z__1.i;
  200. }
  201. i__1 = j;
  202. temp.r = x[i__1].r, temp.i = x[i__1].i;
  203. /* Computing MAX */
  204. i__2 = 1, i__3 = j - *k;
  205. i__1 = max(i__2,i__3);
  206. for (i__ = j - 1; i__ >= i__1; --i__) {
  207. i__2 = i__;
  208. i__3 = i__;
  209. i__4 = l + i__ + j * a_dim1;
  210. z__2.r = temp.r * a[i__4].r - temp.i * a[i__4].i,
  211. z__2.i = temp.r * a[i__4].i + temp.i * a[
  212. i__4].r;
  213. z__1.r = x[i__3].r - z__2.r, z__1.i = x[i__3].i -
  214. z__2.i;
  215. x[i__2].r = z__1.r, x[i__2].i = z__1.i;
  216. /* L10: */
  217. }
  218. }
  219. /* L20: */
  220. }
  221. } else {
  222. kx += (*n - 1) * *incx;
  223. jx = kx;
  224. for (j = *n; j >= 1; --j) {
  225. kx -= *incx;
  226. i__1 = jx;
  227. if (x[i__1].r != 0. || x[i__1].i != 0.) {
  228. ix = kx;
  229. l = kplus1 - j;
  230. if (nounit) {
  231. i__1 = jx;
  232. z_div(&z__1, &x[jx], &a[kplus1 + j * a_dim1]);
  233. x[i__1].r = z__1.r, x[i__1].i = z__1.i;
  234. }
  235. i__1 = jx;
  236. temp.r = x[i__1].r, temp.i = x[i__1].i;
  237. /* Computing MAX */
  238. i__2 = 1, i__3 = j - *k;
  239. i__1 = max(i__2,i__3);
  240. for (i__ = j - 1; i__ >= i__1; --i__) {
  241. i__2 = ix;
  242. i__3 = ix;
  243. i__4 = l + i__ + j * a_dim1;
  244. z__2.r = temp.r * a[i__4].r - temp.i * a[i__4].i,
  245. z__2.i = temp.r * a[i__4].i + temp.i * a[
  246. i__4].r;
  247. z__1.r = x[i__3].r - z__2.r, z__1.i = x[i__3].i -
  248. z__2.i;
  249. x[i__2].r = z__1.r, x[i__2].i = z__1.i;
  250. ix -= *incx;
  251. /* L30: */
  252. }
  253. }
  254. jx -= *incx;
  255. /* L40: */
  256. }
  257. }
  258. } else {
  259. if (*incx == 1) {
  260. i__1 = *n;
  261. for (j = 1; j <= i__1; ++j) {
  262. i__2 = j;
  263. if (x[i__2].r != 0. || x[i__2].i != 0.) {
  264. l = 1 - j;
  265. if (nounit) {
  266. i__2 = j;
  267. z_div(&z__1, &x[j], &a[j * a_dim1 + 1]);
  268. x[i__2].r = z__1.r, x[i__2].i = z__1.i;
  269. }
  270. i__2 = j;
  271. temp.r = x[i__2].r, temp.i = x[i__2].i;
  272. /* Computing MIN */
  273. i__3 = *n, i__4 = j + *k;
  274. i__2 = min(i__3,i__4);
  275. for (i__ = j + 1; i__ <= i__2; ++i__) {
  276. i__3 = i__;
  277. i__4 = i__;
  278. i__5 = l + i__ + j * a_dim1;
  279. z__2.r = temp.r * a[i__5].r - temp.i * a[i__5].i,
  280. z__2.i = temp.r * a[i__5].i + temp.i * a[
  281. i__5].r;
  282. z__1.r = x[i__4].r - z__2.r, z__1.i = x[i__4].i -
  283. z__2.i;
  284. x[i__3].r = z__1.r, x[i__3].i = z__1.i;
  285. /* L50: */
  286. }
  287. }
  288. /* L60: */
  289. }
  290. } else {
  291. jx = kx;
  292. i__1 = *n;
  293. for (j = 1; j <= i__1; ++j) {
  294. kx += *incx;
  295. i__2 = jx;
  296. if (x[i__2].r != 0. || x[i__2].i != 0.) {
  297. ix = kx;
  298. l = 1 - j;
  299. if (nounit) {
  300. i__2 = jx;
  301. z_div(&z__1, &x[jx], &a[j * a_dim1 + 1]);
  302. x[i__2].r = z__1.r, x[i__2].i = z__1.i;
  303. }
  304. i__2 = jx;
  305. temp.r = x[i__2].r, temp.i = x[i__2].i;
  306. /* Computing MIN */
  307. i__3 = *n, i__4 = j + *k;
  308. i__2 = min(i__3,i__4);
  309. for (i__ = j + 1; i__ <= i__2; ++i__) {
  310. i__3 = ix;
  311. i__4 = ix;
  312. i__5 = l + i__ + j * a_dim1;
  313. z__2.r = temp.r * a[i__5].r - temp.i * a[i__5].i,
  314. z__2.i = temp.r * a[i__5].i + temp.i * a[
  315. i__5].r;
  316. z__1.r = x[i__4].r - z__2.r, z__1.i = x[i__4].i -
  317. z__2.i;
  318. x[i__3].r = z__1.r, x[i__3].i = z__1.i;
  319. ix += *incx;
  320. /* L70: */
  321. }
  322. }
  323. jx += *incx;
  324. /* L80: */
  325. }
  326. }
  327. }
  328. } else {
  329. /* Form x := inv( A' )*x or x := inv( conjg( A') )*x. */
  330. if (lsame_(uplo, "U")) {
  331. kplus1 = *k + 1;
  332. if (*incx == 1) {
  333. i__1 = *n;
  334. for (j = 1; j <= i__1; ++j) {
  335. i__2 = j;
  336. temp.r = x[i__2].r, temp.i = x[i__2].i;
  337. l = kplus1 - j;
  338. if (noconj) {
  339. /* Computing MAX */
  340. i__2 = 1, i__3 = j - *k;
  341. i__4 = j - 1;
  342. for (i__ = max(i__2,i__3); i__ <= i__4; ++i__) {
  343. i__2 = l + i__ + j * a_dim1;
  344. i__3 = i__;
  345. z__2.r = a[i__2].r * x[i__3].r - a[i__2].i * x[
  346. i__3].i, z__2.i = a[i__2].r * x[i__3].i +
  347. a[i__2].i * x[i__3].r;
  348. z__1.r = temp.r - z__2.r, z__1.i = temp.i -
  349. z__2.i;
  350. temp.r = z__1.r, temp.i = z__1.i;
  351. /* L90: */
  352. }
  353. if (nounit) {
  354. z_div(&z__1, &temp, &a[kplus1 + j * a_dim1]);
  355. temp.r = z__1.r, temp.i = z__1.i;
  356. }
  357. } else {
  358. /* Computing MAX */
  359. i__4 = 1, i__2 = j - *k;
  360. i__3 = j - 1;
  361. for (i__ = max(i__4,i__2); i__ <= i__3; ++i__) {
  362. d_cnjg(&z__3, &a[l + i__ + j * a_dim1]);
  363. i__4 = i__;
  364. z__2.r = z__3.r * x[i__4].r - z__3.i * x[i__4].i,
  365. z__2.i = z__3.r * x[i__4].i + z__3.i * x[
  366. i__4].r;
  367. z__1.r = temp.r - z__2.r, z__1.i = temp.i -
  368. z__2.i;
  369. temp.r = z__1.r, temp.i = z__1.i;
  370. /* L100: */
  371. }
  372. if (nounit) {
  373. d_cnjg(&z__2, &a[kplus1 + j * a_dim1]);
  374. z_div(&z__1, &temp, &z__2);
  375. temp.r = z__1.r, temp.i = z__1.i;
  376. }
  377. }
  378. i__3 = j;
  379. x[i__3].r = temp.r, x[i__3].i = temp.i;
  380. /* L110: */
  381. }
  382. } else {
  383. jx = kx;
  384. i__1 = *n;
  385. for (j = 1; j <= i__1; ++j) {
  386. i__3 = jx;
  387. temp.r = x[i__3].r, temp.i = x[i__3].i;
  388. ix = kx;
  389. l = kplus1 - j;
  390. if (noconj) {
  391. /* Computing MAX */
  392. i__3 = 1, i__4 = j - *k;
  393. i__2 = j - 1;
  394. for (i__ = max(i__3,i__4); i__ <= i__2; ++i__) {
  395. i__3 = l + i__ + j * a_dim1;
  396. i__4 = ix;
  397. z__2.r = a[i__3].r * x[i__4].r - a[i__3].i * x[
  398. i__4].i, z__2.i = a[i__3].r * x[i__4].i +
  399. a[i__3].i * x[i__4].r;
  400. z__1.r = temp.r - z__2.r, z__1.i = temp.i -
  401. z__2.i;
  402. temp.r = z__1.r, temp.i = z__1.i;
  403. ix += *incx;
  404. /* L120: */
  405. }
  406. if (nounit) {
  407. z_div(&z__1, &temp, &a[kplus1 + j * a_dim1]);
  408. temp.r = z__1.r, temp.i = z__1.i;
  409. }
  410. } else {
  411. /* Computing MAX */
  412. i__2 = 1, i__3 = j - *k;
  413. i__4 = j - 1;
  414. for (i__ = max(i__2,i__3); i__ <= i__4; ++i__) {
  415. d_cnjg(&z__3, &a[l + i__ + j * a_dim1]);
  416. i__2 = ix;
  417. z__2.r = z__3.r * x[i__2].r - z__3.i * x[i__2].i,
  418. z__2.i = z__3.r * x[i__2].i + z__3.i * x[
  419. i__2].r;
  420. z__1.r = temp.r - z__2.r, z__1.i = temp.i -
  421. z__2.i;
  422. temp.r = z__1.r, temp.i = z__1.i;
  423. ix += *incx;
  424. /* L130: */
  425. }
  426. if (nounit) {
  427. d_cnjg(&z__2, &a[kplus1 + j * a_dim1]);
  428. z_div(&z__1, &temp, &z__2);
  429. temp.r = z__1.r, temp.i = z__1.i;
  430. }
  431. }
  432. i__4 = jx;
  433. x[i__4].r = temp.r, x[i__4].i = temp.i;
  434. jx += *incx;
  435. if (j > *k) {
  436. kx += *incx;
  437. }
  438. /* L140: */
  439. }
  440. }
  441. } else {
  442. if (*incx == 1) {
  443. for (j = *n; j >= 1; --j) {
  444. i__1 = j;
  445. temp.r = x[i__1].r, temp.i = x[i__1].i;
  446. l = 1 - j;
  447. if (noconj) {
  448. /* Computing MIN */
  449. i__1 = *n, i__4 = j + *k;
  450. i__2 = j + 1;
  451. for (i__ = min(i__1,i__4); i__ >= i__2; --i__) {
  452. i__1 = l + i__ + j * a_dim1;
  453. i__4 = i__;
  454. z__2.r = a[i__1].r * x[i__4].r - a[i__1].i * x[
  455. i__4].i, z__2.i = a[i__1].r * x[i__4].i +
  456. a[i__1].i * x[i__4].r;
  457. z__1.r = temp.r - z__2.r, z__1.i = temp.i -
  458. z__2.i;
  459. temp.r = z__1.r, temp.i = z__1.i;
  460. /* L150: */
  461. }
  462. if (nounit) {
  463. z_div(&z__1, &temp, &a[j * a_dim1 + 1]);
  464. temp.r = z__1.r, temp.i = z__1.i;
  465. }
  466. } else {
  467. /* Computing MIN */
  468. i__2 = *n, i__1 = j + *k;
  469. i__4 = j + 1;
  470. for (i__ = min(i__2,i__1); i__ >= i__4; --i__) {
  471. d_cnjg(&z__3, &a[l + i__ + j * a_dim1]);
  472. i__2 = i__;
  473. z__2.r = z__3.r * x[i__2].r - z__3.i * x[i__2].i,
  474. z__2.i = z__3.r * x[i__2].i + z__3.i * x[
  475. i__2].r;
  476. z__1.r = temp.r - z__2.r, z__1.i = temp.i -
  477. z__2.i;
  478. temp.r = z__1.r, temp.i = z__1.i;
  479. /* L160: */
  480. }
  481. if (nounit) {
  482. d_cnjg(&z__2, &a[j * a_dim1 + 1]);
  483. z_div(&z__1, &temp, &z__2);
  484. temp.r = z__1.r, temp.i = z__1.i;
  485. }
  486. }
  487. i__4 = j;
  488. x[i__4].r = temp.r, x[i__4].i = temp.i;
  489. /* L170: */
  490. }
  491. } else {
  492. kx += (*n - 1) * *incx;
  493. jx = kx;
  494. for (j = *n; j >= 1; --j) {
  495. i__4 = jx;
  496. temp.r = x[i__4].r, temp.i = x[i__4].i;
  497. ix = kx;
  498. l = 1 - j;
  499. if (noconj) {
  500. /* Computing MIN */
  501. i__4 = *n, i__2 = j + *k;
  502. i__1 = j + 1;
  503. for (i__ = min(i__4,i__2); i__ >= i__1; --i__) {
  504. i__4 = l + i__ + j * a_dim1;
  505. i__2 = ix;
  506. z__2.r = a[i__4].r * x[i__2].r - a[i__4].i * x[
  507. i__2].i, z__2.i = a[i__4].r * x[i__2].i +
  508. a[i__4].i * x[i__2].r;
  509. z__1.r = temp.r - z__2.r, z__1.i = temp.i -
  510. z__2.i;
  511. temp.r = z__1.r, temp.i = z__1.i;
  512. ix -= *incx;
  513. /* L180: */
  514. }
  515. if (nounit) {
  516. z_div(&z__1, &temp, &a[j * a_dim1 + 1]);
  517. temp.r = z__1.r, temp.i = z__1.i;
  518. }
  519. } else {
  520. /* Computing MIN */
  521. i__1 = *n, i__4 = j + *k;
  522. i__2 = j + 1;
  523. for (i__ = min(i__1,i__4); i__ >= i__2; --i__) {
  524. d_cnjg(&z__3, &a[l + i__ + j * a_dim1]);
  525. i__1 = ix;
  526. z__2.r = z__3.r * x[i__1].r - z__3.i * x[i__1].i,
  527. z__2.i = z__3.r * x[i__1].i + z__3.i * x[
  528. i__1].r;
  529. z__1.r = temp.r - z__2.r, z__1.i = temp.i -
  530. z__2.i;
  531. temp.r = z__1.r, temp.i = z__1.i;
  532. ix -= *incx;
  533. /* L190: */
  534. }
  535. if (nounit) {
  536. d_cnjg(&z__2, &a[j * a_dim1 + 1]);
  537. z_div(&z__1, &temp, &z__2);
  538. temp.r = z__1.r, temp.i = z__1.i;
  539. }
  540. }
  541. i__2 = jx;
  542. x[i__2].r = temp.r, x[i__2].i = temp.i;
  543. jx -= *incx;
  544. if (*n - j >= *k) {
  545. kx -= *incx;
  546. }
  547. /* L200: */
  548. }
  549. }
  550. }
  551. }
  552. return 0;
  553. /* End of ZTBSV . */
  554. } /* ztbsv_ */