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 0.0))
21 (declare (type (double-float 1.0 1.0) one
)
22 (type (double-float 0.0 0.0) zero
)
24 (defun dsyr2k (uplo trans n k alpha a lda b ldb$ beta c ldc
)
25 (declare (type (array double-float
(*)) c b a
)
26 (type (double-float) 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 double-float a-%data% a-%offset%
)
33 (b double-float b-%data% b-%offset%
)
34 (c double-float c-%data% c-%offset%
))
35 (prog ((temp1 0.0) (temp2 0.0) (i 0) (info 0) (j 0) (l 0) (nrowa 0)
37 (declare (type (double-float) 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"))
51 (not (lsame trans
"T"))
52 (not (lsame trans
"C")))
58 ((< lda
(max (the f2cl-lib
:integer4
1) (the f2cl-lib
:integer4 nrowa
)))
61 (max (the f2cl-lib
:integer4
1) (the f2cl-lib
:integer4 nrowa
)))
63 ((< ldc
(max (the f2cl-lib
:integer4
1) (the f2cl-lib
:integer4 n
)))
67 (xerbla "DSYR2K" info
)
69 (if (or (= n
0) (and (or (= alpha zero
) (= k
0)) (= beta one
)))
77 (f2cl-lib:fdo
(j 1 (f2cl-lib:int-add j
1))
80 (f2cl-lib:fdo
(i 1 (f2cl-lib:int-add i
1))
83 (setf (f2cl-lib:fref c-%data%
91 (f2cl-lib:fdo
(j 1 (f2cl-lib:int-add j
1))
94 (f2cl-lib:fdo
(i 1 (f2cl-lib:int-add i
1))
97 (setf (f2cl-lib:fref c-%data%
102 (f2cl-lib:fref c-%data%
111 (f2cl-lib:fdo
(j 1 (f2cl-lib:int-add j
1))
114 (f2cl-lib:fdo
(i j
(f2cl-lib:int-add i
1))
117 (setf (f2cl-lib:fref c-%data%
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%
136 (f2cl-lib:fref c-%data%
147 (f2cl-lib:fdo
(j 1 (f2cl-lib:int-add j
1))
152 (f2cl-lib:fdo
(i 1 (f2cl-lib:int-add i
1))
155 (setf (f2cl-lib:fref c-%data%
162 (f2cl-lib:fdo
(i 1 (f2cl-lib:int-add i
1))
165 (setf (f2cl-lib:fref c-%data%
170 (f2cl-lib:fref c-%data%
175 (f2cl-lib:fdo
(l 1 (f2cl-lib:int-add l
1))
179 ((or (/= (f2cl-lib:fref a
(j l
) ((1 lda
) (1 *))) zero
)
180 (/= (f2cl-lib:fref b
(j l
) ((1 ldb$
) (1 *))) zero
))
183 (f2cl-lib:fref b-%data%
189 (f2cl-lib:fref a-%data%
193 (f2cl-lib:fdo
(i 1 (f2cl-lib:int-add i
1))
196 (setf (f2cl-lib:fref c-%data%
201 (f2cl-lib:fref c-%data%
206 (f2cl-lib:fref a-%data%
212 (f2cl-lib:fref b-%data%
221 (f2cl-lib:fdo
(j 1 (f2cl-lib:int-add j
1))
226 (f2cl-lib:fdo
(i j
(f2cl-lib:int-add i
1))
229 (setf (f2cl-lib:fref c-%data%
236 (f2cl-lib:fdo
(i j
(f2cl-lib:int-add i
1))
239 (setf (f2cl-lib:fref c-%data%
244 (f2cl-lib:fref c-%data%
249 (f2cl-lib:fdo
(l 1 (f2cl-lib:int-add l
1))
253 ((or (/= (f2cl-lib:fref a
(j l
) ((1 lda
) (1 *))) zero
)
254 (/= (f2cl-lib:fref b
(j l
) ((1 ldb$
) (1 *))) zero
))
257 (f2cl-lib:fref b-%data%
263 (f2cl-lib:fref a-%data%
267 (f2cl-lib:fdo
(i j
(f2cl-lib:int-add i
1))
270 (setf (f2cl-lib:fref c-%data%
275 (f2cl-lib:fref c-%data%
280 (f2cl-lib:fref a-%data%
286 (f2cl-lib:fref b-%data%
297 (f2cl-lib:fdo
(j 1 (f2cl-lib:int-add j
1))
300 (f2cl-lib:fdo
(i 1 (f2cl-lib:int-add i
1))
305 (f2cl-lib:fdo
(l 1 (f2cl-lib:int-add l
1))
311 (f2cl-lib:fref a-%data%
315 (f2cl-lib:fref b-%data%
322 (f2cl-lib:fref b-%data%
326 (f2cl-lib:fref a-%data%
333 (setf (f2cl-lib:fref c-%data%
337 (+ (* alpha temp1
) (* alpha temp2
))))
339 (setf (f2cl-lib:fref c-%data%
345 (f2cl-lib:fref c-%data%
354 (f2cl-lib:fdo
(j 1 (f2cl-lib:int-add j
1))
357 (f2cl-lib:fdo
(i j
(f2cl-lib:int-add i
1))
362 (f2cl-lib:fdo
(l 1 (f2cl-lib:int-add l
1))
368 (f2cl-lib:fref a-%data%
372 (f2cl-lib:fref b-%data%
379 (f2cl-lib:fref b-%data%
383 (f2cl-lib:fref a-%data%
390 (setf (f2cl-lib:fref c-%data%
394 (+ (* alpha temp1
) (* alpha temp2
))))
396 (setf (f2cl-lib:fref c-%data%
402 (f2cl-lib:fref c-%data%
412 (return (values nil nil nil nil nil nil nil nil nil nil nil nil
))))))
414 (in-package #:cl-user
)
415 #+#.
(cl:if
(cl:find-package
'#:f2cl
) '(and) '(or))
416 (eval-when (:load-toplevel
:compile-toplevel
:execute
)
417 (setf (gethash 'fortran-to-lisp
::dsyr2k
418 fortran-to-lisp
::*f2cl-function-info
*)
419 (fortran-to-lisp::make-f2cl-finfo
420 :arg-types
'((simple-string) (simple-string)
421 (fortran-to-lisp::integer4
) (fortran-to-lisp::integer4
)
422 (double-float) (array double-float
(*))
423 (fortran-to-lisp::integer4
) (array double-float
(*))
424 (fortran-to-lisp::integer4
) (double-float)
425 (array double-float
(*)) (fortran-to-lisp::integer4
))
426 :return-values
'(nil nil nil nil nil nil nil nil nil nil nil nil
)
427 :calls
'(fortran-to-lisp::xerbla fortran-to-lisp
::lsame
))))