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 (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
)
24 (defun zsyr2k (uplo trans n k alpha a lda b ldb$ beta c ldc
)
25 (declare (type (array f2cl-lib
:complex16
(*)) c b a
)
26 (type (f2cl-lib:complex16
) beta alpha
)
27 (type (f2cl-lib:integer4
) ldc ldb$ lda k n
)
28 (type (simple-string *) trans uplo
))
29 (f2cl-lib:with-multi-array-data
30 ((uplo character uplo-%data% uplo-%offset%
)
31 (trans character trans-%data% trans-%offset%
)
32 (a f2cl-lib
:complex16 a-%data% a-%offset%
)
33 (b f2cl-lib
:complex16 b-%data% b-%offset%
)
34 (c f2cl-lib
:complex16 c-%data% c-%offset%
))
35 (prog ((temp1 #C
(0.0
0.0)) (temp2 #C
(0.0
0.0)) (i 0) (info 0) (j 0) (l 0)
36 (nrowa 0) (upper nil
))
37 (declare (type (f2cl-lib:complex16
) temp1 temp2
)
38 (type (f2cl-lib:integer4
) i info j l nrowa
)
39 (type f2cl-lib
:logical upper
))
45 (setf upper
(lsame uplo
"U"))
48 ((and (not upper
) (not (lsame uplo
"L")))
50 ((and (not (lsame trans
"N")) (not (lsame trans
"T")))
56 ((< lda
(max (the f2cl-lib
:integer4
1) (the f2cl-lib
:integer4 nrowa
)))
59 (max (the f2cl-lib
:integer4
1) (the f2cl-lib
:integer4 nrowa
)))
61 ((< ldc
(max (the f2cl-lib
:integer4
1) (the f2cl-lib
:integer4 n
)))
65 (xerbla "ZSYR2K" info
)
67 (if (or (= n
0) (and (or (= alpha zero
) (= k
0)) (= beta one
)))
75 (f2cl-lib:fdo
(j 1 (f2cl-lib:int-add j
1))
78 (f2cl-lib:fdo
(i 1 (f2cl-lib:int-add i
1))
81 (setf (f2cl-lib:fref c-%data%
89 (f2cl-lib:fdo
(j 1 (f2cl-lib:int-add j
1))
92 (f2cl-lib:fdo
(i 1 (f2cl-lib:int-add i
1))
95 (setf (f2cl-lib:fref c-%data%
100 (f2cl-lib:fref c-%data%
109 (f2cl-lib:fdo
(j 1 (f2cl-lib:int-add j
1))
112 (f2cl-lib:fdo
(i j
(f2cl-lib:int-add i
1))
115 (setf (f2cl-lib:fref c-%data%
123 (f2cl-lib:fdo
(j 1 (f2cl-lib:int-add j
1))
126 (f2cl-lib:fdo
(i j
(f2cl-lib:int-add i
1))
129 (setf (f2cl-lib:fref c-%data%
134 (f2cl-lib:fref c-%data%
145 (f2cl-lib:fdo
(j 1 (f2cl-lib:int-add j
1))
150 (f2cl-lib:fdo
(i 1 (f2cl-lib:int-add i
1))
153 (setf (f2cl-lib:fref c-%data%
160 (f2cl-lib:fdo
(i 1 (f2cl-lib:int-add i
1))
163 (setf (f2cl-lib:fref c-%data%
168 (f2cl-lib:fref c-%data%
173 (f2cl-lib:fdo
(l 1 (f2cl-lib:int-add l
1))
177 ((or (/= (f2cl-lib:fref a
(j l
) ((1 lda
) (1 *))) zero
)
178 (/= (f2cl-lib:fref b
(j l
) ((1 ldb$
) (1 *))) zero
))
181 (f2cl-lib:fref b-%data%
187 (f2cl-lib:fref a-%data%
191 (f2cl-lib:fdo
(i 1 (f2cl-lib:int-add i
1))
194 (setf (f2cl-lib:fref c-%data%
199 (f2cl-lib:fref c-%data%
204 (f2cl-lib:fref a-%data%
210 (f2cl-lib:fref b-%data%
219 (f2cl-lib:fdo
(j 1 (f2cl-lib:int-add j
1))
224 (f2cl-lib:fdo
(i j
(f2cl-lib:int-add i
1))
227 (setf (f2cl-lib:fref c-%data%
234 (f2cl-lib:fdo
(i j
(f2cl-lib:int-add i
1))
237 (setf (f2cl-lib:fref c-%data%
242 (f2cl-lib:fref c-%data%
247 (f2cl-lib:fdo
(l 1 (f2cl-lib:int-add l
1))
251 ((or (/= (f2cl-lib:fref a
(j l
) ((1 lda
) (1 *))) zero
)
252 (/= (f2cl-lib:fref b
(j l
) ((1 ldb$
) (1 *))) zero
))
255 (f2cl-lib:fref b-%data%
261 (f2cl-lib:fref a-%data%
265 (f2cl-lib:fdo
(i j
(f2cl-lib:int-add i
1))
268 (setf (f2cl-lib:fref c-%data%
273 (f2cl-lib:fref c-%data%
278 (f2cl-lib:fref a-%data%
284 (f2cl-lib:fref b-%data%
295 (f2cl-lib:fdo
(j 1 (f2cl-lib:int-add j
1))
298 (f2cl-lib:fdo
(i 1 (f2cl-lib:int-add i
1))
303 (f2cl-lib:fdo
(l 1 (f2cl-lib:int-add l
1))
309 (f2cl-lib:fref a-%data%
313 (f2cl-lib:fref b-%data%
320 (f2cl-lib:fref b-%data%
324 (f2cl-lib:fref a-%data%
331 (setf (f2cl-lib:fref c-%data%
335 (+ (* alpha temp1
) (* alpha temp2
))))
337 (setf (f2cl-lib:fref c-%data%
343 (f2cl-lib:fref c-%data%
352 (f2cl-lib:fdo
(j 1 (f2cl-lib:int-add j
1))
355 (f2cl-lib:fdo
(i j
(f2cl-lib:int-add i
1))
360 (f2cl-lib:fdo
(l 1 (f2cl-lib:int-add l
1))
366 (f2cl-lib:fref a-%data%
370 (f2cl-lib:fref b-%data%
377 (f2cl-lib:fref b-%data%
381 (f2cl-lib:fref a-%data%
388 (setf (f2cl-lib:fref c-%data%
392 (+ (* alpha temp1
) (* alpha temp2
))))
394 (setf (f2cl-lib:fref c-%data%
400 (f2cl-lib:fref c-%data%
410 (return (values nil nil nil nil nil nil nil nil nil nil nil nil
))))))
412 (in-package #:cl-user
)
413 #+#.
(cl:if
(cl:find-package
'#:f2cl
) '(and) '(or))
414 (eval-when (:load-toplevel
:compile-toplevel
:execute
)
415 (setf (gethash 'fortran-to-lisp
::zsyr2k
416 fortran-to-lisp
::*f2cl-function-info
*)
417 (fortran-to-lisp::make-f2cl-finfo
418 :arg-types
'((simple-string) (simple-string)
419 (fortran-to-lisp::integer4
) (fortran-to-lisp::integer4
)
420 (fortran-to-lisp::complex16
)
421 (array fortran-to-lisp
::complex16
(*))
422 (fortran-to-lisp::integer4
)
423 (array fortran-to-lisp
::complex16
(*))
424 (fortran-to-lisp::integer4
)
425 (fortran-to-lisp::complex16
)
426 (array fortran-to-lisp
::complex16
(*))
427 (fortran-to-lisp::integer4
))
428 :return-values
'(nil nil nil nil nil nil nil nil nil nil nil nil
)
429 :calls
'(fortran-to-lisp::xerbla fortran-to-lisp
::lsame
))))