1 ;;; Compiled by f2cl version:
2 ;;; ("f2cl1.l,v 95098eb54f13 2013/04/01 00:45:16 toy $"
3 ;;; "f2cl2.l,v 95098eb54f13 2013/04/01 00:45:16 toy $"
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 95098eb54f13 2013/04/01 00:45:16 toy $"
7 ;;; "f2cl6.l,v 1d5cbacbb977 2008/08/24 00:56:27 rtoy $"
8 ;;; "macros.l,v 1409c1352feb 2013/03/24 20:44:50 toy $")
10 ;;; Using Lisp CMU Common Lisp snapshot-2020-04 (21D 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))
17 (in-package "HOMPACK")
20 (defun r1upqf (n s t$ qt r w
)
21 (declare (type (array double-float
(*)) w r qt t$ s
)
22 (type (f2cl-lib:integer4
) n
))
23 (f2cl-lib:with-multi-array-data
24 ((s double-float s-%data% s-%offset%
)
25 (t$ double-float t$-%data% t$-%offset%
)
26 (qt double-float qt-%data% qt-%offset%
)
27 (r double-float r-%data% r-%offset%
)
28 (w double-float w-%data% w-%offset%
))
29 (prog ((tt (make-array 2 :element-type
'double-float
)) (eta 0.0)
30 (skipup nil
) (i 0) (indexr 0) (indxr2 0) (j 0) (k 0) (c 0.0)
31 (den 0.0) (one 0.0) (ss 0.0) (ww 0.0) (yy 0.0) (temp 0.0)
33 (declare (type (f2cl-lib:integer4
) k j indxr2 indexr i
)
34 (type f2cl-lib
:logical skipup
)
35 (type (double-float) ddot temp yy ww ss one den c eta
)
36 (type (array double-float
(2)) tt
))
40 (or (/= (f2cl-lib:fref t$-%data%
(k) ((1 n
)) t$-%offset%
) 0.0f0
)
43 (setf k
(f2cl-lib:int-sub k
1))
48 (the f2cl-lib
:integer4
49 (truncate (* (+ (- (+ n n
) k
) 3) (- k
2)) 2))
51 (f2cl-lib:fdo
(i (f2cl-lib:int-add k
(f2cl-lib:int-sub
1))
52 (f2cl-lib:int-add i
(f2cl-lib:int-sub
1)))
56 ((= (f2cl-lib:fref t$
(i) ((1 n
))) 0.0f0
)
57 (setf c
(coerce 0.0f0
'double-float
))
61 (f2cl-lib:fref t$-%data%
62 ((f2cl-lib:int-add i
1))
68 (f2cl-lib:array-slice t$-%data%
74 (setf c
(/ (f2cl-lib:fref t$-%data%
(i) ((1 n
)) t$-%offset%
) den
))
78 (f2cl-lib:fref t$-%data%
79 ((f2cl-lib:int-add i
1))
84 (f2cl-lib:fref r-%data%
88 (f2cl-lib:int-mul n
(f2cl-lib:int-add n
1))
91 (setf ww
(coerce 0.0f0
'double-float
))
92 (setf (f2cl-lib:fref r-%data%
96 (f2cl-lib:int-mul n
(f2cl-lib:int-add n
1))
99 (- (* c yy
) (* ss ww
)))
100 (setf (f2cl-lib:fref w-%data%
101 ((f2cl-lib:int-add i
1))
104 (+ (* ss yy
) (* c ww
)))
105 (setf indexr
(f2cl-lib:int-add indexr
1))
106 (setf indxr2
(f2cl-lib:int-sub
(f2cl-lib:int-add indexr n
) i
))
107 (f2cl-lib:fdo
(j (f2cl-lib:int-add i
1) (f2cl-lib:int-add j
1))
111 (f2cl-lib:fref r-%data%
121 (f2cl-lib:fref r-%data%
130 (setf (f2cl-lib:fref r-%data%
135 (f2cl-lib:int-add n
1))
138 (- (* c yy
) (* ss ww
)))
139 (setf (f2cl-lib:fref r-%data%
144 (f2cl-lib:int-add n
1))
147 (+ (* ss yy
) (* c ww
)))
148 (setf indexr
(f2cl-lib:int-add indexr
1))
149 (setf indxr2
(f2cl-lib:int-add indxr2
1))
151 (f2cl-lib:fdo
(j 1 (f2cl-lib:int-add j
1))
155 (f2cl-lib:fref qt-%data%
160 (f2cl-lib:fref qt-%data%
161 ((f2cl-lib:int-add i
1) j
)
164 (setf (f2cl-lib:fref qt-%data%
(i j
) ((1 n
) (1 n
)) qt-%offset%
)
165 (- (* c yy
) (* ss ww
)))
166 (setf (f2cl-lib:fref qt-%data%
167 ((f2cl-lib:int-add i
1) j
)
170 (+ (* ss yy
) (* c ww
)))
173 ((= (f2cl-lib:fref t$
(i) ((1 n
))) 0.0f0
)
174 (setf (f2cl-lib:fref t$-%data%
(i) ((1 n
)) t$-%offset%
)
176 (f2cl-lib:fref t$-%data%
177 ((f2cl-lib:int-add i
1))
181 (setf (f2cl-lib:fref t$-%data%
(i) ((1 n
)) t$-%offset%
)
183 (f2cl-lib:array-slice t$-%data%
190 (f2cl-lib:int-sub indexr
191 (f2cl-lib:int-mul
2 (f2cl-lib:int-sub n i
))
194 (setf temp
(f2cl-lib:fref t$-%data%
(1) ((1 n
)) t$-%offset%
))
195 (daxpy n temp s
1 r
1)
197 (f2cl-lib:fdo
(i 1 (f2cl-lib:int-add i
1))
198 ((> i
(f2cl-lib:int-add k
(f2cl-lib:int-sub
1))) nil
)
206 (f2cl-lib:int-mul n
(f2cl-lib:int-add n
1))
209 (setf c
(coerce 0.0f0
'double-float
))
213 (f2cl-lib:fref w-%data%
214 ((f2cl-lib:int-add i
1))
218 (setf (f2cl-lib:fref tt
(1) ((1 2)))
219 (f2cl-lib:fref r-%data%
228 (setf (f2cl-lib:fref tt
(2) ((1 2)))
229 (f2cl-lib:fref w-%data%
230 ((f2cl-lib:int-add i
1))
233 (setf den
(dnrm2 2 tt
1))
236 (f2cl-lib:fref r-%data%
249 (f2cl-lib:fref w-%data%
250 ((f2cl-lib:int-add i
1))
255 (f2cl-lib:fref r-%data%
259 (f2cl-lib:int-mul n
(f2cl-lib:int-add n
1))
263 (f2cl-lib:fref w-%data%
264 ((f2cl-lib:int-add i
1))
267 (setf (f2cl-lib:fref r-%data%
271 (f2cl-lib:int-mul n
(f2cl-lib:int-add n
1))
274 (- (* c yy
) (* ss ww
)))
275 (setf (f2cl-lib:fref w-%data%
276 ((f2cl-lib:int-add i
1))
279 (coerce 0.0f0
'double-float
))
280 (setf indexr
(f2cl-lib:int-add indexr
1))
281 (setf indxr2
(f2cl-lib:int-sub
(f2cl-lib:int-add indexr n
) i
))
282 (f2cl-lib:fdo
(j (f2cl-lib:int-add i
1) (f2cl-lib:int-add j
1))
286 (f2cl-lib:fref r-%data%
296 (f2cl-lib:fref r-%data%
305 (setf (f2cl-lib:fref r-%data%
310 (f2cl-lib:int-add n
1))
313 (- (* c yy
) (* ss ww
)))
314 (setf (f2cl-lib:fref r-%data%
319 (f2cl-lib:int-add n
1))
322 (+ (* ss yy
) (* c ww
)))
323 (setf indexr
(f2cl-lib:int-add indexr
1))
324 (setf indxr2
(f2cl-lib:int-add indxr2
1))
326 (f2cl-lib:fdo
(j 1 (f2cl-lib:int-add j
1))
330 (f2cl-lib:fref qt-%data%
335 (f2cl-lib:fref qt-%data%
336 ((f2cl-lib:int-add i
1) j
)
339 (setf (f2cl-lib:fref qt-%data%
(i j
) ((1 n
) (1 n
)) qt-%offset%
)
340 (- (* c yy
) (* ss ww
)))
341 (setf (f2cl-lib:fref qt-%data%
342 ((f2cl-lib:int-add i
1) j
)
345 (+ (* ss yy
) (* c ww
)))
350 (return (values nil nil nil nil nil nil
)))))
352 (in-package #:cl-user
)
353 #+#.
(cl:if
(cl:find-package
'#:f2cl
) '(and) '(or))
354 (eval-when (:load-toplevel
:compile-toplevel
:execute
)
355 (setf (gethash 'fortran-to-lisp
::r1upqf
356 fortran-to-lisp
::*f2cl-function-info
*)
357 (fortran-to-lisp::make-f2cl-finfo
358 :arg-types
'((fortran-to-lisp::integer4
) (array double-float
(*))
359 (array double-float
(*)) (array double-float
(*))
360 (array double-float
(*)) (array double-float
(*)))
361 :return-values
'(nil nil nil nil nil nil
)
362 :calls
'(fortran-to-lisp::daxpy fortran-to-lisp
::dnrm2
))))