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 (n nfe iflag lenqr relerr abserr y yp yold ypold a qr pivot pp rhovec z
23 (declare (type (array f2cl-lib
:integer4
(*)) ipar
)
24 (type (array double-float
(*)) par
)
25 (type (array f2cl-lib
:integer4
(*)) pivot
)
26 (type (array double-float
(*)) work dz z rhovec pp qr a ypold yold
28 (type (double-float) abserr relerr
)
29 (type (f2cl-lib:integer4
) lenqr iflag nfe n
))
30 (f2cl-lib:with-multi-array-data
31 ((y double-float y-%data% y-%offset%
)
32 (yp double-float yp-%data% yp-%offset%
)
33 (yold double-float yold-%data% yold-%offset%
)
34 (ypold double-float ypold-%data% ypold-%offset%
)
35 (a double-float a-%data% a-%offset%
)
36 (qr double-float qr-%data% qr-%offset%
)
37 (pp double-float pp-%data% pp-%offset%
)
38 (rhovec double-float rhovec-%data% rhovec-%offset%
)
39 (z double-float z-%data% z-%offset%
)
40 (dz double-float dz-%data% dz-%offset%
)
41 (work double-float work-%data% work-%offset%
)
42 (pivot f2cl-lib
:integer4 pivot-%data% pivot-%offset%
)
43 (par double-float par-%data% par-%offset%
)
44 (ipar f2cl-lib
:integer4 ipar-%data% ipar-%offset%
))
45 (labels ((dd01 (p0 p1 dels
)
46 (f2cl-lib:f2cl
/ (+ p1
(- p0
)) dels
))
47 (dd001 (p0 pp0 p1 dels
)
48 (/ (- (dd01 p0 p1 dels
) pp0
) dels
))
49 (dd011 (p0 p1 pp1 dels
)
50 (/ (- pp1
(dd01 p0 p1 dels
)) dels
))
51 (dd0011 (p0 pp0 p1 pp1 dels
)
52 (/ (- (dd011 p0 p1 pp1 dels
) (dd001 p0 pp0 p1 dels
)) dels
))
53 (qofs (p0 pp0 p1 pp1 dels s
)
58 (+ (* (dd0011 p0 pp0 p1 pp1 dels
) (- s dels
))
59 (dd001 p0 pp0 p1 dels
))
64 (declare (ftype (function (double-float double-float double-float
)
65 (values double-float
&rest t
))
67 (declare (ftype (function
68 (double-float double-float double-float double-float
)
69 (values double-float
&rest t
))
71 (declare (ftype (function
72 (double-float double-float double-float double-float
)
73 (values double-float
&rest t
))
75 (declare (ftype (function
76 (double-float double-float double-float double-float
78 (values double-float
&rest t
))
80 (declare (ftype (function
81 (double-float double-float double-float double-float
82 double-float double-float
)
83 (values double-float
&rest t
))
85 (prog ((brack nil
) (istep 0) (i 0) (j 0) (lcode 0) (limit 0) (np1 0)
86 (zu 0) (aerr 0.0) (dels 0.0) (one 0.0) (p0 0.0) (p1 0.0) (pp0 0.0)
87 (pp1 0.0) (qsout 0.0) (rerr 0.0) (s 0.0) (sa 0.0) (sb 0.0)
88 (sigma 0.0) (sout 0.0) (u 0.0) (zero 0.0) (lambda$
0.0))
89 (declare (type (double-float) lambda$ zero u sout sigma sb sa s rerr
90 qsout pp1 pp0 p1 p0 one dels aerr
)
91 (type (f2cl-lib:integer4
) zu np1 limit lcode j i istep
)
92 (type f2cl-lib
:logical brack
))
93 (setf one
(coerce 1.0f0
'double-float
))
94 (setf zero
(coerce 0.0f0
'double-float
))
95 (setf u
(f2cl-lib:d1mach
4))
96 (setf rerr
(max relerr u
))
97 (setf aerr
(max abserr zero
))
98 (setf np1
(f2cl-lib:int-add n
1))
105 (+ aerr
(* rerr
(dnrm2 np1 y
1))))))
107 (setf zu
(f2cl-lib:int-add n
2))
109 (daxpy np1
(- one
) yold
1 dz
1)
110 (setf dels
(dnrm2 np1 dz
1))
111 (setf sa
(coerce 0.0f0
'double-float
))
115 (multiple-value-bind (var-0 var-1 var-2 var-3 var-4 var-5 var-6
)
116 (root sout qsout sa sb rerr aerr lcode
)
117 (declare (ignore var-1 var-4 var-5
))
122 (if (> lcode
0) (go label50
))
126 (f2cl-lib:fref yold-%data%
128 ((1 (f2cl-lib:int-add n
1)))
130 (f2cl-lib:fref ypold-%data%
132 ((1 (f2cl-lib:int-add n
1)))
134 (f2cl-lib:fref y-%data%
136 ((1 (f2cl-lib:int-add n
1)))
138 (f2cl-lib:fref yp-%data%
140 ((1 (f2cl-lib:int-add n
1)))
150 (f2cl-lib:fdo
(i 1 (f2cl-lib:int-add i
1))
153 (setf (f2cl-lib:fref z-%data%
155 ((1 (f2cl-lib:int-add n
1)))
158 (f2cl-lib:fref yold-%data%
160 ((1 (f2cl-lib:int-add n
1)))
162 (f2cl-lib:fref ypold-%data%
164 ((1 (f2cl-lib:int-add n
1)))
166 (f2cl-lib:fref y-%data%
168 ((1 (f2cl-lib:int-add n
1)))
170 (f2cl-lib:fref yp-%data%
172 ((1 (f2cl-lib:int-add n
1)))
176 (dcopy np1 yold
1 ypold
1)
177 (setf brack f2cl-lib
:%true%
)
178 (f2cl-lib:fdo
(istep 1 (f2cl-lib:int-add istep
1))
179 ((> istep limit
) nil
)
181 (f2cl-lib:fdo
(j zu
(f2cl-lib:int-add j
1))
182 ((> j
(f2cl-lib:int-add zu
(f2cl-lib:int-mul
2 n
) 1))
185 (setf (f2cl-lib:fref work-%data%
194 (coerce 0.0f0
'double-float
))
197 (f2cl-lib:fref z-%data%
199 ((1 (f2cl-lib:int-add n
1)))
202 ((= iflag
(f2cl-lib:int-sub
2))
203 (rhojs a lambda$ z qr lenqr pivot pp par ipar
)
204 (multiple-value-bind (var-0 var-1 var-2 var-3 var-4 var-5
)
205 (rho a lambda$ z rhovec par ipar
)
206 (declare (ignore var-0 var-2 var-3 var-4 var-5
))
207 (setf lambda$ var-1
)))
208 ((= iflag
(f2cl-lib:int-sub
1))
209 (fjacs z qr lenqr pivot
)
210 (dscal lenqr lambda$ qr
1)
211 (setf sigma
(- 1.0f0 lambda$
))
212 (f2cl-lib:fdo
(j 1 (f2cl-lib:int-add j
1))
215 (setf (f2cl-lib:fref qr-%data%
216 ((f2cl-lib:fref pivot
224 (f2cl-lib:fref qr-%data%
225 ((f2cl-lib:fref pivot
235 (dcopy n z
1 rhovec
1)
236 (daxpy n
(- one
) a
1 rhovec
1)
238 (dscal n
(- one
) pp
1)
239 (daxpy n one rhovec
1 pp
1)
240 (daxpy n
(- lambda$
) pp
1 rhovec
1))
242 (fjacs z qr lenqr pivot
)
243 (dscal lenqr
(- lambda$
) qr
1)
244 (f2cl-lib:fdo
(j 1 (f2cl-lib:int-add j
1))
247 (setf (f2cl-lib:fref qr-%data%
248 ((f2cl-lib:fref pivot
256 (f2cl-lib:fref qr-%data%
257 ((f2cl-lib:fref pivot
267 (dcopy n z
1 rhovec
1)
268 (daxpy n
(- one
) a
1 rhovec
1)
270 (daxpy n
(- one
) a
1 pp
1)
271 (daxpy n
(- lambda$
) pp
1 rhovec
1)))
272 (setf (f2cl-lib:fref rhovec-%data%
274 ((1 (f2cl-lib:int-add n
1)))
276 (coerce 0.0f0
'double-float
))
277 (setf nfe
(f2cl-lib:int-add nfe
1))
279 (var-0 var-1 var-2 var-3 var-4 var-5 var-6 var-7 var-8 var-9
)
280 (pcgqs n qr lenqr pivot pp yp rhovec dz work iflag
)
281 (declare (ignore var-0 var-1 var-2 var-3 var-4 var-5 var-6 var-7
284 (if (> iflag
0) (go end_label
))
285 (daxpy np1 one dz
1 z
1)
290 (+ (f2cl-lib:fref z
(np1) ((1 (f2cl-lib:int-add n
1))))
293 (<= (dnrm2 np1 dz
1) (+ (* rerr
(dnrm2 n z
1)) aerr
)))
299 (f2cl-lib:fref z-%data%
301 ((1 (f2cl-lib:int-add n
1)))
306 (dcopy np1 y
1 yold
1)
311 (+ (f2cl-lib:fref yold
(np1) ((1 (f2cl-lib:int-add n
1))))
313 (+ (f2cl-lib:fref y
(np1) ((1 (f2cl-lib:int-add n
1))))
316 (setf brack f2cl-lib
:%false%
))
318 (setf brack f2cl-lib
:%true%
)
319 (dcopy np1 yold
1 ypold
1)))
321 (daxpy np1
(- one
) ypold
1 dz
1)
322 (setf dels
(dnrm2 np1 dz
1))
326 (f2cl-lib:fref y-%data%
328 ((1 (f2cl-lib:int-add n
1)))
331 (f2cl-lib:fref yold-%data%
333 ((1 (f2cl-lib:int-add n
1)))
335 (f2cl-lib:fref y-%data%
337 ((1 (f2cl-lib:int-add n
1)))
339 (dcopy np1 yold
1 dz
1)
340 (daxpy np1
(- one
) y
1 dz
1)
345 ((> (dnrm2 np1 dz
1) dels
)
349 (f2cl-lib:fref y-%data%
351 ((1 (f2cl-lib:int-add n
1)))
354 (f2cl-lib:fref ypold-%data%
356 ((1 (f2cl-lib:int-add n
1)))
358 (f2cl-lib:fref y-%data%
360 ((1 (f2cl-lib:int-add n
1)))
362 (dcopy np1 ypold
1 dz
1)
363 (daxpy np1
(- one
) y
1 dz
1)
364 (dscal np1 sa dz
1)))))
366 (daxpy np1 one dz
1 z
1)
393 (in-package #:cl-user
)
394 #+#.
(cl:if
(cl:find-package
'#:f2cl
) '(and) '(or))
395 (eval-when (:load-toplevel
:compile-toplevel
:execute
)
396 (setf (gethash 'fortran-to-lisp
::rootqs
397 fortran-to-lisp
::*f2cl-function-info
*)
398 (fortran-to-lisp::make-f2cl-finfo
399 :arg-types
'((fortran-to-lisp::integer4
) (fortran-to-lisp::integer4
)
400 (fortran-to-lisp::integer4
) (fortran-to-lisp::integer4
)
401 (double-float) (double-float) (array double-float
(*))
402 (array double-float
(*)) (array double-float
(*))
403 (array double-float
(*)) (array double-float
(*))
404 (array double-float
(*))
405 (array fortran-to-lisp
::integer4
(*))
406 (array double-float
(*)) (array double-float
(*))
407 (array double-float
(*)) (array double-float
(*))
408 (array double-float
(*)) (array double-float
(*))
409 (array fortran-to-lisp
::integer4
(*)))
410 :return-values
'(nil fortran-to-lisp
::nfe fortran-to-lisp
::iflag nil
411 nil nil nil nil nil nil nil nil nil nil nil nil nil
413 :calls
'(fortran-to-lisp::f fortran-to-lisp
::fjacs
414 fortran-to-lisp
::rhojs fortran-to-lisp
::dscal
415 fortran-to-lisp
::daxpy fortran-to-lisp
::dcopy
416 fortran-to-lisp
::dnrm2 fortran-to-lisp
::pcgqs
417 fortran-to-lisp
::rho fortran-to-lisp
::root
418 fortran-to-lisp
::d1mach
))))