Add some basic letsimp tests based on bug #3950
[maxima.git] / share / lapack / blas / ztbmv.lisp
blobbeac41c14a5b084ea360915513df7bce37d8825e
1 ;;; Compiled by f2cl version:
2 ;;; ("f2cl1.l,v 2edcbd958861 2012/05/30 03:34:52 toy $"
3 ;;; "f2cl2.l,v 96616d88fb7e 2008/02/22 22:19:34 rtoy $"
4 ;;; "f2cl3.l,v 96616d88fb7e 2008/02/22 22:19:34 rtoy $"
5 ;;; "f2cl4.l,v 96616d88fb7e 2008/02/22 22:19:34 rtoy $"
6 ;;; "f2cl5.l,v 3fe93de3be82 2012/05/06 02:17:14 toy $"
7 ;;; "f2cl6.l,v 1d5cbacbb977 2008/08/24 00:56:27 rtoy $"
8 ;;; "macros.l,v 3fe93de3be82 2012/05/06 02:17:14 toy $")
10 ;;; Using Lisp CMU Common Lisp 20d (20D Unicode)
11 ;;;
12 ;;; Options: ((:prune-labels nil) (:auto-save t) (:relaxed-array-decls t)
13 ;;; (:coerce-assigns :as-needed) (:array-type ':array)
14 ;;; (:array-slicing t) (:declare-common nil)
15 ;;; (:float-format double-float))
17 (in-package :blas)
20 (let* ((zero (f2cl-lib:cmplx 0.0 0.0)))
21 (declare (type (f2cl-lib:complex16) zero) (ignorable zero))
22 (defun ztbmv (uplo trans diag n k a lda x incx)
23 (declare (type (array f2cl-lib:complex16 (*)) x a)
24 (type (f2cl-lib:integer4) incx lda k n)
25 (type (simple-string *) diag trans uplo))
26 (f2cl-lib:with-multi-array-data
27 ((uplo character uplo-%data% uplo-%offset%)
28 (trans character trans-%data% trans-%offset%)
29 (diag character diag-%data% diag-%offset%)
30 (a f2cl-lib:complex16 a-%data% a-%offset%)
31 (x f2cl-lib:complex16 x-%data% x-%offset%))
32 (prog ((noconj nil) (nounit nil) (i 0) (info 0) (ix 0) (j 0) (jx 0)
33 (kplus1 0) (kx 0) (l 0) (temp #C(0.0 0.0)))
34 (declare (type f2cl-lib:logical noconj nounit)
35 (type (f2cl-lib:integer4) i info ix j jx kplus1 kx l)
36 (type (f2cl-lib:complex16) temp))
37 (setf info 0)
38 (cond
39 ((and (not (lsame uplo "U")) (not (lsame uplo "L")))
40 (setf info 1))
41 ((and (not (lsame trans "N"))
42 (not (lsame trans "T"))
43 (not (lsame trans "C")))
44 (setf info 2))
45 ((and (not (lsame diag "U")) (not (lsame diag "N")))
46 (setf info 3))
47 ((< n 0)
48 (setf info 4))
49 ((< k 0)
50 (setf info 5))
51 ((< lda (f2cl-lib:int-add k 1))
52 (setf info 7))
53 ((= incx 0)
54 (setf info 9)))
55 (cond
56 ((/= info 0)
57 (xerbla "ZTBMV " info)
58 (go end_label)))
59 (if (= n 0) (go end_label))
60 (setf noconj (lsame trans "T"))
61 (setf nounit (lsame diag "N"))
62 (cond
63 ((<= incx 0)
64 (setf kx
65 (f2cl-lib:int-sub 1
66 (f2cl-lib:int-mul (f2cl-lib:int-sub n 1)
67 incx))))
68 ((/= incx 1)
69 (setf kx 1)))
70 (cond
71 ((lsame trans "N")
72 (cond
73 ((lsame uplo "U")
74 (setf kplus1 (f2cl-lib:int-add k 1))
75 (cond
76 ((= incx 1)
77 (f2cl-lib:fdo (j 1 (f2cl-lib:int-add j 1))
78 ((> j n) nil)
79 (tagbody
80 (cond
81 ((/= (f2cl-lib:fref x (j) ((1 *))) zero)
82 (setf temp
83 (f2cl-lib:fref x-%data% (j) ((1 *)) x-%offset%))
84 (setf l (f2cl-lib:int-sub kplus1 j))
85 (f2cl-lib:fdo (i
86 (max (the f2cl-lib:integer4 1)
87 (the f2cl-lib:integer4
88 (f2cl-lib:int-add j
89 (f2cl-lib:int-sub
90 k))))
91 (f2cl-lib:int-add i 1))
92 ((> i
93 (f2cl-lib:int-add j
94 (f2cl-lib:int-sub
95 1)))
96 nil)
97 (tagbody
98 (setf (f2cl-lib:fref x-%data%
99 (i)
100 ((1 *))
101 x-%offset%)
103 (f2cl-lib:fref x-%data%
105 ((1 *))
106 x-%offset%)
107 (* temp
108 (f2cl-lib:fref a-%data%
109 ((f2cl-lib:int-add l i)
111 ((1 lda) (1 *))
112 a-%offset%))))
113 label10))
114 (if nounit
115 (setf (f2cl-lib:fref x-%data%
117 ((1 *))
118 x-%offset%)
120 (f2cl-lib:fref x-%data%
122 ((1 *))
123 x-%offset%)
124 (f2cl-lib:fref a-%data%
125 (kplus1 j)
126 ((1 lda) (1 *))
127 a-%offset%))))))
128 label20)))
130 (setf jx kx)
131 (f2cl-lib:fdo (j 1 (f2cl-lib:int-add j 1))
132 ((> j n) nil)
133 (tagbody
134 (cond
135 ((/= (f2cl-lib:fref x (jx) ((1 *))) zero)
136 (setf temp
137 (f2cl-lib:fref x-%data%
138 (jx)
139 ((1 *))
140 x-%offset%))
141 (setf ix kx)
142 (setf l (f2cl-lib:int-sub kplus1 j))
143 (f2cl-lib:fdo (i
144 (max (the f2cl-lib:integer4 1)
145 (the f2cl-lib:integer4
146 (f2cl-lib:int-add j
147 (f2cl-lib:int-sub
148 k))))
149 (f2cl-lib:int-add i 1))
150 ((> i
151 (f2cl-lib:int-add j
152 (f2cl-lib:int-sub
153 1)))
154 nil)
155 (tagbody
156 (setf (f2cl-lib:fref x-%data%
157 (ix)
158 ((1 *))
159 x-%offset%)
161 (f2cl-lib:fref x-%data%
162 (ix)
163 ((1 *))
164 x-%offset%)
165 (* temp
166 (f2cl-lib:fref a-%data%
167 ((f2cl-lib:int-add l i)
169 ((1 lda) (1 *))
170 a-%offset%))))
171 (setf ix (f2cl-lib:int-add ix incx))
172 label30))
173 (if nounit
174 (setf (f2cl-lib:fref x-%data%
175 (jx)
176 ((1 *))
177 x-%offset%)
179 (f2cl-lib:fref x-%data%
180 (jx)
181 ((1 *))
182 x-%offset%)
183 (f2cl-lib:fref a-%data%
184 (kplus1 j)
185 ((1 lda) (1 *))
186 a-%offset%))))))
187 (setf jx (f2cl-lib:int-add jx incx))
188 (if (> j k) (setf kx (f2cl-lib:int-add kx incx)))
189 label40)))))
191 (cond
192 ((= incx 1)
193 (f2cl-lib:fdo (j n (f2cl-lib:int-add j (f2cl-lib:int-sub 1)))
194 ((> j 1) nil)
195 (tagbody
196 (cond
197 ((/= (f2cl-lib:fref x (j) ((1 *))) zero)
198 (setf temp
199 (f2cl-lib:fref x-%data% (j) ((1 *)) x-%offset%))
200 (setf l (f2cl-lib:int-sub 1 j))
201 (f2cl-lib:fdo (i
202 (min (the f2cl-lib:integer4 n)
203 (the f2cl-lib:integer4
204 (f2cl-lib:int-add j k)))
205 (f2cl-lib:int-add i
206 (f2cl-lib:int-sub 1)))
207 ((> i (f2cl-lib:int-add j 1)) nil)
208 (tagbody
209 (setf (f2cl-lib:fref x-%data%
211 ((1 *))
212 x-%offset%)
214 (f2cl-lib:fref x-%data%
216 ((1 *))
217 x-%offset%)
218 (* temp
219 (f2cl-lib:fref a-%data%
220 ((f2cl-lib:int-add l i)
222 ((1 lda) (1 *))
223 a-%offset%))))
224 label50))
225 (if nounit
226 (setf (f2cl-lib:fref x-%data%
228 ((1 *))
229 x-%offset%)
231 (f2cl-lib:fref x-%data%
233 ((1 *))
234 x-%offset%)
235 (f2cl-lib:fref a-%data%
236 (1 j)
237 ((1 lda) (1 *))
238 a-%offset%))))))
239 label60)))
241 (setf kx
242 (f2cl-lib:int-add kx
243 (f2cl-lib:int-mul
244 (f2cl-lib:int-sub n 1)
245 incx)))
246 (setf jx kx)
247 (f2cl-lib:fdo (j n (f2cl-lib:int-add j (f2cl-lib:int-sub 1)))
248 ((> j 1) nil)
249 (tagbody
250 (cond
251 ((/= (f2cl-lib:fref x (jx) ((1 *))) zero)
252 (setf temp
253 (f2cl-lib:fref x-%data%
254 (jx)
255 ((1 *))
256 x-%offset%))
257 (setf ix kx)
258 (setf l (f2cl-lib:int-sub 1 j))
259 (f2cl-lib:fdo (i
260 (min (the f2cl-lib:integer4 n)
261 (the f2cl-lib:integer4
262 (f2cl-lib:int-add j k)))
263 (f2cl-lib:int-add i
264 (f2cl-lib:int-sub 1)))
265 ((> i (f2cl-lib:int-add j 1)) nil)
266 (tagbody
267 (setf (f2cl-lib:fref x-%data%
268 (ix)
269 ((1 *))
270 x-%offset%)
272 (f2cl-lib:fref x-%data%
273 (ix)
274 ((1 *))
275 x-%offset%)
276 (* temp
277 (f2cl-lib:fref a-%data%
278 ((f2cl-lib:int-add l i)
280 ((1 lda) (1 *))
281 a-%offset%))))
282 (setf ix (f2cl-lib:int-sub ix incx))
283 label70))
284 (if nounit
285 (setf (f2cl-lib:fref x-%data%
286 (jx)
287 ((1 *))
288 x-%offset%)
290 (f2cl-lib:fref x-%data%
291 (jx)
292 ((1 *))
293 x-%offset%)
294 (f2cl-lib:fref a-%data%
295 (1 j)
296 ((1 lda) (1 *))
297 a-%offset%))))))
298 (setf jx (f2cl-lib:int-sub jx incx))
299 (if (>= (f2cl-lib:int-sub n j) k)
300 (setf kx (f2cl-lib:int-sub kx incx)))
301 label80)))))))
303 (cond
304 ((lsame uplo "U")
305 (setf kplus1 (f2cl-lib:int-add k 1))
306 (cond
307 ((= incx 1)
308 (f2cl-lib:fdo (j n (f2cl-lib:int-add j (f2cl-lib:int-sub 1)))
309 ((> j 1) nil)
310 (tagbody
311 (setf temp
312 (f2cl-lib:fref x-%data% (j) ((1 *)) x-%offset%))
313 (setf l (f2cl-lib:int-sub kplus1 j))
314 (cond
315 (noconj
316 (if nounit
317 (setf temp
318 (* temp
319 (f2cl-lib:fref a-%data%
320 (kplus1 j)
321 ((1 lda) (1 *))
322 a-%offset%))))
323 (f2cl-lib:fdo (i
324 (f2cl-lib:int-add j
325 (f2cl-lib:int-sub 1))
326 (f2cl-lib:int-add i
327 (f2cl-lib:int-sub 1)))
328 ((> i
329 (max (the f2cl-lib:integer4 1)
330 (the f2cl-lib:integer4
331 (f2cl-lib:int-add j
332 (f2cl-lib:int-sub
333 k)))))
334 nil)
335 (tagbody
336 (setf temp
337 (+ temp
339 (f2cl-lib:fref a-%data%
340 ((f2cl-lib:int-add l i)
342 ((1 lda) (1 *))
343 a-%offset%)
344 (f2cl-lib:fref x-%data%
346 ((1 *))
347 x-%offset%))))
348 label90)))
350 (if nounit
351 (setf temp
352 (* temp
353 (f2cl-lib:dconjg
354 (f2cl-lib:fref a-%data%
355 (kplus1 j)
356 ((1 lda) (1 *))
357 a-%offset%)))))
358 (f2cl-lib:fdo (i
359 (f2cl-lib:int-add j
360 (f2cl-lib:int-sub 1))
361 (f2cl-lib:int-add i
362 (f2cl-lib:int-sub 1)))
363 ((> i
364 (max (the f2cl-lib:integer4 1)
365 (the f2cl-lib:integer4
366 (f2cl-lib:int-add j
367 (f2cl-lib:int-sub
368 k)))))
369 nil)
370 (tagbody
371 (setf temp
372 (+ temp
374 (f2cl-lib:dconjg
375 (f2cl-lib:fref a-%data%
376 ((f2cl-lib:int-add l i)
378 ((1 lda) (1 *))
379 a-%offset%))
380 (f2cl-lib:fref x-%data%
382 ((1 *))
383 x-%offset%))))
384 label100))))
385 (setf (f2cl-lib:fref x-%data% (j) ((1 *)) x-%offset%)
386 temp)
387 label110)))
389 (setf kx
390 (f2cl-lib:int-add kx
391 (f2cl-lib:int-mul
392 (f2cl-lib:int-sub n 1)
393 incx)))
394 (setf jx kx)
395 (f2cl-lib:fdo (j n (f2cl-lib:int-add j (f2cl-lib:int-sub 1)))
396 ((> j 1) nil)
397 (tagbody
398 (setf temp
399 (f2cl-lib:fref x-%data% (jx) ((1 *)) x-%offset%))
400 (setf kx (f2cl-lib:int-sub kx incx))
401 (setf ix kx)
402 (setf l (f2cl-lib:int-sub kplus1 j))
403 (cond
404 (noconj
405 (if nounit
406 (setf temp
407 (* temp
408 (f2cl-lib:fref a-%data%
409 (kplus1 j)
410 ((1 lda) (1 *))
411 a-%offset%))))
412 (f2cl-lib:fdo (i
413 (f2cl-lib:int-add j
414 (f2cl-lib:int-sub 1))
415 (f2cl-lib:int-add i
416 (f2cl-lib:int-sub 1)))
417 ((> i
418 (max (the f2cl-lib:integer4 1)
419 (the f2cl-lib:integer4
420 (f2cl-lib:int-add j
421 (f2cl-lib:int-sub
422 k)))))
423 nil)
424 (tagbody
425 (setf temp
426 (+ temp
428 (f2cl-lib:fref a-%data%
429 ((f2cl-lib:int-add l i)
431 ((1 lda) (1 *))
432 a-%offset%)
433 (f2cl-lib:fref x-%data%
434 (ix)
435 ((1 *))
436 x-%offset%))))
437 (setf ix (f2cl-lib:int-sub ix incx))
438 label120)))
440 (if nounit
441 (setf temp
442 (* temp
443 (f2cl-lib:dconjg
444 (f2cl-lib:fref a-%data%
445 (kplus1 j)
446 ((1 lda) (1 *))
447 a-%offset%)))))
448 (f2cl-lib:fdo (i
449 (f2cl-lib:int-add j
450 (f2cl-lib:int-sub 1))
451 (f2cl-lib:int-add i
452 (f2cl-lib:int-sub 1)))
453 ((> i
454 (max (the f2cl-lib:integer4 1)
455 (the f2cl-lib:integer4
456 (f2cl-lib:int-add j
457 (f2cl-lib:int-sub
458 k)))))
459 nil)
460 (tagbody
461 (setf temp
462 (+ temp
464 (f2cl-lib:dconjg
465 (f2cl-lib:fref a-%data%
466 ((f2cl-lib:int-add l i)
468 ((1 lda) (1 *))
469 a-%offset%))
470 (f2cl-lib:fref x-%data%
471 (ix)
472 ((1 *))
473 x-%offset%))))
474 (setf ix (f2cl-lib:int-sub ix incx))
475 label130))))
476 (setf (f2cl-lib:fref x-%data% (jx) ((1 *)) x-%offset%)
477 temp)
478 (setf jx (f2cl-lib:int-sub jx incx))
479 label140)))))
481 (cond
482 ((= incx 1)
483 (f2cl-lib:fdo (j 1 (f2cl-lib:int-add j 1))
484 ((> j n) nil)
485 (tagbody
486 (setf temp
487 (f2cl-lib:fref x-%data% (j) ((1 *)) x-%offset%))
488 (setf l (f2cl-lib:int-sub 1 j))
489 (cond
490 (noconj
491 (if nounit
492 (setf temp
493 (* temp
494 (f2cl-lib:fref a-%data%
495 (1 j)
496 ((1 lda) (1 *))
497 a-%offset%))))
498 (f2cl-lib:fdo (i (f2cl-lib:int-add j 1)
499 (f2cl-lib:int-add i 1))
500 ((> i
501 (min (the f2cl-lib:integer4 n)
502 (the f2cl-lib:integer4
503 (f2cl-lib:int-add j k))))
504 nil)
505 (tagbody
506 (setf temp
507 (+ temp
509 (f2cl-lib:fref a-%data%
510 ((f2cl-lib:int-add l i)
512 ((1 lda) (1 *))
513 a-%offset%)
514 (f2cl-lib:fref x-%data%
516 ((1 *))
517 x-%offset%))))
518 label150)))
520 (if nounit
521 (setf temp
522 (* temp
523 (f2cl-lib:dconjg
524 (f2cl-lib:fref a-%data%
525 (1 j)
526 ((1 lda) (1 *))
527 a-%offset%)))))
528 (f2cl-lib:fdo (i (f2cl-lib:int-add j 1)
529 (f2cl-lib:int-add i 1))
530 ((> i
531 (min (the f2cl-lib:integer4 n)
532 (the f2cl-lib:integer4
533 (f2cl-lib:int-add j k))))
534 nil)
535 (tagbody
536 (setf temp
537 (+ temp
539 (f2cl-lib:dconjg
540 (f2cl-lib:fref a-%data%
541 ((f2cl-lib:int-add l i)
543 ((1 lda) (1 *))
544 a-%offset%))
545 (f2cl-lib:fref x-%data%
547 ((1 *))
548 x-%offset%))))
549 label160))))
550 (setf (f2cl-lib:fref x-%data% (j) ((1 *)) x-%offset%)
551 temp)
552 label170)))
554 (setf jx kx)
555 (f2cl-lib:fdo (j 1 (f2cl-lib:int-add j 1))
556 ((> j n) nil)
557 (tagbody
558 (setf temp
559 (f2cl-lib:fref x-%data% (jx) ((1 *)) x-%offset%))
560 (setf kx (f2cl-lib:int-add kx incx))
561 (setf ix kx)
562 (setf l (f2cl-lib:int-sub 1 j))
563 (cond
564 (noconj
565 (if nounit
566 (setf temp
567 (* temp
568 (f2cl-lib:fref a-%data%
569 (1 j)
570 ((1 lda) (1 *))
571 a-%offset%))))
572 (f2cl-lib:fdo (i (f2cl-lib:int-add j 1)
573 (f2cl-lib:int-add i 1))
574 ((> i
575 (min (the f2cl-lib:integer4 n)
576 (the f2cl-lib:integer4
577 (f2cl-lib:int-add j k))))
578 nil)
579 (tagbody
580 (setf temp
581 (+ temp
583 (f2cl-lib:fref a-%data%
584 ((f2cl-lib:int-add l i)
586 ((1 lda) (1 *))
587 a-%offset%)
588 (f2cl-lib:fref x-%data%
589 (ix)
590 ((1 *))
591 x-%offset%))))
592 (setf ix (f2cl-lib:int-add ix incx))
593 label180)))
595 (if nounit
596 (setf temp
597 (* temp
598 (f2cl-lib:dconjg
599 (f2cl-lib:fref a-%data%
600 (1 j)
601 ((1 lda) (1 *))
602 a-%offset%)))))
603 (f2cl-lib:fdo (i (f2cl-lib:int-add j 1)
604 (f2cl-lib:int-add i 1))
605 ((> i
606 (min (the f2cl-lib:integer4 n)
607 (the f2cl-lib:integer4
608 (f2cl-lib:int-add j k))))
609 nil)
610 (tagbody
611 (setf temp
612 (+ temp
614 (f2cl-lib:dconjg
615 (f2cl-lib:fref a-%data%
616 ((f2cl-lib:int-add l i)
618 ((1 lda) (1 *))
619 a-%offset%))
620 (f2cl-lib:fref x-%data%
621 (ix)
622 ((1 *))
623 x-%offset%))))
624 (setf ix (f2cl-lib:int-add ix incx))
625 label190))))
626 (setf (f2cl-lib:fref x-%data% (jx) ((1 *)) x-%offset%)
627 temp)
628 (setf jx (f2cl-lib:int-add jx incx))
629 label200))))))))
630 (go end_label)
631 end_label
632 (return (values nil nil nil nil nil nil nil nil nil))))))
634 (in-package #-gcl #:cl-user #+gcl "CL-USER")
635 #+#.(cl:if (cl:find-package '#:f2cl) '(and) '(or))
636 (eval-when (:load-toplevel :compile-toplevel :execute)
637 (setf (gethash 'fortran-to-lisp::ztbmv fortran-to-lisp::*f2cl-function-info*)
638 (fortran-to-lisp::make-f2cl-finfo
639 :arg-types '((simple-string) (simple-string) (simple-string)
640 (fortran-to-lisp::integer4) (fortran-to-lisp::integer4)
641 (array fortran-to-lisp::complex16 (*))
642 (fortran-to-lisp::integer4)
643 (array fortran-to-lisp::complex16 (*))
644 (fortran-to-lisp::integer4))
645 :return-values '(nil nil nil nil nil nil nil nil nil)
646 :calls '(fortran-to-lisp::xerbla fortran-to-lisp::lsame))))