Add some basic letsimp tests based on bug #3950
[maxima.git] / share / lapack / blas / ztrmv.lisp
blob3668bf837174ea59d5d3180b63599adb1d633cff
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 ztrmv (uplo trans diag n a lda x incx)
23 (declare (type (array f2cl-lib:complex16 (*)) x a)
24 (type (f2cl-lib:integer4) incx lda 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 (kx 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 kx)
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 ((< lda (max (the f2cl-lib:integer4 1) (the f2cl-lib:integer4 n)))
50 (setf info 6))
51 ((= incx 0)
52 (setf info 8)))
53 (cond
54 ((/= info 0)
55 (xerbla "ZTRMV " info)
56 (go end_label)))
57 (if (= n 0) (go end_label))
58 (setf noconj (lsame trans "T"))
59 (setf nounit (lsame diag "N"))
60 (cond
61 ((<= incx 0)
62 (setf kx
63 (f2cl-lib:int-sub 1
64 (f2cl-lib:int-mul (f2cl-lib:int-sub n 1)
65 incx))))
66 ((/= incx 1)
67 (setf kx 1)))
68 (cond
69 ((lsame trans "N")
70 (cond
71 ((lsame uplo "U")
72 (cond
73 ((= incx 1)
74 (f2cl-lib:fdo (j 1 (f2cl-lib:int-add j 1))
75 ((> j n) nil)
76 (tagbody
77 (cond
78 ((/= (f2cl-lib:fref x (j) ((1 *))) zero)
79 (setf temp
80 (f2cl-lib:fref x-%data% (j) ((1 *)) x-%offset%))
81 (f2cl-lib:fdo (i 1 (f2cl-lib:int-add i 1))
82 ((> i
83 (f2cl-lib:int-add j
84 (f2cl-lib:int-sub
85 1)))
86 nil)
87 (tagbody
88 (setf (f2cl-lib:fref x-%data%
89 (i)
90 ((1 *))
91 x-%offset%)
93 (f2cl-lib:fref x-%data%
94 (i)
95 ((1 *))
96 x-%offset%)
97 (* temp
98 (f2cl-lib:fref a-%data%
99 (i j)
100 ((1 lda) (1 *))
101 a-%offset%))))
102 label10))
103 (if nounit
104 (setf (f2cl-lib:fref x-%data%
106 ((1 *))
107 x-%offset%)
109 (f2cl-lib:fref x-%data%
111 ((1 *))
112 x-%offset%)
113 (f2cl-lib:fref a-%data%
114 (j j)
115 ((1 lda) (1 *))
116 a-%offset%))))))
117 label20)))
119 (setf jx kx)
120 (f2cl-lib:fdo (j 1 (f2cl-lib:int-add j 1))
121 ((> j n) nil)
122 (tagbody
123 (cond
124 ((/= (f2cl-lib:fref x (jx) ((1 *))) zero)
125 (setf temp
126 (f2cl-lib:fref x-%data%
127 (jx)
128 ((1 *))
129 x-%offset%))
130 (setf ix kx)
131 (f2cl-lib:fdo (i 1 (f2cl-lib:int-add i 1))
132 ((> i
133 (f2cl-lib:int-add j
134 (f2cl-lib:int-sub
135 1)))
136 nil)
137 (tagbody
138 (setf (f2cl-lib:fref x-%data%
139 (ix)
140 ((1 *))
141 x-%offset%)
143 (f2cl-lib:fref x-%data%
144 (ix)
145 ((1 *))
146 x-%offset%)
147 (* temp
148 (f2cl-lib:fref a-%data%
149 (i j)
150 ((1 lda) (1 *))
151 a-%offset%))))
152 (setf ix (f2cl-lib:int-add ix incx))
153 label30))
154 (if nounit
155 (setf (f2cl-lib:fref x-%data%
156 (jx)
157 ((1 *))
158 x-%offset%)
160 (f2cl-lib:fref x-%data%
161 (jx)
162 ((1 *))
163 x-%offset%)
164 (f2cl-lib:fref a-%data%
165 (j j)
166 ((1 lda) (1 *))
167 a-%offset%))))))
168 (setf jx (f2cl-lib:int-add jx incx))
169 label40)))))
171 (cond
172 ((= incx 1)
173 (f2cl-lib:fdo (j n (f2cl-lib:int-add j (f2cl-lib:int-sub 1)))
174 ((> j 1) nil)
175 (tagbody
176 (cond
177 ((/= (f2cl-lib:fref x (j) ((1 *))) zero)
178 (setf temp
179 (f2cl-lib:fref x-%data% (j) ((1 *)) x-%offset%))
180 (f2cl-lib:fdo (i n
181 (f2cl-lib:int-add i
182 (f2cl-lib:int-sub 1)))
183 ((> i (f2cl-lib:int-add j 1)) nil)
184 (tagbody
185 (setf (f2cl-lib:fref x-%data%
187 ((1 *))
188 x-%offset%)
190 (f2cl-lib:fref x-%data%
192 ((1 *))
193 x-%offset%)
194 (* temp
195 (f2cl-lib:fref a-%data%
196 (i j)
197 ((1 lda) (1 *))
198 a-%offset%))))
199 label50))
200 (if nounit
201 (setf (f2cl-lib:fref x-%data%
203 ((1 *))
204 x-%offset%)
206 (f2cl-lib:fref x-%data%
208 ((1 *))
209 x-%offset%)
210 (f2cl-lib:fref a-%data%
211 (j j)
212 ((1 lda) (1 *))
213 a-%offset%))))))
214 label60)))
216 (setf kx
217 (f2cl-lib:int-add kx
218 (f2cl-lib:int-mul
219 (f2cl-lib:int-sub n 1)
220 incx)))
221 (setf jx kx)
222 (f2cl-lib:fdo (j n (f2cl-lib:int-add j (f2cl-lib:int-sub 1)))
223 ((> j 1) nil)
224 (tagbody
225 (cond
226 ((/= (f2cl-lib:fref x (jx) ((1 *))) zero)
227 (setf temp
228 (f2cl-lib:fref x-%data%
229 (jx)
230 ((1 *))
231 x-%offset%))
232 (setf ix kx)
233 (f2cl-lib:fdo (i n
234 (f2cl-lib:int-add i
235 (f2cl-lib:int-sub 1)))
236 ((> i (f2cl-lib:int-add j 1)) nil)
237 (tagbody
238 (setf (f2cl-lib:fref x-%data%
239 (ix)
240 ((1 *))
241 x-%offset%)
243 (f2cl-lib:fref x-%data%
244 (ix)
245 ((1 *))
246 x-%offset%)
247 (* temp
248 (f2cl-lib:fref a-%data%
249 (i j)
250 ((1 lda) (1 *))
251 a-%offset%))))
252 (setf ix (f2cl-lib:int-sub ix incx))
253 label70))
254 (if nounit
255 (setf (f2cl-lib:fref x-%data%
256 (jx)
257 ((1 *))
258 x-%offset%)
260 (f2cl-lib:fref x-%data%
261 (jx)
262 ((1 *))
263 x-%offset%)
264 (f2cl-lib:fref a-%data%
265 (j j)
266 ((1 lda) (1 *))
267 a-%offset%))))))
268 (setf jx (f2cl-lib:int-sub jx incx))
269 label80)))))))
271 (cond
272 ((lsame uplo "U")
273 (cond
274 ((= incx 1)
275 (f2cl-lib:fdo (j n (f2cl-lib:int-add j (f2cl-lib:int-sub 1)))
276 ((> j 1) nil)
277 (tagbody
278 (setf temp
279 (f2cl-lib:fref x-%data% (j) ((1 *)) x-%offset%))
280 (cond
281 (noconj
282 (if nounit
283 (setf temp
284 (* temp
285 (f2cl-lib:fref a-%data%
286 (j j)
287 ((1 lda) (1 *))
288 a-%offset%))))
289 (f2cl-lib:fdo (i
290 (f2cl-lib:int-add j
291 (f2cl-lib:int-sub 1))
292 (f2cl-lib:int-add i
293 (f2cl-lib:int-sub 1)))
294 ((> i 1) nil)
295 (tagbody
296 (setf temp
297 (+ temp
299 (f2cl-lib:fref a-%data%
300 (i j)
301 ((1 lda) (1 *))
302 a-%offset%)
303 (f2cl-lib:fref x-%data%
305 ((1 *))
306 x-%offset%))))
307 label90)))
309 (if nounit
310 (setf temp
311 (* temp
312 (f2cl-lib:dconjg
313 (f2cl-lib:fref a-%data%
314 (j j)
315 ((1 lda) (1 *))
316 a-%offset%)))))
317 (f2cl-lib:fdo (i
318 (f2cl-lib:int-add j
319 (f2cl-lib:int-sub 1))
320 (f2cl-lib:int-add i
321 (f2cl-lib:int-sub 1)))
322 ((> i 1) nil)
323 (tagbody
324 (setf temp
325 (+ temp
327 (f2cl-lib:dconjg
328 (f2cl-lib:fref a-%data%
329 (i j)
330 ((1 lda) (1 *))
331 a-%offset%))
332 (f2cl-lib:fref x-%data%
334 ((1 *))
335 x-%offset%))))
336 label100))))
337 (setf (f2cl-lib:fref x-%data% (j) ((1 *)) x-%offset%)
338 temp)
339 label110)))
341 (setf jx
342 (f2cl-lib:int-add kx
343 (f2cl-lib:int-mul
344 (f2cl-lib:int-sub n 1)
345 incx)))
346 (f2cl-lib:fdo (j n (f2cl-lib:int-add j (f2cl-lib:int-sub 1)))
347 ((> j 1) nil)
348 (tagbody
349 (setf temp
350 (f2cl-lib:fref x-%data% (jx) ((1 *)) x-%offset%))
351 (setf ix jx)
352 (cond
353 (noconj
354 (if nounit
355 (setf temp
356 (* temp
357 (f2cl-lib:fref a-%data%
358 (j j)
359 ((1 lda) (1 *))
360 a-%offset%))))
361 (f2cl-lib:fdo (i
362 (f2cl-lib:int-add j
363 (f2cl-lib:int-sub 1))
364 (f2cl-lib:int-add i
365 (f2cl-lib:int-sub 1)))
366 ((> i 1) nil)
367 (tagbody
368 (setf ix (f2cl-lib:int-sub ix incx))
369 (setf temp
370 (+ temp
372 (f2cl-lib:fref a-%data%
373 (i j)
374 ((1 lda) (1 *))
375 a-%offset%)
376 (f2cl-lib:fref x-%data%
377 (ix)
378 ((1 *))
379 x-%offset%))))
380 label120)))
382 (if nounit
383 (setf temp
384 (* temp
385 (f2cl-lib:dconjg
386 (f2cl-lib:fref a-%data%
387 (j j)
388 ((1 lda) (1 *))
389 a-%offset%)))))
390 (f2cl-lib:fdo (i
391 (f2cl-lib:int-add j
392 (f2cl-lib:int-sub 1))
393 (f2cl-lib:int-add i
394 (f2cl-lib:int-sub 1)))
395 ((> i 1) nil)
396 (tagbody
397 (setf ix (f2cl-lib:int-sub ix incx))
398 (setf temp
399 (+ temp
401 (f2cl-lib:dconjg
402 (f2cl-lib:fref a-%data%
403 (i j)
404 ((1 lda) (1 *))
405 a-%offset%))
406 (f2cl-lib:fref x-%data%
407 (ix)
408 ((1 *))
409 x-%offset%))))
410 label130))))
411 (setf (f2cl-lib:fref x-%data% (jx) ((1 *)) x-%offset%)
412 temp)
413 (setf jx (f2cl-lib:int-sub jx incx))
414 label140)))))
416 (cond
417 ((= incx 1)
418 (f2cl-lib:fdo (j 1 (f2cl-lib:int-add j 1))
419 ((> j n) nil)
420 (tagbody
421 (setf temp
422 (f2cl-lib:fref x-%data% (j) ((1 *)) x-%offset%))
423 (cond
424 (noconj
425 (if nounit
426 (setf temp
427 (* temp
428 (f2cl-lib:fref a-%data%
429 (j j)
430 ((1 lda) (1 *))
431 a-%offset%))))
432 (f2cl-lib:fdo (i (f2cl-lib:int-add j 1)
433 (f2cl-lib:int-add i 1))
434 ((> i n) nil)
435 (tagbody
436 (setf temp
437 (+ temp
439 (f2cl-lib:fref a-%data%
440 (i j)
441 ((1 lda) (1 *))
442 a-%offset%)
443 (f2cl-lib:fref x-%data%
445 ((1 *))
446 x-%offset%))))
447 label150)))
449 (if nounit
450 (setf temp
451 (* temp
452 (f2cl-lib:dconjg
453 (f2cl-lib:fref a-%data%
454 (j j)
455 ((1 lda) (1 *))
456 a-%offset%)))))
457 (f2cl-lib:fdo (i (f2cl-lib:int-add j 1)
458 (f2cl-lib:int-add i 1))
459 ((> i n) nil)
460 (tagbody
461 (setf temp
462 (+ temp
464 (f2cl-lib:dconjg
465 (f2cl-lib:fref a-%data%
466 (i j)
467 ((1 lda) (1 *))
468 a-%offset%))
469 (f2cl-lib:fref x-%data%
471 ((1 *))
472 x-%offset%))))
473 label160))))
474 (setf (f2cl-lib:fref x-%data% (j) ((1 *)) x-%offset%)
475 temp)
476 label170)))
478 (setf jx kx)
479 (f2cl-lib:fdo (j 1 (f2cl-lib:int-add j 1))
480 ((> j n) nil)
481 (tagbody
482 (setf temp
483 (f2cl-lib:fref x-%data% (jx) ((1 *)) x-%offset%))
484 (setf ix jx)
485 (cond
486 (noconj
487 (if nounit
488 (setf temp
489 (* temp
490 (f2cl-lib:fref a-%data%
491 (j j)
492 ((1 lda) (1 *))
493 a-%offset%))))
494 (f2cl-lib:fdo (i (f2cl-lib:int-add j 1)
495 (f2cl-lib:int-add i 1))
496 ((> i n) nil)
497 (tagbody
498 (setf ix (f2cl-lib:int-add ix incx))
499 (setf temp
500 (+ temp
502 (f2cl-lib:fref a-%data%
503 (i j)
504 ((1 lda) (1 *))
505 a-%offset%)
506 (f2cl-lib:fref x-%data%
507 (ix)
508 ((1 *))
509 x-%offset%))))
510 label180)))
512 (if nounit
513 (setf temp
514 (* temp
515 (f2cl-lib:dconjg
516 (f2cl-lib:fref a-%data%
517 (j j)
518 ((1 lda) (1 *))
519 a-%offset%)))))
520 (f2cl-lib:fdo (i (f2cl-lib:int-add j 1)
521 (f2cl-lib:int-add i 1))
522 ((> i n) nil)
523 (tagbody
524 (setf ix (f2cl-lib:int-add ix incx))
525 (setf temp
526 (+ temp
528 (f2cl-lib:dconjg
529 (f2cl-lib:fref a-%data%
530 (i j)
531 ((1 lda) (1 *))
532 a-%offset%))
533 (f2cl-lib:fref x-%data%
534 (ix)
535 ((1 *))
536 x-%offset%))))
537 label190))))
538 (setf (f2cl-lib:fref x-%data% (jx) ((1 *)) x-%offset%)
539 temp)
540 (setf jx (f2cl-lib:int-add jx incx))
541 label200))))))))
542 (go end_label)
543 end_label
544 (return (values nil nil nil nil nil nil nil nil))))))
546 (in-package #-gcl #:cl-user #+gcl "CL-USER")
547 #+#.(cl:if (cl:find-package '#:f2cl) '(and) '(or))
548 (eval-when (:load-toplevel :compile-toplevel :execute)
549 (setf (gethash 'fortran-to-lisp::ztrmv fortran-to-lisp::*f2cl-function-info*)
550 (fortran-to-lisp::make-f2cl-finfo
551 :arg-types '((simple-string) (simple-string) (simple-string)
552 (fortran-to-lisp::integer4)
553 (array fortran-to-lisp::complex16 (*))
554 (fortran-to-lisp::integer4)
555 (array fortran-to-lisp::complex16 (*))
556 (fortran-to-lisp::integer4))
557 :return-values '(nil nil nil nil nil nil nil nil)
558 :calls '(fortran-to-lisp::xerbla fortran-to-lisp::lsame))))