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")
21 (declare (type (f2cl-lib:integer4
1000 1000) limitd
) (ignorable limitd
))
54 (gi (make-array 11 :element-type
'double-float
))
55 (g (make-array 13 :element-type
'double-float
))
56 (w (make-array 12 :element-type
'double-float
))
57 (alphas (make-array 12 :element-type
'double-float
))
58 (iv (make-array 10 :element-type
'f2cl-lib
:integer4
)))
59 (declare (type (double-float) y1sout xold sqnp1 sout sb sa s99 s hold h
60 epst epsstp curtol cursw aold
)
61 (type (f2cl-lib:integer4
) np1 nfec limit lcode ksteps kold kgi k
62 jw judy j ivc iter iflagc
)
63 (type f2cl-lib
:logical st99 crash start
)
64 (type (array double-float
(11)) gi
)
65 (type (array double-float
(13)) g
)
66 (type (array double-float
(12)) w alphas
)
67 (type (array f2cl-lib
:integer4
(10)) iv
))
69 (n y iflag arctol eps trace$ a ndima nfe arclen yp ypold qr alpha tz
70 pivot wt phi p par ipar
)
71 (declare (type (array f2cl-lib
:integer4
(*)) ipar
)
72 (type (array double-float
(*)) par
)
73 (type (array f2cl-lib
:integer4
(*)) pivot
)
74 (type (double-float) arclen eps arctol
)
75 (type (array double-float
(*)) p phi wt tz alpha qr ypold yp a
77 (type (f2cl-lib:integer4
) nfe ndima trace$ iflag n
))
78 (f2cl-lib:with-multi-array-data
79 ((y double-float y-%data% y-%offset%
)
80 (a double-float a-%data% a-%offset%
)
81 (yp double-float yp-%data% yp-%offset%
)
82 (ypold double-float ypold-%data% ypold-%offset%
)
83 (qr double-float qr-%data% qr-%offset%
)
84 (alpha double-float alpha-%data% alpha-%offset%
)
85 (tz double-float tz-%data% tz-%offset%
)
86 (wt double-float wt-%data% wt-%offset%
)
87 (phi double-float phi-%data% phi-%offset%
)
88 (p double-float p-%data% p-%offset%
)
89 (pivot f2cl-lib
:integer4 pivot-%data% pivot-%offset%
)
90 (par double-float par-%data% par-%offset%
)
91 (ipar f2cl-lib
:integer4 ipar-%data% ipar-%offset%
))
94 (if (or (<= n
0) (<= eps
0.0f0
)) (setf iflag
7))
95 (if (and (>= iflag -
2) (<= iflag
0)) (go label10
))
96 (if (= iflag
2) (go label35
))
97 (if (= iflag
3) (go label30
))
101 (setf arclen
(coerce 0.0f0
'double-float
))
102 (setf s
(coerce 0.0f0
'double-float
))
103 (if (<= arctol
0.0f0
) (setf arctol
(* 0.5f0
(f2cl-lib:fsqrt eps
))))
106 (setf np1
(f2cl-lib:int-add n
1))
107 (setf sqnp1
(f2cl-lib:fsqrt
(f2cl-lib:dble np1
)))
108 (setf cursw
(coerce 10.0f0
'double-float
))
109 (setf st99 f2cl-lib
:%false%
)
110 (setf start f2cl-lib
:%true%
)
111 (setf crash f2cl-lib
:%false%
)
112 (setf hold
(coerce 1.0f0
'double-float
))
113 (setf h
(coerce 0.1f0
'double-float
))
116 (setf (f2cl-lib:fref ypold-%data%
118 ((1 (f2cl-lib:int-add n
1)))
120 (coerce 1.0f0
'double-float
))
121 (setf (f2cl-lib:fref yp-%data%
123 ((1 (f2cl-lib:int-add n
1)))
125 (coerce 1.0f0
'double-float
))
126 (setf (f2cl-lib:fref y-%data%
128 ((1 (f2cl-lib:int-add n
1)))
130 (coerce 0.0f0
'double-float
))
131 (f2cl-lib:fdo
(j 2 (f2cl-lib:int-add j
1))
134 (setf (f2cl-lib:fref ypold-%data%
136 ((1 (f2cl-lib:int-add n
1)))
138 (coerce 0.0f0
'double-float
))
139 (setf (f2cl-lib:fref yp-%data%
141 ((1 (f2cl-lib:int-add n
1)))
143 (coerce 0.0f0
'double-float
))
146 ((>= iflagc
(f2cl-lib:int-sub
1))
147 (f2cl-lib:fdo
(j 2 (f2cl-lib:int-add j
1))
150 (setf (f2cl-lib:fref a-%data%
151 ((f2cl-lib:int-sub j
1))
154 (f2cl-lib:fref y-%data%
156 ((1 (f2cl-lib:int-add n
1)))
162 (f2cl-lib:fdo
(iter 1 (f2cl-lib:int-add iter
1))
166 ((< (f2cl-lib:fref y
(1) ((1 (f2cl-lib:int-add n
1)))) 0.0f0
)
169 (setf arclen
(+ arclen s
))
173 (if (<= s
(* 7.0f0 sqnp1
)) (go label80
))
174 (setf arclen
(+ arclen s
))
175 (setf s
(coerce 0.0f0
'double-float
))
177 (setf start f2cl-lib
:%true%
)
178 (setf crash f2cl-lib
:%false%
)
180 ((= iflagc
(f2cl-lib:int-sub
2))
181 (f2cl-lib:fdo
(jw 1 (f2cl-lib:int-add jw
1))
184 (setf (f2cl-lib:fref qr-%data%
186 ((1 n
) (1 (f2cl-lib:int-add n
1)))
188 (f2cl-lib:fref a-%data%
(jw) ((1 n
)) a-%offset%
))
191 (f2cl-lib:fref y-%data%
193 ((1 (f2cl-lib:int-add n
1)))
195 (f2cl-lib:array-slice y-%data%
198 ((1 (f2cl-lib:int-add n
1)))
201 (f2cl-lib:fdo
(jw 1 (f2cl-lib:int-add jw
1))
205 (f2cl-lib:fref qr-%data%
207 ((1 n
) (1 (f2cl-lib:int-add n
1)))
210 ((> (abs (+ (f2cl-lib:fref a
(jw) ((1 n
))) (- aold
)))
211 (+ 1.0f0
(abs aold
)))
212 (setf arclen
(+ arclen s
))
218 (f2cl-lib:array-slice y-%data%
221 ((1 (f2cl-lib:int-add n
1)))
224 (f2cl-lib:fdo
(jw 1 (f2cl-lib:int-add jw
1))
228 (f2cl-lib:fref a-%data%
(jw) ((1 n
)) a-%offset%
))
230 ((= iflagc
(f2cl-lib:int-sub
1))
231 (setf (f2cl-lib:fref a-%data%
(jw) ((1 n
)) a-%offset%
)
235 (f2cl-lib:fref y-%data%
237 ((1 (f2cl-lib:int-add n
1)))
239 (f2cl-lib:fref yp-%data%
241 ((1 (f2cl-lib:int-add n
1)))
244 (f2cl-lib:fref y-%data%
247 (f2cl-lib:int-add n
1)))
249 (f2cl-lib:fref y-%data%
250 ((f2cl-lib:int-add jw
1))
251 ((1 (f2cl-lib:int-add n
1)))
254 (setf (f2cl-lib:fref a-%data%
(jw) ((1 n
)) a-%offset%
)
257 (f2cl-lib:fref y-%data%
258 ((f2cl-lib:int-add jw
1))
259 ((1 (f2cl-lib:int-add n
1)))
262 (f2cl-lib:fref y-%data%
264 ((1 (f2cl-lib:int-add n
1)))
266 (f2cl-lib:fref yp-%data%
268 ((1 (f2cl-lib:int-add n
1)))
271 (f2cl-lib:fref y-%data%
273 ((1 (f2cl-lib:int-add n
1)))
276 ((> (abs (+ (f2cl-lib:fref a
(jw) ((1 n
))) (- aold
)))
277 (+ 1.0f0
(abs aold
)))
278 (setf arclen
(+ arclen s
))
287 (f2cl-lib:fref y-%data%
289 ((1 (f2cl-lib:int-add n
1)))
295 (setf st99 f2cl-lib
:%true%
)
300 (setf curtol
(* cursw hold
))
301 (setf epst
(/ eps epsstp
))
302 (f2cl-lib:fdo
(jw 1 (f2cl-lib:int-add jw
1))
308 (+ (f2cl-lib:fref yp
(jw) ((1 (f2cl-lib:int-add n
1))))
312 ((1 (f2cl-lib:int-add n
1)))))))
314 (setf (f2cl-lib:fref wt-%data%
316 ((1 (f2cl-lib:int-add n
1)))
320 (f2cl-lib:fref y-%data%
322 ((1 (f2cl-lib:int-add n
1)))
326 (setf (f2cl-lib:fref wt-%data%
328 ((1 (f2cl-lib:int-add n
1)))
333 (f2cl-lib:fref y-%data%
335 ((1 (f2cl-lib:int-add n
1)))
341 (var-0 var-1 var-2 var-3 var-4 var-5 var-6 var-7 var-8
342 var-9 var-10 var-11 var-12 var-13 var-14 var-15 var-16
343 var-17 var-18 var-19 var-20 var-21 var-22 var-23 var-24
344 var-25 var-26 var-27 var-28 var-29 var-30 var-31 var-32
346 (steps #'fode np1 y s h epsstp wt start hold k kold crash phi
347 p yp alphas w g ksteps xold ivc iv kgi gi ypold a qr alpha
348 tz pivot nfec iflagc par ipar
)
349 (declare (ignore var-0 var-1 var-2 var-6 var-12 var-13 var-14
350 var-15 var-16 var-17 var-21 var-23 var-24
351 var-25 var-26 var-27 var-28 var-29 var-32
366 (setf iflagc var-31
))
369 (f2cl-lib:fformat trace$
370 ("~%" " STEP" 1 (("~5D")) "~3@T" "NFE =" 1
371 (("~5D")) "~3@T" "ARC LENGTH =" 1
372 (("~9,4,0,'*,F")) "~3@T" "LAMBDA =" 1
373 (("~7,4,0,'*,F")) "~5@T" "X vector:" "~%" t
374 ("~1@T" 6 (("~12,4,2,0,'*,,'EE"))) "~%")
378 (f2cl-lib:fref y-%data%
380 ((1 (f2cl-lib:int-add n
1)))
382 (do ((jw 2 (f2cl-lib:int-add jw
1))
384 ((> jw np1
) (nreverse %ret
))
385 (declare (type f2cl-lib
:integer4 jw
))
387 (f2cl-lib:fref y-%data%
390 (f2cl-lib:int-add n
1)))
396 (setf arclen
(+ arclen s
))
404 (if (< arctol eps
) (setf arctol eps
))
405 (setf limit
(f2cl-lib:int-sub limit iter
))
409 ((>= (f2cl-lib:fref y
(1) ((1 (f2cl-lib:int-add n
1)))) 1.0f0
)
411 (if st99
(go label160
))
412 (setf s99
(- s
(* 0.5f0 hold
)))
414 (sintrp s y s99 wt yp np1 kold phi ivc iv kgi gi alphas g w
418 (f2cl-lib:fref wt-%data%
420 ((1 (f2cl-lib:int-add n
1)))
424 (setf s99
(* 0.5f0
(+ (- s hold
) s99
)))
427 (f2cl-lib:fdo
(judy 1 (f2cl-lib:int-add judy
1))
430 (setf (f2cl-lib:fref y-%data%
432 ((1 (f2cl-lib:int-add n
1)))
434 (f2cl-lib:fref wt-%data%
436 ((1 (f2cl-lib:int-add n
1)))
438 (setf (f2cl-lib:fref ypold-%data%
440 ((1 (f2cl-lib:int-add n
1)))
442 (f2cl-lib:fref yp-%data%
444 ((1 (f2cl-lib:int-add n
1)))
457 (multiple-value-bind (var-0 var-1 var-2 var-3 var-4 var-5 var-6
)
458 (root sout y1sout sa sb eps eps lcode
)
459 (declare (ignore var-1 var-4 var-5
))
464 (if (> lcode
0) (go label190
))
465 (sintrp s y sout wt yp np1 kold phi ivc iv kgi gi alphas g w xold p
)
468 (f2cl-lib:fref wt-%data%
470 ((1 (f2cl-lib:int-add n
1)))
476 (if (> lcode
2) (setf iflag
6))
477 (setf arclen
(+ arclen sa
))
478 (sintrp s y sa wt yp np1 kold phi ivc iv kgi gi alphas g w xold p
)
479 (f2cl-lib:fdo
(j 1 (f2cl-lib:int-add j
1))
483 (setf (f2cl-lib:fref y-%data%
485 ((1 (f2cl-lib:int-add n
1)))
487 (f2cl-lib:fref wt-%data%
489 ((1 (f2cl-lib:int-add n
1)))
516 (in-package #:cl-user
)
517 #+#.
(cl:if
(cl:find-package
'#:f2cl
) '(and) '(or))
518 (eval-when (:load-toplevel
:compile-toplevel
:execute
)
519 (setf (gethash 'fortran-to-lisp
::fixpdf
520 fortran-to-lisp
::*f2cl-function-info
*)
521 (fortran-to-lisp::make-f2cl-finfo
522 :arg-types
'((fortran-to-lisp::integer4
) (array double-float
(*))
523 (fortran-to-lisp::integer4
) (double-float)
524 (double-float) (fortran-to-lisp::integer4
)
525 (array double-float
(*)) (fortran-to-lisp::integer4
)
526 (fortran-to-lisp::integer4
) (double-float)
527 (array double-float
(*)) (array double-float
(*))
528 (array double-float
(*)) (array double-float
(*))
529 (array double-float
(*))
530 (array fortran-to-lisp
::integer4
(*))
531 (array double-float
(*)) (array double-float
(*))
532 (array double-float
(*)) (array double-float
(*))
533 (array fortran-to-lisp
::integer4
(*)))
534 :return-values
'(nil nil fortran-to-lisp
::iflag
535 fortran-to-lisp
::arctol fortran-to-lisp
::eps nil
536 nil nil fortran-to-lisp
::nfe
537 fortran-to-lisp
::arclen nil nil nil nil nil nil nil
539 :calls
'(fortran-to-lisp::f fortran-to-lisp
::rhoa
540 fortran-to-lisp
::root fortran-to-lisp
::sintrp
541 fortran-to-lisp
::steps
))))