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 (let* ((limitd 1000) (cursw (coerce 10.0f0
'double-float
)))
21 (declare (type (f2cl-lib:integer4
1000 1000) limitd
)
22 (type (double-float) cursw
)
23 (ignorable limitd cursw
))
40 (declare (type (double-float) s relerr hold h curtol abserr
)
41 (type (f2cl-lib:integer4
) np1 nfec nc limit jw iter iflagc
)
42 (type f2cl-lib
:logical start polsys crash
))
43 (labels ((multi-entry-fixpnf
44 (%name% n y iflag arcre arcae ansre ansae trace$ a nfe arclen
45 yp yold ypold qr alpha tz pivot w wp z0 z1 sspar par ipar
)
46 (declare (type (array f2cl-lib
:integer4
(*)) ipar
)
47 (type (array double-float
(*)) par
)
48 (type (array double-float
(*)) sspar
)
49 (type (array f2cl-lib
:integer4
(*)) pivot
)
50 (type (double-float) arclen ansae ansre arcae arcre
)
51 (type (array double-float
(*)) z1 z0 wp w tz alpha qr
53 (type (f2cl-lib:integer4
) nfe trace$ iflag n
))
54 (f2cl-lib:with-multi-array-data
55 ((y double-float y-%data% y-%offset%
)
56 (a double-float a-%data% a-%offset%
)
57 (yp double-float yp-%data% yp-%offset%
)
58 (yold double-float yold-%data% yold-%offset%
)
59 (ypold double-float ypold-%data% ypold-%offset%
)
60 (qr double-float qr-%data% qr-%offset%
)
61 (alpha double-float alpha-%data% alpha-%offset%
)
62 (tz double-float tz-%data% tz-%offset%
)
63 (w double-float w-%data% w-%offset%
)
64 (wp double-float wp-%data% wp-%offset%
)
65 (z0 double-float z0-%data% z0-%offset%
)
66 (z1 double-float z1-%data% z1-%offset%
)
67 (pivot f2cl-lib
:integer4 pivot-%data% pivot-%offset%
)
68 (sspar double-float sspar-%data% sspar-%offset%
)
69 (par double-float par-%data% par-%offset%
)
70 (ipar f2cl-lib
:integer4 ipar-%data% ipar-%offset%
))
73 (if (eq %name%
'polynf
) (go polynf
))
74 (setf polsys f2cl-lib
:%false%
)
77 (setf polsys f2cl-lib
:%true%
)
79 (if (or (<= n
0) (<= ansre
0.0f0
) (< ansae
0.0f0
))
81 (if (and (>= iflag -
2) (<= iflag
0)) (go label20
))
82 (if (= iflag
2) (go label120
))
83 (if (= iflag
3) (go label90
))
87 (setf arclen
(coerce 0.0f0
'double-float
))
89 (setf arcre
(* 0.5f0
(f2cl-lib:fsqrt ansre
))))
91 (setf arcae
(* 0.5f0
(f2cl-lib:fsqrt ansae
))))
95 (setf np1
(f2cl-lib:int-add n
1))
96 (setf start f2cl-lib
:%true%
)
97 (setf crash f2cl-lib
:%false%
)
98 (setf hold
(coerce 1.0f0
'double-float
))
99 (setf h
(coerce 0.1f0
'double-float
))
100 (setf s
(coerce 0.0f0
'double-float
))
101 (setf (f2cl-lib:fref ypold-%data%
103 ((1 (f2cl-lib:int-add n
1)))
105 (coerce 1.0f0
'double-float
))
106 (setf (f2cl-lib:fref yp-%data%
108 ((1 (f2cl-lib:int-add n
1)))
110 (coerce 1.0f0
'double-float
))
111 (setf (f2cl-lib:fref y-%data%
113 ((1 (f2cl-lib:int-add n
1)))
115 (coerce 0.0f0
'double-float
))
116 (f2cl-lib:fdo
(jw 2 (f2cl-lib:int-add jw
1))
119 (setf (f2cl-lib:fref ypold-%data%
121 ((1 (f2cl-lib:int-add n
1)))
123 (coerce 0.0f0
'double-float
))
124 (setf (f2cl-lib:fref yp-%data%
126 ((1 (f2cl-lib:int-add n
1)))
128 (coerce 0.0f0
'double-float
))
131 (<= (f2cl-lib:fref sspar-%data%
(1) ((1 8)) sspar-%offset%
)
133 (setf (f2cl-lib:fref sspar-%data%
137 (coerce 0.5f0
'double-float
)))
139 (<= (f2cl-lib:fref sspar-%data%
(2) ((1 8)) sspar-%offset%
)
141 (setf (f2cl-lib:fref sspar-%data%
145 (coerce 0.01f0
'double-float
)))
147 (<= (f2cl-lib:fref sspar-%data%
(3) ((1 8)) sspar-%offset%
)
149 (setf (f2cl-lib:fref sspar-%data%
153 (coerce 0.5f0
'double-float
)))
155 (<= (f2cl-lib:fref sspar-%data%
(4) ((1 8)) sspar-%offset%
)
157 (setf (f2cl-lib:fref sspar-%data%
161 (* (+ (f2cl-lib:fsqrt
(+ n
1.0f0
)) 4.0f0
)
162 (f2cl-lib:d1mach
4))))
164 (<= (f2cl-lib:fref sspar-%data%
(5) ((1 8)) sspar-%offset%
)
166 (setf (f2cl-lib:fref sspar-%data%
170 (coerce 1.0f0
'double-float
)))
172 (<= (f2cl-lib:fref sspar-%data%
(6) ((1 8)) sspar-%offset%
)
174 (setf (f2cl-lib:fref sspar-%data%
178 (coerce 0.1f0
'double-float
)))
180 (<= (f2cl-lib:fref sspar-%data%
(7) ((1 8)) sspar-%offset%
)
182 (setf (f2cl-lib:fref sspar-%data%
186 (coerce 3.0f0
'double-float
)))
188 (<= (f2cl-lib:fref sspar-%data%
(8) ((1 8)) sspar-%offset%
)
190 (setf (f2cl-lib:fref sspar-%data%
194 (coerce 2.0f0
'double-float
)))
196 ((>= iflagc
(f2cl-lib:int-sub
1))
197 (f2cl-lib:fdo
(jw 2 (f2cl-lib:int-add jw
1))
200 (setf (f2cl-lib:fref a-%data%
201 ((f2cl-lib:int-sub jw
1))
204 (f2cl-lib:fref y-%data%
206 ((1 (f2cl-lib:int-add n
1)))
212 (f2cl-lib:fdo
(iter 1 (f2cl-lib:int-add iter
1))
216 ((< (f2cl-lib:fref y
(1) ((1 (f2cl-lib:int-add n
1))))
222 (setf curtol
(* cursw hold
))
225 (f2cl-lib:fdo
(jw 1 (f2cl-lib:int-add jw
1))
234 ((1 (f2cl-lib:int-add n
1))))
239 (f2cl-lib:int-add n
1)))))))
247 (var-0 var-1 var-2 var-3 var-4 var-5 var-6 var-7
248 var-8 var-9 var-10 var-11 var-12 var-13 var-14
249 var-15 var-16 var-17 var-18 var-19 var-20 var-21
250 var-22 var-23 var-24 var-25
)
251 (stepnf nc nfec iflagc start crash hold h relerr
252 abserr s y yp yold ypold a qr alpha tz pivot w wp
253 z0 z1 sspar par ipar
)
254 (declare (ignore var-0 var-10 var-11 var-12 var-13
255 var-14 var-15 var-16 var-17 var-18
256 var-19 var-20 var-21 var-22 var-23
269 (f2cl-lib:fformat trace
270 ("~%" " STEP" 1 (("~5D")) "~3@T"
271 "NFE =" 1 (("~5D")) "~3@T"
272 "ARC LENGTH =" 1 (("~9,4,0,'*,F"))
274 (("~7,4,0,'*,F")) "~5@T"
276 ("~1@T" 6 (("~12,4,2,0,'*,,'EE")))
281 (f2cl-lib:fref y-%data%
288 (do ((jw 2 (f2cl-lib:int-add jw
1))
290 ((> jw np1
) (nreverse %ret
))
291 (declare (type f2cl-lib
:integer4 jw
))
293 (f2cl-lib:fref y-%data%
310 (if (< arcre relerr
) (setf arcre relerr
))
311 (if (< ansre relerr
) (setf ansre relerr
))
312 (if (< arcae abserr
) (setf arcae abserr
))
313 (if (< ansae abserr
) (setf ansae abserr
))
314 (setf limit
(f2cl-lib:int-sub limit iter
))
318 (f2cl-lib:fref y
(1) ((1 (f2cl-lib:int-add n
1))))
320 (f2cl-lib:fdo
(jw 1 (f2cl-lib:int-add jw
1))
323 (setf (f2cl-lib:fref z0-%data%
325 ((1 (f2cl-lib:int-add n
1)))
327 (f2cl-lib:fref yold-%data%
330 (f2cl-lib:int-add n
1)))
334 (var-0 var-1 var-2 var-3 var-4 var-5 var-6
335 var-7 var-8 var-9 var-10 var-11 var-12 var-13
336 var-14 var-15 var-16 var-17
)
337 (rootnf nc nfec iflagc ansre ansae y yp yold
338 ypold a qr alpha tz pivot w wp par ipar
)
339 (declare (ignore var-0 var-3 var-4 var-5 var-6
340 var-7 var-8 var-9 var-10 var-11
341 var-12 var-13 var-14 var-15 var-16
347 (if (> iflagc
0) (setf iflag iflagc
))
348 (f2cl-lib:fdo
(jw 1 (f2cl-lib:int-add jw
1))
351 (setf (f2cl-lib:fref w-%data%
353 ((1 (f2cl-lib:int-add n
1)))
356 (f2cl-lib:fref y-%data%
362 (f2cl-lib:fref z0-%data%
369 (setf arclen
(+ (- s hold
) (dnrm2 np1 w
1)))
377 ((1 (f2cl-lib:int-add n
1))))
379 (f2cl-lib:fdo
(jw 1 (f2cl-lib:int-add jw
1))
382 (setf (f2cl-lib:fref yp-%data%
389 (f2cl-lib:fref yp-%data%
395 (setf (f2cl-lib:fref ypold-%data%
401 (f2cl-lib:fref yp-%data%
408 (setf start f2cl-lib
:%true%
)))))
441 (n y iflag arcre arcae ansre ansae trace$ a nfe arclen yp yold
442 ypold qr alpha tz pivot w wp z0 z1 sspar par ipar
)
444 (v0 v1 v2 v3 v4 v5 v6 v7 v8 v9 v10 v11 v12 v13 v14 v15 v16 v17
445 v18 v19 v20 v21 v22 v23 v24
)
446 (multi-entry-fixpnf 'fixpnf n y iflag arcre arcae ansre ansae
447 trace$ a nfe arclen yp yold ypold qr alpha tz pivot w wp z0 z1
475 (n y iflag arcre arcae ansre ansae trace$ a nfe arclen yp yold
476 ypold qr alpha tz pivot w wp z0 z1 sspar par ipar
)
478 (v0 v1 v2 v3 v4 v5 v6 v7 v8 v9 v10 v11 v12 v13 v14 v15 v16 v17
479 v18 v19 v20 v21 v22 v23 v24
)
480 (multi-entry-fixpnf 'polynf n y iflag arcre arcae ansre ansae
481 trace$ a nfe arclen yp yold ypold qr alpha tz pivot w wp z0 z1
509 (in-package #:cl-user
)
510 #+#.
(cl:if
(cl:find-package
'#:f2cl
) '(and) '(or))
511 (eval-when (:load-toplevel
:compile-toplevel
:execute
)
512 (setf (gethash 'fortran-to-lisp
::fixpnf
513 fortran-to-lisp
::*f2cl-function-info
*)
514 (fortran-to-lisp::make-f2cl-finfo
515 :arg-types
'((fortran-to-lisp::integer4
) (array double-float
(*))
516 (fortran-to-lisp::integer4
) (double-float)
517 (double-float) (double-float) (double-float)
518 (fortran-to-lisp::integer4
) (array double-float
(*))
519 (fortran-to-lisp::integer4
) (double-float)
520 (array double-float
(*)) (array double-float
(*))
521 (array double-float
(*)) (array double-float
(*))
522 (array double-float
(*)) (array double-float
(*))
523 (array fortran-to-lisp
::integer4
(*))
524 (array double-float
(*)) (array double-float
(*))
525 (array double-float
(*)) (array double-float
(*))
526 (array double-float
(*)) (array double-float
(*))
527 (array fortran-to-lisp
::integer4
(*)))
528 :return-values
'(nil nil fortran-to-lisp
::iflag
529 fortran-to-lisp
::arcre fortran-to-lisp
::arcae
530 fortran-to-lisp
::ansre fortran-to-lisp
::ansae nil
531 nil fortran-to-lisp
::nfe fortran-to-lisp
::arclen
532 nil nil nil nil nil nil nil nil nil nil nil nil nil
534 :calls
'(fortran-to-lisp::dnrm2 fortran-to-lisp
::rootnf
535 fortran-to-lisp
::stepnf fortran-to-lisp
::d1mach
))))