Add some basic letsimp tests based on bug #3950
[maxima.git] / share / lapack / blas / ztrmm.lisp
blob68a2491f0adbea39493dea5999e028a50edbae07
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* ((one (f2cl-lib:cmplx 1.0 0.0)) (zero (f2cl-lib:cmplx 0.0 0.0)))
21 (declare (type (f2cl-lib:complex16) one)
22 (type (f2cl-lib:complex16) zero)
23 (ignorable one zero))
24 (defun ztrmm (side uplo transa diag m n alpha a lda b ldb$)
25 (declare (type (array f2cl-lib:complex16 (*)) b a)
26 (type (f2cl-lib:complex16) alpha)
27 (type (f2cl-lib:integer4) ldb$ lda n m)
28 (type (simple-string *) diag transa uplo side))
29 (f2cl-lib:with-multi-array-data
30 ((side character side-%data% side-%offset%)
31 (uplo character uplo-%data% uplo-%offset%)
32 (transa character transa-%data% transa-%offset%)
33 (diag character diag-%data% diag-%offset%)
34 (a f2cl-lib:complex16 a-%data% a-%offset%)
35 (b f2cl-lib:complex16 b-%data% b-%offset%))
36 (prog ((temp #C(0.0 0.0)) (i 0) (info 0) (j 0) (k 0) (nrowa 0)
37 (lside nil) (noconj nil) (nounit nil) (upper nil))
38 (declare (type (f2cl-lib:complex16) temp)
39 (type (f2cl-lib:integer4) i info j k nrowa)
40 (type f2cl-lib:logical lside noconj nounit upper))
41 (setf lside (lsame side "L"))
42 (cond
43 (lside
44 (setf nrowa m))
46 (setf nrowa n)))
47 (setf noconj (lsame transa "T"))
48 (setf nounit (lsame diag "N"))
49 (setf upper (lsame uplo "U"))
50 (setf info 0)
51 (cond
52 ((and (not lside) (not (lsame side "R")))
53 (setf info 1))
54 ((and (not upper) (not (lsame uplo "L")))
55 (setf info 2))
56 ((and (not (lsame transa "N"))
57 (not (lsame transa "T"))
58 (not (lsame transa "C")))
59 (setf info 3))
60 ((and (not (lsame diag "U")) (not (lsame diag "N")))
61 (setf info 4))
62 ((< m 0)
63 (setf info 5))
64 ((< n 0)
65 (setf info 6))
66 ((< lda (max (the f2cl-lib:integer4 1) (the f2cl-lib:integer4 nrowa)))
67 (setf info 9))
68 ((< ldb$ (max (the f2cl-lib:integer4 1) (the f2cl-lib:integer4 m)))
69 (setf info 11)))
70 (cond
71 ((/= info 0)
72 (xerbla "ZTRMM " info)
73 (go end_label)))
74 (if (= n 0) (go end_label))
75 (cond
76 ((= alpha zero)
77 (f2cl-lib:fdo (j 1 (f2cl-lib:int-add j 1))
78 ((> j n) nil)
79 (tagbody
80 (f2cl-lib:fdo (i 1 (f2cl-lib:int-add i 1))
81 ((> i m) nil)
82 (tagbody
83 (setf (f2cl-lib:fref b-%data%
84 (i j)
85 ((1 ldb$) (1 *))
86 b-%offset%)
87 zero)
88 label10))
89 label20))
90 (go end_label)))
91 (cond
92 (lside
93 (cond
94 ((lsame transa "N")
95 (cond
96 (upper
97 (f2cl-lib:fdo (j 1 (f2cl-lib:int-add j 1))
98 ((> j n) nil)
99 (tagbody
100 (f2cl-lib:fdo (k 1 (f2cl-lib:int-add k 1))
101 ((> k m) nil)
102 (tagbody
103 (cond
104 ((/= (f2cl-lib:fref b (k j) ((1 ldb$) (1 *))) zero)
105 (setf temp
106 (* alpha
107 (f2cl-lib:fref b-%data%
108 (k j)
109 ((1 ldb$) (1 *))
110 b-%offset%)))
111 (f2cl-lib:fdo (i 1 (f2cl-lib:int-add i 1))
112 ((> i
113 (f2cl-lib:int-add k
114 (f2cl-lib:int-sub
115 1)))
116 nil)
117 (tagbody
118 (setf (f2cl-lib:fref b-%data%
119 (i j)
120 ((1 ldb$) (1 *))
121 b-%offset%)
123 (f2cl-lib:fref b-%data%
124 (i j)
125 ((1 ldb$) (1 *))
126 b-%offset%)
127 (* temp
128 (f2cl-lib:fref a-%data%
129 (i k)
130 ((1 lda) (1 *))
131 a-%offset%))))
132 label30))
133 (if nounit
134 (setf temp
135 (* temp
136 (f2cl-lib:fref a-%data%
137 (k k)
138 ((1 lda) (1 *))
139 a-%offset%))))
140 (setf (f2cl-lib:fref b-%data%
141 (k j)
142 ((1 ldb$) (1 *))
143 b-%offset%)
144 temp)))
145 label40))
146 label50)))
148 (f2cl-lib:fdo (j 1 (f2cl-lib:int-add j 1))
149 ((> j n) nil)
150 (tagbody
151 (f2cl-lib:fdo (k m
152 (f2cl-lib:int-add k (f2cl-lib:int-sub 1)))
153 ((> k 1) nil)
154 (tagbody
155 (cond
156 ((/= (f2cl-lib:fref b (k j) ((1 ldb$) (1 *))) zero)
157 (setf temp
158 (* alpha
159 (f2cl-lib:fref b-%data%
160 (k j)
161 ((1 ldb$) (1 *))
162 b-%offset%)))
163 (setf (f2cl-lib:fref b-%data%
164 (k j)
165 ((1 ldb$) (1 *))
166 b-%offset%)
167 temp)
168 (if nounit
169 (setf (f2cl-lib:fref b-%data%
170 (k j)
171 ((1 ldb$) (1 *))
172 b-%offset%)
174 (f2cl-lib:fref b-%data%
175 (k j)
176 ((1 ldb$) (1 *))
177 b-%offset%)
178 (f2cl-lib:fref a-%data%
179 (k k)
180 ((1 lda) (1 *))
181 a-%offset%))))
182 (f2cl-lib:fdo (i (f2cl-lib:int-add k 1)
183 (f2cl-lib:int-add i 1))
184 ((> i m) nil)
185 (tagbody
186 (setf (f2cl-lib:fref b-%data%
187 (i j)
188 ((1 ldb$) (1 *))
189 b-%offset%)
191 (f2cl-lib:fref b-%data%
192 (i j)
193 ((1 ldb$) (1 *))
194 b-%offset%)
195 (* temp
196 (f2cl-lib:fref a-%data%
197 (i k)
198 ((1 lda) (1 *))
199 a-%offset%))))
200 label60))))
201 label70))
202 label80)))))
204 (cond
205 (upper
206 (f2cl-lib:fdo (j 1 (f2cl-lib:int-add j 1))
207 ((> j n) nil)
208 (tagbody
209 (f2cl-lib:fdo (i m
210 (f2cl-lib:int-add i (f2cl-lib:int-sub 1)))
211 ((> i 1) nil)
212 (tagbody
213 (setf temp
214 (f2cl-lib:fref b-%data%
215 (i j)
216 ((1 ldb$) (1 *))
217 b-%offset%))
218 (cond
219 (noconj
220 (if nounit
221 (setf temp
222 (* temp
223 (f2cl-lib:fref a-%data%
224 (i i)
225 ((1 lda) (1 *))
226 a-%offset%))))
227 (f2cl-lib:fdo (k 1 (f2cl-lib:int-add k 1))
228 ((> k
229 (f2cl-lib:int-add i
230 (f2cl-lib:int-sub
231 1)))
232 nil)
233 (tagbody
234 (setf temp
235 (+ temp
237 (f2cl-lib:fref a-%data%
238 (k i)
239 ((1 lda) (1 *))
240 a-%offset%)
241 (f2cl-lib:fref b-%data%
242 (k j)
243 ((1 ldb$) (1 *))
244 b-%offset%))))
245 label90)))
247 (if nounit
248 (setf temp
249 (* temp
250 (f2cl-lib:dconjg
251 (f2cl-lib:fref a-%data%
252 (i i)
253 ((1 lda) (1 *))
254 a-%offset%)))))
255 (f2cl-lib:fdo (k 1 (f2cl-lib:int-add k 1))
256 ((> k
257 (f2cl-lib:int-add i
258 (f2cl-lib:int-sub
259 1)))
260 nil)
261 (tagbody
262 (setf temp
263 (+ temp
265 (f2cl-lib:dconjg
266 (f2cl-lib:fref a-%data%
267 (k i)
268 ((1 lda) (1 *))
269 a-%offset%))
270 (f2cl-lib:fref b-%data%
271 (k j)
272 ((1 ldb$) (1 *))
273 b-%offset%))))
274 label100))))
275 (setf (f2cl-lib:fref b-%data%
276 (i j)
277 ((1 ldb$) (1 *))
278 b-%offset%)
279 (* alpha temp))
280 label110))
281 label120)))
283 (f2cl-lib:fdo (j 1 (f2cl-lib:int-add j 1))
284 ((> j n) nil)
285 (tagbody
286 (f2cl-lib:fdo (i 1 (f2cl-lib:int-add i 1))
287 ((> i m) nil)
288 (tagbody
289 (setf temp
290 (f2cl-lib:fref b-%data%
291 (i j)
292 ((1 ldb$) (1 *))
293 b-%offset%))
294 (cond
295 (noconj
296 (if nounit
297 (setf temp
298 (* temp
299 (f2cl-lib:fref a-%data%
300 (i i)
301 ((1 lda) (1 *))
302 a-%offset%))))
303 (f2cl-lib:fdo (k (f2cl-lib:int-add i 1)
304 (f2cl-lib:int-add k 1))
305 ((> k m) nil)
306 (tagbody
307 (setf temp
308 (+ temp
310 (f2cl-lib:fref a-%data%
311 (k i)
312 ((1 lda) (1 *))
313 a-%offset%)
314 (f2cl-lib:fref b-%data%
315 (k j)
316 ((1 ldb$) (1 *))
317 b-%offset%))))
318 label130)))
320 (if nounit
321 (setf temp
322 (* temp
323 (f2cl-lib:dconjg
324 (f2cl-lib:fref a-%data%
325 (i i)
326 ((1 lda) (1 *))
327 a-%offset%)))))
328 (f2cl-lib:fdo (k (f2cl-lib:int-add i 1)
329 (f2cl-lib:int-add k 1))
330 ((> k m) nil)
331 (tagbody
332 (setf temp
333 (+ temp
335 (f2cl-lib:dconjg
336 (f2cl-lib:fref a-%data%
337 (k i)
338 ((1 lda) (1 *))
339 a-%offset%))
340 (f2cl-lib:fref b-%data%
341 (k j)
342 ((1 ldb$) (1 *))
343 b-%offset%))))
344 label140))))
345 (setf (f2cl-lib:fref b-%data%
346 (i j)
347 ((1 ldb$) (1 *))
348 b-%offset%)
349 (* alpha temp))
350 label150))
351 label160)))))))
353 (cond
354 ((lsame transa "N")
355 (cond
356 (upper
357 (f2cl-lib:fdo (j n (f2cl-lib:int-add j (f2cl-lib:int-sub 1)))
358 ((> j 1) nil)
359 (tagbody
360 (setf temp alpha)
361 (if nounit
362 (setf temp
363 (* temp
364 (f2cl-lib:fref a-%data%
365 (j j)
366 ((1 lda) (1 *))
367 a-%offset%))))
368 (f2cl-lib:fdo (i 1 (f2cl-lib:int-add i 1))
369 ((> i m) nil)
370 (tagbody
371 (setf (f2cl-lib:fref b-%data%
372 (i j)
373 ((1 ldb$) (1 *))
374 b-%offset%)
375 (* temp
376 (f2cl-lib:fref b-%data%
377 (i j)
378 ((1 ldb$) (1 *))
379 b-%offset%)))
380 label170))
381 (f2cl-lib:fdo (k 1 (f2cl-lib:int-add k 1))
382 ((> k
383 (f2cl-lib:int-add j
384 (f2cl-lib:int-sub 1)))
385 nil)
386 (tagbody
387 (cond
388 ((/= (f2cl-lib:fref a (k j) ((1 lda) (1 *))) zero)
389 (setf temp
390 (* alpha
391 (f2cl-lib:fref a-%data%
392 (k j)
393 ((1 lda) (1 *))
394 a-%offset%)))
395 (f2cl-lib:fdo (i 1 (f2cl-lib:int-add i 1))
396 ((> i m) nil)
397 (tagbody
398 (setf (f2cl-lib:fref b-%data%
399 (i j)
400 ((1 ldb$) (1 *))
401 b-%offset%)
403 (f2cl-lib:fref b-%data%
404 (i j)
405 ((1 ldb$) (1 *))
406 b-%offset%)
407 (* temp
408 (f2cl-lib:fref b-%data%
409 (i k)
410 ((1 ldb$) (1 *))
411 b-%offset%))))
412 label180))))
413 label190))
414 label200)))
416 (f2cl-lib:fdo (j 1 (f2cl-lib:int-add j 1))
417 ((> j n) nil)
418 (tagbody
419 (setf temp alpha)
420 (if nounit
421 (setf temp
422 (* temp
423 (f2cl-lib:fref a-%data%
424 (j j)
425 ((1 lda) (1 *))
426 a-%offset%))))
427 (f2cl-lib:fdo (i 1 (f2cl-lib:int-add i 1))
428 ((> i m) nil)
429 (tagbody
430 (setf (f2cl-lib:fref b-%data%
431 (i j)
432 ((1 ldb$) (1 *))
433 b-%offset%)
434 (* temp
435 (f2cl-lib:fref b-%data%
436 (i j)
437 ((1 ldb$) (1 *))
438 b-%offset%)))
439 label210))
440 (f2cl-lib:fdo (k (f2cl-lib:int-add j 1)
441 (f2cl-lib:int-add k 1))
442 ((> k n) nil)
443 (tagbody
444 (cond
445 ((/= (f2cl-lib:fref a (k j) ((1 lda) (1 *))) zero)
446 (setf temp
447 (* alpha
448 (f2cl-lib:fref a-%data%
449 (k j)
450 ((1 lda) (1 *))
451 a-%offset%)))
452 (f2cl-lib:fdo (i 1 (f2cl-lib:int-add i 1))
453 ((> i m) nil)
454 (tagbody
455 (setf (f2cl-lib:fref b-%data%
456 (i j)
457 ((1 ldb$) (1 *))
458 b-%offset%)
460 (f2cl-lib:fref b-%data%
461 (i j)
462 ((1 ldb$) (1 *))
463 b-%offset%)
464 (* temp
465 (f2cl-lib:fref b-%data%
466 (i k)
467 ((1 ldb$) (1 *))
468 b-%offset%))))
469 label220))))
470 label230))
471 label240)))))
473 (cond
474 (upper
475 (f2cl-lib:fdo (k 1 (f2cl-lib:int-add k 1))
476 ((> k n) nil)
477 (tagbody
478 (f2cl-lib:fdo (j 1 (f2cl-lib:int-add j 1))
479 ((> j
480 (f2cl-lib:int-add k
481 (f2cl-lib:int-sub 1)))
482 nil)
483 (tagbody
484 (cond
485 ((/= (f2cl-lib:fref a (j k) ((1 lda) (1 *))) zero)
486 (cond
487 (noconj
488 (setf temp
489 (* alpha
490 (f2cl-lib:fref a-%data%
491 (j k)
492 ((1 lda) (1 *))
493 a-%offset%))))
495 (setf temp
496 (* alpha
497 (f2cl-lib:dconjg
498 (f2cl-lib:fref a-%data%
499 (j k)
500 ((1 lda) (1 *))
501 a-%offset%))))))
502 (f2cl-lib:fdo (i 1 (f2cl-lib:int-add i 1))
503 ((> i m) nil)
504 (tagbody
505 (setf (f2cl-lib:fref b-%data%
506 (i j)
507 ((1 ldb$) (1 *))
508 b-%offset%)
510 (f2cl-lib:fref b-%data%
511 (i j)
512 ((1 ldb$) (1 *))
513 b-%offset%)
514 (* temp
515 (f2cl-lib:fref b-%data%
516 (i k)
517 ((1 ldb$) (1 *))
518 b-%offset%))))
519 label250))))
520 label260))
521 (setf temp alpha)
522 (cond
523 (nounit
524 (cond
525 (noconj
526 (setf temp
527 (* temp
528 (f2cl-lib:fref a-%data%
529 (k k)
530 ((1 lda) (1 *))
531 a-%offset%))))
533 (setf temp
534 (* temp
535 (f2cl-lib:dconjg
536 (f2cl-lib:fref a-%data%
537 (k k)
538 ((1 lda) (1 *))
539 a-%offset%))))))))
540 (cond
541 ((/= temp one)
542 (f2cl-lib:fdo (i 1 (f2cl-lib:int-add i 1))
543 ((> i m) nil)
544 (tagbody
545 (setf (f2cl-lib:fref b-%data%
546 (i k)
547 ((1 ldb$) (1 *))
548 b-%offset%)
549 (* temp
550 (f2cl-lib:fref b-%data%
551 (i k)
552 ((1 ldb$) (1 *))
553 b-%offset%)))
554 label270))))
555 label280)))
557 (f2cl-lib:fdo (k n (f2cl-lib:int-add k (f2cl-lib:int-sub 1)))
558 ((> k 1) nil)
559 (tagbody
560 (f2cl-lib:fdo (j (f2cl-lib:int-add k 1)
561 (f2cl-lib:int-add j 1))
562 ((> j n) nil)
563 (tagbody
564 (cond
565 ((/= (f2cl-lib:fref a (j k) ((1 lda) (1 *))) zero)
566 (cond
567 (noconj
568 (setf temp
569 (* alpha
570 (f2cl-lib:fref a-%data%
571 (j k)
572 ((1 lda) (1 *))
573 a-%offset%))))
575 (setf temp
576 (* alpha
577 (f2cl-lib:dconjg
578 (f2cl-lib:fref a-%data%
579 (j k)
580 ((1 lda) (1 *))
581 a-%offset%))))))
582 (f2cl-lib:fdo (i 1 (f2cl-lib:int-add i 1))
583 ((> i m) nil)
584 (tagbody
585 (setf (f2cl-lib:fref b-%data%
586 (i j)
587 ((1 ldb$) (1 *))
588 b-%offset%)
590 (f2cl-lib:fref b-%data%
591 (i j)
592 ((1 ldb$) (1 *))
593 b-%offset%)
594 (* temp
595 (f2cl-lib:fref b-%data%
596 (i k)
597 ((1 ldb$) (1 *))
598 b-%offset%))))
599 label290))))
600 label300))
601 (setf temp alpha)
602 (cond
603 (nounit
604 (cond
605 (noconj
606 (setf temp
607 (* temp
608 (f2cl-lib:fref a-%data%
609 (k k)
610 ((1 lda) (1 *))
611 a-%offset%))))
613 (setf temp
614 (* temp
615 (f2cl-lib:dconjg
616 (f2cl-lib:fref a-%data%
617 (k k)
618 ((1 lda) (1 *))
619 a-%offset%))))))))
620 (cond
621 ((/= temp one)
622 (f2cl-lib:fdo (i 1 (f2cl-lib:int-add i 1))
623 ((> i m) nil)
624 (tagbody
625 (setf (f2cl-lib:fref b-%data%
626 (i k)
627 ((1 ldb$) (1 *))
628 b-%offset%)
629 (* temp
630 (f2cl-lib:fref b-%data%
631 (i k)
632 ((1 ldb$) (1 *))
633 b-%offset%)))
634 label310))))
635 label320))))))))
636 (go end_label)
637 end_label
638 (return (values nil nil nil nil nil nil nil nil nil nil nil))))))
640 (in-package #-gcl #:cl-user #+gcl "CL-USER")
641 #+#.(cl:if (cl:find-package '#:f2cl) '(and) '(or))
642 (eval-when (:load-toplevel :compile-toplevel :execute)
643 (setf (gethash 'fortran-to-lisp::ztrmm fortran-to-lisp::*f2cl-function-info*)
644 (fortran-to-lisp::make-f2cl-finfo
645 :arg-types '((simple-string) (simple-string) (simple-string)
646 (simple-string) (fortran-to-lisp::integer4)
647 (fortran-to-lisp::integer4)
648 (fortran-to-lisp::complex16)
649 (array fortran-to-lisp::complex16 (*))
650 (fortran-to-lisp::integer4)
651 (array fortran-to-lisp::complex16 (*))
652 (fortran-to-lisp::integer4))
653 :return-values '(nil nil nil nil nil nil nil nil nil nil nil)
654 :calls '(fortran-to-lisp::xerbla fortran-to-lisp::lsame))))