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 zherk (uplo trans n k alpha a lda beta c ldc
)
25 (declare (type (array f2cl-lib
:complex16
(*)) c a
)
26 (type (double-float) beta alpha
)
27 (type (f2cl-lib:integer4
) ldc 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 (c f2cl-lib
:complex16 c-%data% c-%offset%
))
34 (prog ((temp #C
(0.0
0.0)) (rtemp 0.0) (i 0) (info 0) (j 0) (l 0)
35 (nrowa 0) (upper nil
))
36 (declare (type (f2cl-lib:complex16
) temp
)
37 (type (double-float) rtemp
)
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
"C")))
56 ((< lda
(max (the f2cl-lib
:integer4
1) (the f2cl-lib
:integer4 nrowa
)))
58 ((< ldc
(max (the f2cl-lib
:integer4
1) (the f2cl-lib
:integer4 n
)))
62 (xerbla "ZHERK " info
)
64 (if (or (= n
0) (and (or (= alpha zero
) (= k
0)) (= beta one
)))
72 (f2cl-lib:fdo
(j 1 (f2cl-lib:int-add j
1))
75 (f2cl-lib:fdo
(i 1 (f2cl-lib:int-add i
1))
78 (setf (f2cl-lib:fref c-%data%
82 (coerce zero
'f2cl-lib
:complex16
))
86 (f2cl-lib:fdo
(j 1 (f2cl-lib:int-add j
1))
89 (f2cl-lib:fdo
(i 1 (f2cl-lib:int-add i
1))
92 (f2cl-lib:int-sub
1)))
95 (setf (f2cl-lib:fref c-%data%
100 (f2cl-lib:fref c-%data%
105 (setf (f2cl-lib:fref c-%data%
112 (f2cl-lib:fref c-%data%
116 'f2cl-lib
:complex16
))
121 (f2cl-lib:fdo
(j 1 (f2cl-lib:int-add j
1))
124 (f2cl-lib:fdo
(i j
(f2cl-lib:int-add i
1))
127 (setf (f2cl-lib:fref c-%data%
131 (coerce zero
'f2cl-lib
:complex16
))
135 (f2cl-lib:fdo
(j 1 (f2cl-lib:int-add j
1))
138 (setf (f2cl-lib:fref c-%data%
145 (f2cl-lib:fref c-%data%
149 'f2cl-lib
:complex16
))
150 (f2cl-lib:fdo
(i (f2cl-lib:int-add j
1)
151 (f2cl-lib:int-add i
1))
154 (setf (f2cl-lib:fref c-%data%
159 (f2cl-lib:fref c-%data%
170 (f2cl-lib:fdo
(j 1 (f2cl-lib:int-add j
1))
175 (f2cl-lib:fdo
(i 1 (f2cl-lib:int-add i
1))
178 (setf (f2cl-lib:fref c-%data%
182 (coerce zero
'f2cl-lib
:complex16
))
185 (f2cl-lib:fdo
(i 1 (f2cl-lib:int-add i
1))
188 (f2cl-lib:int-sub
1)))
191 (setf (f2cl-lib:fref c-%data%
196 (f2cl-lib:fref c-%data%
201 (setf (f2cl-lib:fref c-%data%
208 (f2cl-lib:fref c-%data%
212 'f2cl-lib
:complex16
)))
214 (setf (f2cl-lib:fref c-%data%
220 (f2cl-lib:fref c-%data%
224 'f2cl-lib
:complex16
))))
225 (f2cl-lib:fdo
(l 1 (f2cl-lib:int-add l
1))
229 ((/= (f2cl-lib:fref a
(j l
) ((1 lda
) (1 *)))
230 (f2cl-lib:dcmplx zero
))
235 (f2cl-lib:fref a-%data%
239 'f2cl-lib
:complex16
))
240 (f2cl-lib:fdo
(i 1 (f2cl-lib:int-add i
1))
247 (setf (f2cl-lib:fref c-%data%
252 (f2cl-lib:fref c-%data%
257 (f2cl-lib:fref a-%data%
262 (setf (f2cl-lib:fref c-%data%
269 (f2cl-lib:fref c-%data%
275 (f2cl-lib:fref a-%data%
279 'f2cl-lib
:complex16
))))
283 (f2cl-lib:fdo
(j 1 (f2cl-lib:int-add j
1))
288 (f2cl-lib:fdo
(i j
(f2cl-lib:int-add i
1))
291 (setf (f2cl-lib:fref c-%data%
295 (coerce zero
'f2cl-lib
:complex16
))
298 (setf (f2cl-lib:fref c-%data%
305 (f2cl-lib:fref c-%data%
309 'f2cl-lib
:complex16
))
310 (f2cl-lib:fdo
(i (f2cl-lib:int-add j
1)
311 (f2cl-lib:int-add i
1))
314 (setf (f2cl-lib:fref c-%data%
319 (f2cl-lib:fref c-%data%
325 (setf (f2cl-lib:fref c-%data%
331 (f2cl-lib:fref c-%data%
335 'f2cl-lib
:complex16
))))
336 (f2cl-lib:fdo
(l 1 (f2cl-lib:int-add l
1))
340 ((/= (f2cl-lib:fref a
(j l
) ((1 lda
) (1 *)))
341 (f2cl-lib:dcmplx zero
))
346 (f2cl-lib:fref a-%data%
350 'f2cl-lib
:complex16
))
351 (setf (f2cl-lib:fref c-%data%
358 (f2cl-lib:fref c-%data%
364 (f2cl-lib:fref a-%data%
368 'f2cl-lib
:complex16
))
369 (f2cl-lib:fdo
(i (f2cl-lib:int-add j
1)
370 (f2cl-lib:int-add i
1))
373 (setf (f2cl-lib:fref c-%data%
378 (f2cl-lib:fref c-%data%
383 (f2cl-lib:fref a-%data%
393 (f2cl-lib:fdo
(j 1 (f2cl-lib:int-add j
1))
396 (f2cl-lib:fdo
(i 1 (f2cl-lib:int-add i
1))
398 (f2cl-lib:int-add j
(f2cl-lib:int-sub
1)))
401 (setf temp
(coerce zero
'f2cl-lib
:complex16
))
402 (f2cl-lib:fdo
(l 1 (f2cl-lib:int-add l
1))
409 (f2cl-lib:fref a-%data%
413 (f2cl-lib:fref a-%data%
420 (setf (f2cl-lib:fref c-%data%
426 (setf (f2cl-lib:fref c-%data%
432 (f2cl-lib:fref c-%data%
438 (f2cl-lib:fdo
(l 1 (f2cl-lib:int-add l
1))
447 (f2cl-lib:fref a-%data%
451 (f2cl-lib:fref a-%data%
459 (setf (f2cl-lib:fref c-%data%
463 (coerce (* alpha rtemp
) 'f2cl-lib
:complex16
)))
465 (setf (f2cl-lib:fref c-%data%
473 (f2cl-lib:fref c-%data%
477 'f2cl-lib
:complex16
))))
480 (f2cl-lib:fdo
(j 1 (f2cl-lib:int-add j
1))
484 (f2cl-lib:fdo
(l 1 (f2cl-lib:int-add l
1))
493 (f2cl-lib:fref a-%data%
497 (f2cl-lib:fref a-%data%
505 (setf (f2cl-lib:fref c-%data%
509 (coerce (* alpha rtemp
) 'f2cl-lib
:complex16
)))
511 (setf (f2cl-lib:fref c-%data%
519 (f2cl-lib:fref c-%data%
523 'f2cl-lib
:complex16
))))
524 (f2cl-lib:fdo
(i (f2cl-lib:int-add j
1)
525 (f2cl-lib:int-add i
1))
528 (setf temp
(coerce zero
'f2cl-lib
:complex16
))
529 (f2cl-lib:fdo
(l 1 (f2cl-lib:int-add l
1))
536 (f2cl-lib:fref a-%data%
540 (f2cl-lib:fref a-%data%
547 (setf (f2cl-lib:fref c-%data%
553 (setf (f2cl-lib:fref c-%data%
559 (f2cl-lib:fref c-%data%
567 (return (values nil nil nil nil nil nil nil nil nil nil
))))))
569 (in-package #:cl-user
)
570 #+#.
(cl:if
(cl:find-package
'#:f2cl
) '(and) '(or))
571 (eval-when (:load-toplevel
:compile-toplevel
:execute
)
572 (setf (gethash 'fortran-to-lisp
::zherk fortran-to-lisp
::*f2cl-function-info
*)
573 (fortran-to-lisp::make-f2cl-finfo
574 :arg-types
'((simple-string) (simple-string)
575 (fortran-to-lisp::integer4
) (fortran-to-lisp::integer4
)
576 (double-float) (array fortran-to-lisp
::complex16
(*))
577 (fortran-to-lisp::integer4
) (double-float)
578 (array fortran-to-lisp
::complex16
(*))
579 (fortran-to-lisp::integer4
))
580 :return-values
'(nil nil nil nil nil nil nil nil nil nil
)
581 :calls
'(fortran-to-lisp::xerbla fortran-to-lisp
::lsame
))))