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)
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))
20 (let* ((one 1.0) (zero (f2cl-lib:cmplx
0.0 0.0)))
21 (declare (type (double-float 1.0 1.0) one
)
22 (type (f2cl-lib:complex16
) zero
)
24 (defun zher2k (uplo trans n k alpha a lda b ldb$ beta c ldc
)
25 (declare (type (double-float) beta
)
26 (type (array f2cl-lib
:complex16
(*)) c b a
)
27 (type (f2cl-lib:complex16
) alpha
)
28 (type (f2cl-lib:integer4
) ldc ldb$ lda k n
)
29 (type (simple-string *) trans uplo
))
30 (f2cl-lib:with-multi-array-data
31 ((uplo character uplo-%data% uplo-%offset%
)
32 (trans character trans-%data% trans-%offset%
)
33 (a f2cl-lib
:complex16 a-%data% a-%offset%
)
34 (b f2cl-lib
:complex16 b-%data% b-%offset%
)
35 (c f2cl-lib
:complex16 c-%data% c-%offset%
))
36 (prog ((temp1 #C
(0.0
0.0)) (temp2 #C
(0.0
0.0)) (i 0) (info 0) (j 0) (l 0)
37 (nrowa 0) (upper nil
))
38 (declare (type (f2cl-lib:complex16
) temp1 temp2
)
39 (type (f2cl-lib:integer4
) i info j l nrowa
)
40 (type f2cl-lib
:logical upper
))
46 (setf upper
(lsame uplo
"U"))
49 ((and (not upper
) (not (lsame uplo
"L")))
51 ((and (not (lsame trans
"N")) (not (lsame trans
"C")))
57 ((< lda
(max (the f2cl-lib
:integer4
1) (the f2cl-lib
:integer4 nrowa
)))
60 (max (the f2cl-lib
:integer4
1) (the f2cl-lib
:integer4 nrowa
)))
62 ((< ldc
(max (the f2cl-lib
:integer4
1) (the f2cl-lib
:integer4 n
)))
66 (xerbla "ZHER2K" info
)
68 (if (or (= n
0) (and (or (= alpha zero
) (= k
0)) (= beta one
)))
75 ((= beta
(f2cl-lib:dble zero
))
76 (f2cl-lib:fdo
(j 1 (f2cl-lib:int-add j
1))
79 (f2cl-lib:fdo
(i 1 (f2cl-lib:int-add i
1))
82 (setf (f2cl-lib:fref c-%data%
90 (f2cl-lib:fdo
(j 1 (f2cl-lib:int-add j
1))
93 (f2cl-lib:fdo
(i 1 (f2cl-lib:int-add i
1))
96 (f2cl-lib:int-sub
1)))
99 (setf (f2cl-lib:fref c-%data%
104 (f2cl-lib:fref c-%data%
109 (setf (f2cl-lib:fref c-%data%
116 (f2cl-lib:fref c-%data%
120 'f2cl-lib
:complex16
))
124 ((= beta
(f2cl-lib:dble zero
))
125 (f2cl-lib:fdo
(j 1 (f2cl-lib:int-add j
1))
128 (f2cl-lib:fdo
(i j
(f2cl-lib:int-add i
1))
131 (setf (f2cl-lib:fref c-%data%
139 (f2cl-lib:fdo
(j 1 (f2cl-lib:int-add j
1))
142 (setf (f2cl-lib:fref c-%data%
149 (f2cl-lib:fref c-%data%
153 'f2cl-lib
:complex16
))
154 (f2cl-lib:fdo
(i (f2cl-lib:int-add j
1)
155 (f2cl-lib:int-add i
1))
158 (setf (f2cl-lib:fref c-%data%
163 (f2cl-lib:fref c-%data%
174 (f2cl-lib:fdo
(j 1 (f2cl-lib:int-add j
1))
178 ((= beta
(f2cl-lib:dble zero
))
179 (f2cl-lib:fdo
(i 1 (f2cl-lib:int-add i
1))
182 (setf (f2cl-lib:fref c-%data%
189 (f2cl-lib:fdo
(i 1 (f2cl-lib:int-add i
1))
192 (f2cl-lib:int-sub
1)))
195 (setf (f2cl-lib:fref c-%data%
200 (f2cl-lib:fref c-%data%
205 (setf (f2cl-lib:fref c-%data%
212 (f2cl-lib:fref c-%data%
216 'f2cl-lib
:complex16
)))
218 (setf (f2cl-lib:fref c-%data%
224 (f2cl-lib:fref c-%data%
228 'f2cl-lib
:complex16
))))
229 (f2cl-lib:fdo
(l 1 (f2cl-lib:int-add l
1))
233 ((or (/= (f2cl-lib:fref a
(j l
) ((1 lda
) (1 *))) zero
)
234 (/= (f2cl-lib:fref b
(j l
) ((1 ldb$
) (1 *))) zero
))
238 (f2cl-lib:fref b-%data%
246 (f2cl-lib:fref a-%data%
250 'f2cl-lib
:complex16
))
251 (f2cl-lib:fdo
(i 1 (f2cl-lib:int-add i
1))
258 (setf (f2cl-lib:fref c-%data%
263 (f2cl-lib:fref c-%data%
268 (f2cl-lib:fref a-%data%
274 (f2cl-lib:fref b-%data%
280 (setf (f2cl-lib:fref c-%data%
287 (f2cl-lib:fref c-%data%
294 (f2cl-lib:fref a-%data%
300 (f2cl-lib:fref b-%data%
305 'f2cl-lib
:complex16
))))
309 (f2cl-lib:fdo
(j 1 (f2cl-lib:int-add j
1))
313 ((= beta
(f2cl-lib:dble zero
))
314 (f2cl-lib:fdo
(i j
(f2cl-lib:int-add i
1))
317 (setf (f2cl-lib:fref c-%data%
324 (f2cl-lib:fdo
(i (f2cl-lib:int-add j
1)
325 (f2cl-lib:int-add i
1))
328 (setf (f2cl-lib:fref c-%data%
333 (f2cl-lib:fref c-%data%
338 (setf (f2cl-lib:fref c-%data%
345 (f2cl-lib:fref c-%data%
349 'f2cl-lib
:complex16
)))
351 (setf (f2cl-lib:fref c-%data%
357 (f2cl-lib:fref c-%data%
361 'f2cl-lib
:complex16
))))
362 (f2cl-lib:fdo
(l 1 (f2cl-lib:int-add l
1))
366 ((or (/= (f2cl-lib:fref a
(j l
) ((1 lda
) (1 *))) zero
)
367 (/= (f2cl-lib:fref b
(j l
) ((1 ldb$
) (1 *))) zero
))
371 (f2cl-lib:fref b-%data%
379 (f2cl-lib:fref a-%data%
383 'f2cl-lib
:complex16
))
384 (f2cl-lib:fdo
(i (f2cl-lib:int-add j
1)
385 (f2cl-lib:int-add i
1))
388 (setf (f2cl-lib:fref c-%data%
393 (f2cl-lib:fref c-%data%
398 (f2cl-lib:fref a-%data%
404 (f2cl-lib:fref b-%data%
410 (setf (f2cl-lib:fref c-%data%
417 (f2cl-lib:fref c-%data%
424 (f2cl-lib:fref a-%data%
430 (f2cl-lib:fref b-%data%
435 'f2cl-lib
:complex16
))))
441 (f2cl-lib:fdo
(j 1 (f2cl-lib:int-add j
1))
444 (f2cl-lib:fdo
(i 1 (f2cl-lib:int-add i
1))
449 (f2cl-lib:fdo
(l 1 (f2cl-lib:int-add l
1))
456 (f2cl-lib:fref a-%data%
460 (f2cl-lib:fref b-%data%
468 (f2cl-lib:fref b-%data%
472 (f2cl-lib:fref a-%data%
480 ((= beta
(f2cl-lib:dble zero
))
481 (setf (f2cl-lib:fref c-%data%
488 (* (f2cl-lib:dconjg alpha
) temp2
)))
489 'f2cl-lib
:complex16
)))
491 (setf (f2cl-lib:fref c-%data%
499 (f2cl-lib:fref c-%data%
505 (* (f2cl-lib:dconjg alpha
) temp2
))))
506 'f2cl-lib
:complex16
)))))
509 ((= beta
(f2cl-lib:dble zero
))
510 (setf (f2cl-lib:fref c-%data%
515 (* (f2cl-lib:dconjg alpha
) temp2
))))
517 (setf (f2cl-lib:fref c-%data%
523 (f2cl-lib:fref c-%data%
528 (* (f2cl-lib:dconjg alpha
) temp2
)))))))
532 (f2cl-lib:fdo
(j 1 (f2cl-lib:int-add j
1))
535 (f2cl-lib:fdo
(i j
(f2cl-lib:int-add i
1))
540 (f2cl-lib:fdo
(l 1 (f2cl-lib:int-add l
1))
547 (f2cl-lib:fref a-%data%
551 (f2cl-lib:fref b-%data%
559 (f2cl-lib:fref b-%data%
563 (f2cl-lib:fref a-%data%
571 ((= beta
(f2cl-lib:dble zero
))
572 (setf (f2cl-lib:fref c-%data%
579 (* (f2cl-lib:dconjg alpha
) temp2
)))
580 'f2cl-lib
:complex16
)))
582 (setf (f2cl-lib:fref c-%data%
590 (f2cl-lib:fref c-%data%
596 (* (f2cl-lib:dconjg alpha
) temp2
))))
597 'f2cl-lib
:complex16
)))))
600 ((= beta
(f2cl-lib:dble zero
))
601 (setf (f2cl-lib:fref c-%data%
606 (* (f2cl-lib:dconjg alpha
) temp2
))))
608 (setf (f2cl-lib:fref c-%data%
614 (f2cl-lib:fref c-%data%
619 (* (f2cl-lib:dconjg alpha
) temp2
)))))))
624 (return (values nil nil nil nil nil nil nil nil nil nil nil nil
))))))
626 (in-package #:cl-user
)
627 #+#.
(cl:if
(cl:find-package
'#:f2cl
) '(and) '(or))
628 (eval-when (:load-toplevel
:compile-toplevel
:execute
)
629 (setf (gethash 'fortran-to-lisp
::zher2k
630 fortran-to-lisp
::*f2cl-function-info
*)
631 (fortran-to-lisp::make-f2cl-finfo
632 :arg-types
'((simple-string) (simple-string)
633 (fortran-to-lisp::integer4
) (fortran-to-lisp::integer4
)
634 (fortran-to-lisp::complex16
)
635 (array fortran-to-lisp
::complex16
(*))
636 (fortran-to-lisp::integer4
)
637 (array fortran-to-lisp
::complex16
(*))
638 (fortran-to-lisp::integer4
) (double-float)
639 (array fortran-to-lisp
::complex16
(*))
640 (fortran-to-lisp::integer4
))
641 :return-values
'(nil nil nil nil nil nil nil nil nil nil nil nil
)
642 :calls
'(fortran-to-lisp::xerbla fortran-to-lisp
::lsame
))))