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
))
53 (gi (make-array 11 :element-type
'double-float
))
54 (g (make-array 13 :element-type
'double-float
))
55 (w (make-array 12 :element-type
'double-float
))
56 (alphas (make-array 12 :element-type
'double-float
))
57 (iv (make-array 10 :element-type
'f2cl-lib
:integer4
)))
58 (declare (type (double-float) y1sout xold sqnp1 sout sb sa s99 s hold h
59 epst epsstp curtol cursw aold
)
60 (type (f2cl-lib:integer4
) np1 nfec limit lcode ksteps kold kgi k
62 (type f2cl-lib
:logical st99 crash start
)
63 (type (array double-float
(11)) gi
)
64 (type (array double-float
(13)) g
)
65 (type (array double-float
(12)) w alphas
)
66 (type (array f2cl-lib
:integer4
(10)) iv
))
68 (n y iflag arctol eps trace$ a ndima nfe arclen yp ypold qr lenqr
69 pivot pp work wt phi p par ipar
)
70 (declare (type (array f2cl-lib
:integer4
(*)) ipar
)
71 (type (array double-float
(*)) par
)
72 (type (array f2cl-lib
:integer4
(*)) pivot
)
73 (type (double-float) arclen eps arctol
)
74 (type (array double-float
(*)) p phi wt work pp qr ypold yp a y
)
75 (type (f2cl-lib:integer4
) lenqr nfe ndima trace$ iflag n
))
76 (f2cl-lib:with-multi-array-data
77 ((y double-float y-%data% y-%offset%
)
78 (a double-float a-%data% a-%offset%
)
79 (yp double-float yp-%data% yp-%offset%
)
80 (ypold double-float ypold-%data% ypold-%offset%
)
81 (qr double-float qr-%data% qr-%offset%
)
82 (pp double-float pp-%data% pp-%offset%
)
83 (work double-float work-%data% work-%offset%
)
84 (wt double-float wt-%data% wt-%offset%
)
85 (phi double-float phi-%data% phi-%offset%
)
86 (p double-float p-%data% p-%offset%
)
87 (pivot f2cl-lib
:integer4 pivot-%data% pivot-%offset%
)
88 (par double-float par-%data% par-%offset%
)
89 (ipar f2cl-lib
:integer4 ipar-%data% ipar-%offset%
))
92 (if (or (<= n
0) (<= eps
0.0f0
)) (setf iflag
7))
93 (if (and (>= iflag -
2) (<= iflag
0)) (go label10
))
94 (if (= iflag
2) (go label35
))
95 (if (= iflag
3) (go label30
))
99 (setf arclen
(coerce 0.0f0
'double-float
))
100 (setf s
(coerce 0.0f0
'double-float
))
101 (if (<= arctol
0.0f0
) (setf arctol
(* 0.5f0
(f2cl-lib:fsqrt eps
))))
104 (setf np1
(f2cl-lib:int-add n
1))
105 (setf sqnp1
(f2cl-lib:fsqrt
(f2cl-lib:dble np1
)))
106 (setf cursw
(coerce 10.0f0
'double-float
))
107 (setf st99 f2cl-lib
:%false%
)
108 (setf start f2cl-lib
:%true%
)
109 (setf crash f2cl-lib
:%false%
)
110 (setf hold
(coerce 1.0f0
'double-float
))
111 (setf h
(coerce 0.1f0
'double-float
))
114 (setf (f2cl-lib:fref ypold-%data%
116 ((1 (f2cl-lib:int-add n
1)))
118 (coerce 1.0f0
'double-float
))
119 (setf (f2cl-lib:fref yp-%data%
121 ((1 (f2cl-lib:int-add n
1)))
123 (coerce 1.0f0
'double-float
))
124 (setf (f2cl-lib:fref y-%data%
126 ((1 (f2cl-lib:int-add n
1)))
128 (coerce 0.0f0
'double-float
))
129 (setf (f2cl-lib:fref work-%data%
130 ((f2cl-lib:int-mul
2 np1
))
133 (f2cl-lib:int-mul
6 (f2cl-lib:int-add n
1))
136 (coerce 0.0f0
'double-float
))
137 (setf (f2cl-lib:fref work-%data%
138 ((f2cl-lib:int-mul
3 np1
))
141 (f2cl-lib:int-mul
6 (f2cl-lib:int-add n
1))
144 (coerce 0.0f0
'double-float
))
145 (f2cl-lib:fdo
(j 1 (f2cl-lib:int-add j
1))
148 (setf (f2cl-lib:fref ypold-%data%
150 ((1 (f2cl-lib:int-add n
1)))
152 (coerce 0.0f0
'double-float
))
153 (setf (f2cl-lib:fref yp-%data%
155 ((1 (f2cl-lib:int-add n
1)))
157 (coerce 0.0f0
'double-float
))
158 (setf (f2cl-lib:fref work-%data%
159 ((f2cl-lib:int-add np1 j
))
163 (f2cl-lib:int-add n
1))
166 (coerce 0.0f0
'double-float
))
167 (setf (f2cl-lib:fref work-%data%
168 ((f2cl-lib:int-add
(f2cl-lib:int-mul
2 np1
)
173 (f2cl-lib:int-add n
1))
176 (coerce 0.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
)
191 (setf arclen
(+ arclen s
))
195 (if (<= s
(* 7.0f0 sqnp1
)) (go label80
))
196 (setf arclen
(+ arclen s
))
197 (setf s
(coerce 0.0f0
'double-float
))
199 (setf start f2cl-lib
:%true%
)
200 (setf crash f2cl-lib
:%false%
)
202 ((= iflagc
(f2cl-lib:int-sub
2))
203 (f2cl-lib:fdo
(jw 1 (f2cl-lib:int-add jw
1))
206 (setf (f2cl-lib:fref qr-%data%
210 (f2cl-lib:fref a-%data%
(jw) ((1 n
)) a-%offset%
))
213 (f2cl-lib:fref y-%data%
215 ((1 (f2cl-lib:int-add n
1)))
218 (f2cl-lib:fdo
(jw 1 (f2cl-lib:int-add jw
1))
222 (f2cl-lib:fref qr-%data%
227 ((> (abs (+ (f2cl-lib:fref a
(jw) ((1 n
))) (- aold
)))
228 (+ 1.0f0
(abs aold
)))
229 (setf arclen
(+ arclen s
))
235 (f2cl-lib:fdo
(jw 1 (f2cl-lib:int-add jw
1))
239 (f2cl-lib:fref a-%data%
(jw) ((1 n
)) a-%offset%
))
241 ((= iflagc
(f2cl-lib:int-sub
1))
242 (setf (f2cl-lib:fref a-%data%
(jw) ((1 n
)) a-%offset%
)
246 (f2cl-lib:fref y-%data%
248 ((1 (f2cl-lib:int-add n
1)))
250 (f2cl-lib:fref yp-%data%
252 ((1 (f2cl-lib:int-add n
1)))
255 (f2cl-lib:fref y-%data%
258 (f2cl-lib:int-add n
1)))
260 (f2cl-lib:fref y-%data%
262 ((1 (f2cl-lib:int-add n
1)))
265 (setf (f2cl-lib:fref a-%data%
(jw) ((1 n
)) a-%offset%
)
268 (f2cl-lib:fref y-%data%
270 ((1 (f2cl-lib:int-add n
1)))
273 (f2cl-lib:fref y-%data%
275 ((1 (f2cl-lib:int-add n
1)))
277 (f2cl-lib:fref yp-%data%
279 ((1 (f2cl-lib:int-add n
1)))
282 (f2cl-lib:fref y-%data%
284 ((1 (f2cl-lib:int-add n
1)))
287 ((> (abs (+ (f2cl-lib:fref a
(jw) ((1 n
))) (- aold
)))
288 (+ 1.0f0
(abs aold
)))
289 (setf arclen
(+ arclen s
))
298 (f2cl-lib:fref y-%data%
300 ((1 (f2cl-lib:int-add n
1)))
306 (setf st99 f2cl-lib
:%true%
)
311 (setf curtol
(* cursw hold
))
312 (setf epst
(/ eps epsstp
))
313 (f2cl-lib:fdo
(jw 1 (f2cl-lib:int-add jw
1))
319 (+ (f2cl-lib:fref yp
(jw) ((1 (f2cl-lib:int-add n
1))))
323 ((1 (f2cl-lib:int-add n
1)))))))
325 (setf (f2cl-lib:fref wt-%data%
327 ((1 (f2cl-lib:int-add n
1)))
331 (f2cl-lib:fref y-%data%
333 ((1 (f2cl-lib:int-add n
1)))
337 (setf (f2cl-lib:fref wt-%data%
339 ((1 (f2cl-lib:int-add n
1)))
344 (f2cl-lib:fref y-%data%
346 ((1 (f2cl-lib:int-add n
1)))
352 (var-0 var-1 var-2 var-3 var-4 var-5 var-6 var-7 var-8
353 var-9 var-10 var-11 var-12 var-13 var-14 var-15 var-16
354 var-17 var-18 var-19 var-20 var-21 var-22 var-23 var-24
355 var-25 var-26 var-27 var-28 var-29 var-30 var-31 var-32
357 (stepds #'fodeds np1 y s h epsstp wt start hold k kold crash
358 phi p yp alphas w g ksteps xold ivc iv kgi gi ypold a qr
359 lenqr pivot pp work nfec iflagc par ipar
)
360 (declare (ignore var-0 var-1 var-2 var-6 var-12 var-13 var-14
361 var-15 var-16 var-17 var-21 var-23 var-24
362 var-25 var-26 var-28 var-29 var-30 var-33
378 (setf iflagc var-32
))
381 (f2cl-lib:fformat trace
382 ("~%" " STEP" 1 (("~5D")) "~3@T" "NFE =" 1
383 (("~5D")) "~3@T" "ARC LENGTH =" 1
384 (("~9,4,0,'*,F")) "~3@T" "LAMBDA =" 1
385 (("~7,4,0,'*,F")) "~5@T" "X vector:" "~%" t
386 ("~1@T" 6 (("~12,4,2,0,'*,,'EE"))) "~%")
390 (f2cl-lib:fref y-%data%
392 ((1 (f2cl-lib:int-add n
1)))
394 (do ((jw 1 (f2cl-lib:int-add jw
1))
396 ((> jw n
) (nreverse %ret
))
397 (declare (type f2cl-lib
:integer4 jw
))
399 (f2cl-lib:fref y-%data%
402 (f2cl-lib:int-add n
1)))
408 (setf arclen
(+ arclen s
))
416 (if (< arctol eps
) (setf arctol eps
))
417 (setf limit
(f2cl-lib:int-sub limit iter
))
421 ((>= (f2cl-lib:fref y
(np1) ((1 (f2cl-lib:int-add n
1)))) 1.0f0
)
423 (if st99
(go label160
))
424 (setf s99
(- s
(* 0.5f0 hold
)))
426 (sintrp s y s99 wt yp np1 kold phi ivc iv kgi gi alphas g w
430 (f2cl-lib:fref wt-%data%
432 ((1 (f2cl-lib:int-add n
1)))
436 (setf s99
(* 0.5f0
(+ (- s hold
) s99
)))
440 (dcopy np1 yp
1 ypold
1)
451 (multiple-value-bind (var-0 var-1 var-2 var-3 var-4 var-5 var-6
)
452 (root sout y1sout sa sb eps eps lcode
)
453 (declare (ignore var-1 var-4 var-5
))
458 (if (> lcode
0) (go label190
))
459 (sintrp s y sout wt yp np1 kold phi ivc iv kgi gi alphas g w xold p
)
462 (f2cl-lib:fref wt-%data%
464 ((1 (f2cl-lib:int-add n
1)))
470 (if (> lcode
2) (setf iflag
6))
471 (setf arclen
(+ arclen sa
))
472 (sintrp s y sa wt yp np1 kold phi ivc iv kgi gi alphas g w xold p
)
500 (in-package #:cl-user
)
501 #+#.
(cl:if
(cl:find-package
'#:f2cl
) '(and) '(or))
502 (eval-when (:load-toplevel
:compile-toplevel
:execute
)
503 (setf (gethash 'fortran-to-lisp
::fixpds
504 fortran-to-lisp
::*f2cl-function-info
*)
505 (fortran-to-lisp::make-f2cl-finfo
506 :arg-types
'((fortran-to-lisp::integer4
) (array double-float
(*))
507 (fortran-to-lisp::integer4
) (double-float)
508 (double-float) (fortran-to-lisp::integer4
)
509 (array double-float
(*)) (fortran-to-lisp::integer4
)
510 (fortran-to-lisp::integer4
) (double-float)
511 (array double-float
(*)) (array double-float
(*))
512 (array double-float
(*)) (fortran-to-lisp::integer4
)
513 (array fortran-to-lisp
::integer4
(*))
514 (array double-float
(*)) (array double-float
(*))
515 (array double-float
(*)) (array double-float
(*))
516 (array double-float
(*)) (array double-float
(*))
517 (array fortran-to-lisp
::integer4
(*)))
518 :return-values
'(nil nil fortran-to-lisp
::iflag
519 fortran-to-lisp
::arctol fortran-to-lisp
::eps nil
520 nil nil fortran-to-lisp
::nfe
521 fortran-to-lisp
::arclen nil nil nil
522 fortran-to-lisp
::lenqr nil nil nil nil nil nil nil
524 :calls
'(fortran-to-lisp::f fortran-to-lisp
::rhoa
525 fortran-to-lisp
::dcopy fortran-to-lisp
::root
526 fortran-to-lisp
::sintrp fortran-to-lisp
::stepds
))))