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 fode (s y yp ypold a qr alpha tz pivot nfe n iflag par ipar
)
21 (declare (type (array f2cl-lib
:integer4
(*)) ipar
)
22 (type (array double-float
(*)) par
)
23 (type (f2cl-lib:integer4
) iflag n nfe
)
24 (type (array f2cl-lib
:integer4
(*)) pivot
)
25 (type (array double-float
(*)) tz alpha qr a ypold yp y
)
26 (type (double-float) s
))
27 (f2cl-lib:with-multi-array-data
28 ((y double-float y-%data% y-%offset%
)
29 (yp double-float yp-%data% yp-%offset%
)
30 (ypold double-float ypold-%data% ypold-%offset%
)
31 (a double-float a-%data% a-%offset%
)
32 (qr double-float qr-%data% qr-%offset%
)
33 (alpha double-float alpha-%data% alpha-%offset%
)
34 (tz double-float tz-%data% tz-%offset%
)
35 (pivot f2cl-lib
:integer4 pivot-%data% pivot-%offset%
)
36 (par double-float par-%data% par-%offset%
)
37 (ipar f2cl-lib
:integer4 ipar-%data% ipar-%offset%
))
38 (prog ((i 0) (ierr 0) (ik 0) (j 0) (k 0) (kp1 0) (kpiv 0) (lw 0) (np1 0)
39 (sum 0.0) (ypnorm 0.0))
40 (declare (type (double-float) ypnorm sum
)
41 (type (f2cl-lib:integer4
) np1 lw kpiv kp1 k j ik ierr i
))
42 (setf np1
(f2cl-lib:int-add n
1))
43 (setf nfe
(f2cl-lib:int-add nfe
1))
45 ((= iflag
(f2cl-lib:int-sub
2))
46 (f2cl-lib:fdo
(k 1 (f2cl-lib:int-add k
1))
49 (multiple-value-bind (var-0 var-1 var-2 var-3 var-4 var-5 var-6
)
51 (f2cl-lib:fref y-%data%
53 ((1 (f2cl-lib:int-add n
1)))
55 (f2cl-lib:array-slice y-%data%
58 ((1 (f2cl-lib:int-add n
1)))
60 (f2cl-lib:array-slice qr-%data%
63 ((1 n
) (1 (f2cl-lib:int-add n
1)))
66 (declare (ignore var-0 var-2 var-3 var-4 var-5 var-6
))
67 (setf (f2cl-lib:fref y-%data%
69 ((1 (f2cl-lib:int-add n
1)))
75 (f2cl-lib:array-slice y-%data%
78 ((1 (f2cl-lib:int-add n
1)))
83 (f2cl-lib:fdo
(j 1 (f2cl-lib:int-add j
1))
87 (setf (f2cl-lib:fref qr-%data%
89 ((1 n
) (1 (f2cl-lib:int-add n
1)))
91 (- (f2cl-lib:fref a-%data%
(j) ((1 n
)) a-%offset%
)
92 (f2cl-lib:fref tz-%data%
94 ((1 (f2cl-lib:int-add n
1)))
96 (f2cl-lib:fdo
(k 1 (f2cl-lib:int-add k
1))
100 (f2cl-lib:array-slice y-%data%
103 ((1 (f2cl-lib:int-add n
1)))
106 (setf kp1
(f2cl-lib:int-add k
1))
107 (f2cl-lib:fdo
(j 1 (f2cl-lib:int-add j
1))
111 (setf (f2cl-lib:fref qr-%data%
113 ((1 n
) (1 (f2cl-lib:int-add n
1)))
117 (f2cl-lib:fref y-%data%
119 ((1 (f2cl-lib:int-add n
1)))
121 (f2cl-lib:fref tz-%data%
123 ((1 (f2cl-lib:int-add n
1)))
126 (setf (f2cl-lib:fref qr-%data%
128 ((1 n
) (1 (f2cl-lib:int-add n
1)))
131 (f2cl-lib:fref qr-%data%
133 ((1 n
) (1 (f2cl-lib:int-add n
1)))
138 (f2cl-lib:fdo
(j 1 (f2cl-lib:int-add j
1))
142 (setf (f2cl-lib:fref qr-%data%
144 ((1 n
) (1 (f2cl-lib:int-add n
1)))
148 (f2cl-lib:fref tz-%data%
150 ((1 (f2cl-lib:int-add n
1)))
152 (f2cl-lib:fref y-%data%
153 ((f2cl-lib:int-add j
1))
154 ((1 (f2cl-lib:int-add n
1)))
156 (f2cl-lib:fref a-%data%
(j) ((1 n
)) a-%offset%
)))))
157 (f2cl-lib:fdo
(k 1 (f2cl-lib:int-add k
1))
161 (f2cl-lib:array-slice y-%data%
164 ((1 (f2cl-lib:int-add n
1)))
167 (setf kp1
(f2cl-lib:int-add k
1))
168 (f2cl-lib:fdo
(j 1 (f2cl-lib:int-add j
1))
172 (setf (f2cl-lib:fref qr-%data%
174 ((1 n
) (1 (f2cl-lib:int-add n
1)))
177 (f2cl-lib:fref y-%data%
179 ((1 (f2cl-lib:int-add n
1)))
181 (f2cl-lib:fref tz-%data%
183 ((1 (f2cl-lib:int-add n
1)))
186 (setf (f2cl-lib:fref qr-%data%
188 ((1 n
) (1 (f2cl-lib:int-add n
1)))
192 (f2cl-lib:fref y-%data%
194 ((1 (f2cl-lib:int-add n
1)))
196 (f2cl-lib:fref qr-%data%
198 ((1 n
) (1 (f2cl-lib:int-add n
1)))
199 qr-%offset%
))))))))))
201 (multiple-value-bind (var-0 var-1 var-2 var-3 var-4 var-5 var-6 var-7
)
202 (dcpose n n qr alpha pivot ierr tz yp
)
203 (declare (ignore var-0 var-1 var-2 var-3 var-4 var-6 var-7
))
205 (if (= ierr
0) (go label220
))
209 (setf (f2cl-lib:fref tz-%data%
211 ((1 (f2cl-lib:int-add n
1)))
213 (coerce 1.0f0
'double-float
))
214 (f2cl-lib:fdo
(lw 1 (f2cl-lib:int-add lw
1))
217 (setf i
(f2cl-lib:int-sub np1 lw
))
218 (setf ik
(f2cl-lib:int-add i
1))
219 (setf sum
(coerce 0.0f0
'double-float
))
220 (f2cl-lib:fdo
(j ik
(f2cl-lib:int-add j
1))
227 (f2cl-lib:fref qr-%data%
229 ((1 n
) (1 (f2cl-lib:int-add n
1)))
231 (f2cl-lib:fref tz-%data%
233 ((1 (f2cl-lib:int-add n
1)))
236 (setf (f2cl-lib:fref tz-%data%
238 ((1 (f2cl-lib:int-add n
1)))
241 (f2cl-lib:fref alpha-%data%
245 (setf ypnorm
(dnrm2 np1 tz
1))
246 (f2cl-lib:fdo
(k 1 (f2cl-lib:int-add k
1))
250 (f2cl-lib:fref pivot-%data%
252 ((1 (f2cl-lib:int-add n
1)))
255 (setf (f2cl-lib:fref yp-%data%
257 ((1 (f2cl-lib:int-add n
1)))
260 (f2cl-lib:fref tz-%data%
262 ((1 (f2cl-lib:int-add n
1)))
265 (if (>= (ddot np1 yp
1 ypold
1) 0.0f0
) (go label280
))
266 (f2cl-lib:fdo
(i 1 (f2cl-lib:int-add i
1))
270 (setf (f2cl-lib:fref yp-%data%
272 ((1 (f2cl-lib:int-add n
1)))
275 (f2cl-lib:fref yp-%data%
277 ((1 (f2cl-lib:int-add n
1)))
280 (f2cl-lib:fdo
(i 1 (f2cl-lib:int-add i
1))
284 (setf (f2cl-lib:fref ypold-%data%
286 ((1 (f2cl-lib:int-add n
1)))
288 (f2cl-lib:fref yp-%data%
290 ((1 (f2cl-lib:int-add n
1)))
295 (values nil nil nil nil nil nil nil nil nil nfe nil iflag nil nil
)))))
297 (in-package #:cl-user
)
298 #+#.
(cl:if
(cl:find-package
'#:f2cl
) '(and) '(or))
299 (eval-when (:load-toplevel
:compile-toplevel
:execute
)
300 (setf (gethash 'fortran-to-lisp
::fode fortran-to-lisp
::*f2cl-function-info
*)
301 (fortran-to-lisp::make-f2cl-finfo
302 :arg-types
'((double-float) (array double-float
(*))
303 (array double-float
(*)) (array double-float
(*))
304 (array double-float
(*)) (array double-float
(*))
305 (array double-float
(*)) (array double-float
(*))
306 (array fortran-to-lisp
::integer4
(*))
307 (fortran-to-lisp::integer4
) (fortran-to-lisp::integer4
)
308 (fortran-to-lisp::integer4
) (array double-float
(*))
309 (array fortran-to-lisp
::integer4
(*)))
310 :return-values
'(nil nil nil nil nil nil nil nil nil
311 fortran-to-lisp
::nfe nil fortran-to-lisp
::iflag nil
313 :calls
'(fortran-to-lisp::fjac fortran-to-lisp
::f
314 fortran-to-lisp
::ddot fortran-to-lisp
::dnrm2
315 fortran-to-lisp
::dcpose fortran-to-lisp
::rhojac
))))