You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

647 lines
18 KiB

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