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-2013-11 (20E 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 single-float))
17 (in-package "ODEPACK")
21 (declare (type (double-float) zero
))
22 (defun droots (ng hmin jflag x0 x1 g0 g1 gx x jroot
)
23 (declare (type (array f2cl-lib
:integer4
(*)) jroot
)
24 (type (array double-float
(*)) gx g1 g0
)
25 (type (double-float) x x1 x0 hmin
)
26 (type (f2cl-lib:integer4
) jflag ng
))
28 (symbol-macrolet ((alpha (aref (dlsr01-part-0 *dlsr01-common-block
*) 0))
29 (x2 (aref (dlsr01-part-0 *dlsr01-common-block
*) 1))
30 (imax (aref (dlsr01-part-1 *dlsr01-common-block
*) 3))
31 (last$
(aref (dlsr01-part-1 *dlsr01-common-block
*) 4)))
32 (f2cl-lib:with-multi-array-data
33 ((g0 double-float g0-%data% g0-%offset%
)
34 (g1 double-float g1-%data% g1-%offset%
)
35 (gx double-float gx-%data% gx-%offset%
)
36 (jroot f2cl-lib
:integer4 jroot-%data% jroot-%offset%
))
37 (prog ((nxlast 0) (imxold 0) (i 0) (tmax 0.0d0
) (t2 0.0d0
)
38 (xroot nil
) (sgnchg nil
) (zroot nil
))
39 (declare (type f2cl-lib
:logical zroot sgnchg xroot
)
40 (type (double-float) t2 tmax
)
41 (type (f2cl-lib:integer4
) i imxold nxlast
))
42 (if (= jflag
1) (go label200
))
45 (setf zroot f2cl-lib
:%false%
)
46 (f2cl-lib:fdo
(i 1 (f2cl-lib:int-add i
1))
50 (> (abs (f2cl-lib:fref g1-%data%
(i) ((1 ng
)) g1-%offset%
))
53 (setf zroot f2cl-lib
:%true%
)
59 (f2cl-lib:fref g0-%data%
64 (f2cl-lib:fref g1-%data%
71 (/ (f2cl-lib:fref g1-%data%
(i) ((1 ng
)) g1-%offset%
)
73 (f2cl-lib:fref g1-%data%
(i) ((1 ng
)) g1-%offset%
)
74 (f2cl-lib:fref g0-%data%
78 (if (<= t2 tmax
) (go label120
))
82 (if (> imax
0) (go label130
))
83 (setf sgnchg f2cl-lib
:%false%
)
86 (setf sgnchg f2cl-lib
:%true%
)
88 (if (not sgnchg
) (go label400
))
89 (setf xroot f2cl-lib
:%false%
)
93 (if xroot
(go label300
))
94 (if (= nxlast last$
) (go label160
))
98 (if (= last$
0) (go label170
))
99 (setf alpha
(* 0.5d0 alpha
))
102 (setf alpha
(* 2.0d0 alpha
))
108 (f2cl-lib:fref g1-%data%
113 (f2cl-lib:fref g1-%data%
(imax) ((1 ng
)) g1-%offset%
)
115 (f2cl-lib:fref g0-%data%
120 (and (< (abs (- x2 x0
)) hmin
) (> (abs (- x1 x0
)) (* 10.0d0 hmin
)))
121 (setf x2
(+ x0
(* 0.1d0
(- x1 x0
)))))
129 (setf zroot f2cl-lib
:%false%
)
130 (f2cl-lib:fdo
(i 1 (f2cl-lib:int-add i
1))
134 (> (abs (f2cl-lib:fref gx-%data%
(i) ((1 ng
)) gx-%offset%
))
137 (setf zroot f2cl-lib
:%true%
)
143 (f2cl-lib:fref g0-%data%
148 (f2cl-lib:fref gx-%data%
155 (/ (f2cl-lib:fref gx-%data%
(i) ((1 ng
)) gx-%offset%
)
157 (f2cl-lib:fref gx-%data%
(i) ((1 ng
)) gx-%offset%
)
158 (f2cl-lib:fref g0-%data%
162 (if (<= t2 tmax
) (go label220
))
166 (if (> imax
0) (go label230
))
167 (setf sgnchg f2cl-lib
:%false%
)
171 (setf sgnchg f2cl-lib
:%true%
)
174 (if (not sgnchg
) (go label250
))
178 (setf xroot f2cl-lib
:%false%
)
181 (if (not zroot
) (go label260
))
184 (setf xroot f2cl-lib
:%true%
)
190 (setf xroot f2cl-lib
:%false%
)
192 (if (<= (abs (- x1 x0
)) hmin
) (setf xroot f2cl-lib
:%true%
))
198 (f2cl-lib:fdo
(i 1 (f2cl-lib:int-add i
1))
201 (setf (f2cl-lib:fref jroot-%data%
(i) ((1 ng
)) jroot-%offset%
)
204 (> (abs (f2cl-lib:fref g1-%data%
(i) ((1 ng
)) g1-%offset%
))
207 (setf (f2cl-lib:fref jroot-%data%
(i) ((1 ng
)) jroot-%offset%
)
214 (f2cl-lib:fref g0-%data%
219 (f2cl-lib:fref g1-%data%
223 (setf (f2cl-lib:fref jroot-%data%
(i) ((1 ng
)) jroot-%offset%
)
228 (if (not zroot
) (go label420
))
231 (f2cl-lib:fdo
(i 1 (f2cl-lib:int-add i
1))
234 (setf (f2cl-lib:fref jroot-%data%
(i) ((1 ng
)) jroot-%offset%
)
237 (<= (abs (f2cl-lib:fref g1-%data%
(i) ((1 ng
)) g1-%offset%
))
239 (setf (f2cl-lib:fref jroot-%data%
(i) ((1 ng
)) jroot-%offset%
)
250 (return (values nil nil jflag x0 x1 nil nil nil x nil
))))))))
252 (in-package #:cl-user
)
253 #+#.
(cl:if
(cl:find-package
'#:f2cl
) '(and) '(or))
254 (eval-when (:load-toplevel
:compile-toplevel
:execute
)
255 (setf (gethash 'fortran-to-lisp
::droots
256 fortran-to-lisp
::*f2cl-function-info
*)
257 (fortran-to-lisp::make-f2cl-finfo
258 :arg-types
'((fortran-to-lisp::integer4
) (double-float)
259 (fortran-to-lisp::integer4
) (double-float)
260 (double-float) (array double-float
(*))
261 (array double-float
(*)) (array double-float
(*))
262 (double-float) (array fortran-to-lisp
::integer4
(*)))
263 :return-values
'(nil nil fortran-to-lisp
::jflag fortran-to-lisp
::x0
264 fortran-to-lisp
::x1 nil nil nil fortran-to-lisp
::x
266 :calls
'(fortran-to-lisp::dcopy
))))