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
))
47 (declare (type (double-float) s relerr hold h curtol abserr
)
48 (type (f2cl-lib:integer4
) np1 nfec nc limit jw iz1 iz0 iwp iw itz
49 iter itangw irho ipp iflagc
)
50 (type f2cl-lib
:logical crash start
))
52 (n y iflag arcre arcae ansre ansae trace$ a nfe arclen yp yold ypold
53 qr lenqr pivot work sspar par ipar
)
54 (declare (type (array f2cl-lib
:integer4
(*)) ipar
)
55 (type (array double-float
(*)) par
)
56 (type (array double-float
(*)) sspar
)
57 (type (array f2cl-lib
:integer4
(*)) pivot
)
58 (type (double-float) arclen ansae ansre arcae arcre
)
59 (type (array double-float
(*)) work qr ypold yold yp a y
)
60 (type (f2cl-lib:integer4
) lenqr nfe trace$ iflag n
))
61 (f2cl-lib:with-multi-array-data
62 ((y double-float y-%data% y-%offset%
)
63 (a double-float a-%data% a-%offset%
)
64 (yp double-float yp-%data% yp-%offset%
)
65 (yold double-float yold-%data% yold-%offset%
)
66 (ypold double-float ypold-%data% ypold-%offset%
)
67 (qr double-float qr-%data% qr-%offset%
)
68 (work double-float work-%data% work-%offset%
)
69 (pivot f2cl-lib
:integer4 pivot-%data% pivot-%offset%
)
70 (sspar double-float sspar-%data% sspar-%offset%
)
71 (par double-float par-%data% par-%offset%
)
72 (ipar f2cl-lib
:integer4 ipar-%data% ipar-%offset%
))
75 (if (or (<= n
0) (<= ansre
0.0f0
) (< ansae
0.0f0
)) (setf iflag
7))
76 (if (and (>= iflag -
2) (<= iflag
0)) (go label20
))
77 (if (= iflag
2) (go label120
))
78 (if (= iflag
3) (go label90
))
82 (setf arclen
(coerce 0.0f0
'double-float
))
83 (if (<= arcre
0.0f0
) (setf arcre
(* 0.5f0
(f2cl-lib:fsqrt ansre
))))
84 (if (<= arcae
0.0f0
) (setf arcae
(* 0.5f0
(f2cl-lib:fsqrt ansae
))))
88 (setf np1
(f2cl-lib:int-add n
1))
90 (setf irho
(f2cl-lib:int-add n
1))
91 (setf iw
(f2cl-lib:int-add irho n
))
92 (setf iwp
(f2cl-lib:int-add iw np1
))
93 (setf itz
(f2cl-lib:int-add iwp np1
))
94 (setf iz0
(f2cl-lib:int-add itz np1
))
95 (setf iz1
(f2cl-lib:int-add iz0 np1
))
96 (setf itangw
(f2cl-lib:int-add iz1 np1
))
97 (setf start f2cl-lib
:%true%
)
98 (setf crash f2cl-lib
:%false%
)
99 (setf hold
(coerce 1.0f0
'double-float
))
100 (setf h
(coerce 0.1f0
'double-float
))
101 (setf s
(coerce 0.0f0
'double-float
))
102 (setf (f2cl-lib:fref ypold-%data%
104 ((1 (f2cl-lib:int-add n
1)))
106 (coerce 1.0f0
'double-float
))
107 (setf (f2cl-lib:fref yp-%data%
109 ((1 (f2cl-lib:int-add n
1)))
111 (coerce 1.0f0
'double-float
))
112 (setf (f2cl-lib:fref y-%data%
114 ((1 (f2cl-lib:int-add n
1)))
116 (coerce 0.0f0
'double-float
))
117 (f2cl-lib:fdo
(jw 1 (f2cl-lib:int-add jw
1))
120 (setf (f2cl-lib:fref ypold-%data%
122 ((1 (f2cl-lib:int-add n
1)))
124 (coerce 0.0f0
'double-float
))
125 (setf (f2cl-lib:fref yp-%data%
127 ((1 (f2cl-lib:int-add n
1)))
129 (coerce 0.0f0
'double-float
))
131 (f2cl-lib:fdo
(jw itangw
(f2cl-lib:int-add jw
1))
132 ((> jw
(f2cl-lib:int-add itangw np1 n
)) nil
)
134 (setf (f2cl-lib:fref work-%data%
139 (f2cl-lib:int-add n
1))
140 (f2cl-lib:int-mul
2 n
)
143 (coerce 0.0f0
'double-float
))
146 (<= (f2cl-lib:fref sspar-%data%
(1) ((1 8)) sspar-%offset%
) 0.0f0
)
147 (setf (f2cl-lib:fref sspar-%data%
(1) ((1 8)) sspar-%offset%
)
148 (coerce 0.5f0
'double-float
)))
150 (<= (f2cl-lib:fref sspar-%data%
(2) ((1 8)) sspar-%offset%
) 0.0f0
)
151 (setf (f2cl-lib:fref sspar-%data%
(2) ((1 8)) sspar-%offset%
)
152 (coerce 0.01f0
'double-float
)))
154 (<= (f2cl-lib:fref sspar-%data%
(3) ((1 8)) sspar-%offset%
) 0.0f0
)
155 (setf (f2cl-lib:fref sspar-%data%
(3) ((1 8)) sspar-%offset%
)
156 (coerce 0.5f0
'double-float
)))
158 (<= (f2cl-lib:fref sspar-%data%
(4) ((1 8)) sspar-%offset%
) 0.0f0
)
159 (setf (f2cl-lib:fref sspar-%data%
(4) ((1 8)) sspar-%offset%
)
160 (* (+ (f2cl-lib:fsqrt
(+ n
1.0f0
)) 4.0f0
)
161 (f2cl-lib:d1mach
4))))
163 (<= (f2cl-lib:fref sspar-%data%
(5) ((1 8)) sspar-%offset%
) 0.0f0
)
164 (setf (f2cl-lib:fref sspar-%data%
(5) ((1 8)) sspar-%offset%
)
165 (coerce 1.0f0
'double-float
)))
167 (<= (f2cl-lib:fref sspar-%data%
(6) ((1 8)) sspar-%offset%
) 0.0f0
)
168 (setf (f2cl-lib:fref sspar-%data%
(6) ((1 8)) sspar-%offset%
)
169 (coerce 0.1f0
'double-float
)))
171 (<= (f2cl-lib:fref sspar-%data%
(7) ((1 8)) sspar-%offset%
) 0.0f0
)
172 (setf (f2cl-lib:fref sspar-%data%
(7) ((1 8)) sspar-%offset%
)
173 (coerce 3.0f0
'double-float
)))
175 (<= (f2cl-lib:fref sspar-%data%
(8) ((1 8)) sspar-%offset%
) 0.0f0
)
176 (setf (f2cl-lib:fref sspar-%data%
(8) ((1 8)) sspar-%offset%
)
177 (coerce 2.0f0
'double-float
)))
179 ((>= iflagc
(f2cl-lib:int-sub
1))
184 (f2cl-lib:fdo
(iter 1 (f2cl-lib:int-add iter
1))
188 ((< (f2cl-lib:fref y
(np1) ((1 (f2cl-lib:int-add n
1)))) 0.0f0
)
193 (setf curtol
(* cursw hold
))
196 (f2cl-lib:fdo
(jw 1 (f2cl-lib:int-add jw
1))
202 (+ (f2cl-lib:fref yp
(jw) ((1 (f2cl-lib:int-add n
1))))
206 ((1 (f2cl-lib:int-add n
1)))))))
214 (var-0 var-1 var-2 var-3 var-4 var-5 var-6 var-7 var-8
215 var-9 var-10 var-11 var-12 var-13 var-14 var-15 var-16
216 var-17 var-18 var-19 var-20 var-21
)
217 (stepns nc nfec iflagc start crash hold h relerr abserr s y
218 yp yold ypold a qr lenqr pivot work sspar par ipar
)
219 (declare (ignore var-0 var-10 var-11 var-12 var-13 var-14
220 var-15 var-16 var-17 var-18 var-19 var-20
233 (f2cl-lib:fformat trace
234 ("~%" " STEP" 1 (("~5D")) "~3@T" "NFE =" 1
235 (("~5D")) "~3@T" "ARC LENGTH =" 1
236 (("~9,4,0,'*,F")) "~3@T" "LAMBDA =" 1
237 (("~7,4,0,'*,F")) "~5@T" "X vector:" "~%" t
238 ("~1@T" 6 (("~12,4,2,0,'*,,'EE"))) "~%")
242 (f2cl-lib:fref y-%data%
244 ((1 (f2cl-lib:int-add n
1)))
246 (do ((jw 1 (f2cl-lib:int-add jw
1))
248 ((> jw nc
) (nreverse %ret
))
249 (declare (type f2cl-lib
:integer4 jw
))
251 (f2cl-lib:fref y-%data%
254 (f2cl-lib:int-add n
1)))
266 (if (< arcre relerr
) (setf arcre relerr
))
267 (if (< ansre relerr
) (setf ansre relerr
))
268 (if (< arcae abserr
) (setf arcae abserr
))
269 (if (< ansae abserr
) (setf ansae abserr
))
270 (setf limit
(f2cl-lib:int-sub limit iter
))
273 ((>= (f2cl-lib:fref y
(np1) ((1 (f2cl-lib:int-add n
1)))) 1.0f0
)
275 (f2cl-lib:array-slice work-%data%
284 (f2cl-lib:int-mul
2 n
)
289 (var-0 var-1 var-2 var-3 var-4 var-5 var-6 var-7 var-8
290 var-9 var-10 var-11 var-12 var-13 var-14 var-15
)
291 (rootns nc nfec iflagc ansre ansae y yp yold ypold a qr
292 lenqr pivot work par ipar
)
293 (declare (ignore var-0 var-3 var-4 var-5 var-6 var-7 var-8
294 var-9 var-10 var-11 var-12 var-13 var-14
300 (if (> iflagc
0) (setf iflag iflagc
))
301 (f2cl-lib:fdo
(jw 1 (f2cl-lib:int-add jw
1))
304 (setf (f2cl-lib:fref work-%data%
312 (f2cl-lib:int-mul
2 n
)
316 (f2cl-lib:fref y-%data%
318 ((1 (f2cl-lib:int-add n
1)))
320 (f2cl-lib:fref work-%data%
322 (f2cl-lib:int-add iz0 jw
)
330 (f2cl-lib:int-mul
2 n
)
334 (setf arclen
(+ (- s hold
) (dnrm2 np1 work
1)))
364 (in-package #:cl-user
)
365 #+#.
(cl:if
(cl:find-package
'#:f2cl
) '(and) '(or))
366 (eval-when (:load-toplevel
:compile-toplevel
:execute
)
367 (setf (gethash 'fortran-to-lisp
::fixpns
368 fortran-to-lisp
::*f2cl-function-info
*)
369 (fortran-to-lisp::make-f2cl-finfo
370 :arg-types
'((fortran-to-lisp::integer4
) (array double-float
(*))
371 (fortran-to-lisp::integer4
) (double-float)
372 (double-float) (double-float) (double-float)
373 (fortran-to-lisp::integer4
) (array double-float
(*))
374 (fortran-to-lisp::integer4
) (double-float)
375 (array double-float
(*)) (array double-float
(*))
376 (array double-float
(*)) (array double-float
(*))
377 (fortran-to-lisp::integer4
)
378 (array fortran-to-lisp
::integer4
(*))
379 (array double-float
(*)) (array double-float
(*))
380 (array double-float
(*))
381 (array fortran-to-lisp
::integer4
(*)))
382 :return-values
'(nil nil fortran-to-lisp
::iflag
383 fortran-to-lisp
::arcre fortran-to-lisp
::arcae
384 fortran-to-lisp
::ansre fortran-to-lisp
::ansae nil
385 nil fortran-to-lisp
::nfe fortran-to-lisp
::arclen
386 nil nil nil nil nil nil nil nil nil nil
)
387 :calls
'(fortran-to-lisp::dnrm2 fortran-to-lisp
::dcopy
388 fortran-to-lisp
::rootns fortran-to-lisp
::stepns
389 fortran-to-lisp
::d1mach
))))