1 ;;; Compiled by f2cl version:
2 ;;; ("f2cl1.l,v 1.215 2009/04/07 22:05:21 rtoy Exp $"
3 ;;; "f2cl2.l,v 1.37 2008/02/22 22:19:33 rtoy Exp $"
4 ;;; "f2cl3.l,v 1.6 2008/02/22 22:19:33 rtoy Exp $"
5 ;;; "f2cl4.l,v 1.7 2008/02/22 22:19:34 rtoy Exp $"
6 ;;; "f2cl5.l,v 1.200 2009/01/19 02:38:17 rtoy Exp $"
7 ;;; "f2cl6.l,v 1.48 2008/08/24 00:56:27 rtoy Exp $"
8 ;;; "macros.l,v 1.112 2009/01/08 12:57:19 rtoy Exp $")
10 ;;; Using Lisp CMU Common Lisp 19f (19F)
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 :common-lisp-user
)
20 (defun lb1 (iprint iter nfun gnorm n m x f g stp finish
)
21 (declare (type f2cl-lib
:logical finish
)
22 (type (array double-float
(*)) g x
)
23 (type (double-float) stp f gnorm
)
24 (type (f2cl-lib:integer4
) m n nfun iter
)
25 (type (array f2cl-lib
:integer4
(*)) iprint
))
27 (symbol-macrolet ((mp (lb3-mp *lb3-common-block
*)))
28 (f2cl-lib:with-multi-array-data
29 ((iprint f2cl-lib
:integer4 iprint-%data% iprint-%offset%
)
30 (x double-float x-%data% x-%offset%
)
31 (g double-float g-%data% g-%offset%
))
36 ("*************************************************"
39 (" N=" 1 (("~5D")) " NUMBER OF CORRECTIONS="
40 1 (("~2D")) "~%" " INITIAL VALUES" "~%")
44 (" F= " 1 (("~22,15,2,1,'*,,'DE")) " GNORM= "
45 1 (("~22,15,2,1,'*,,'DE")) "~%")
49 ((>= (f2cl-lib:fref iprint
(2) ((1 2))) 1)
50 (f2cl-lib:fformat mp
(" VECTOR X= " "~%"))
52 (4 ("~2@T" 1 (("~22,15,2,1,'*,,'DE"))) "~%")
53 (do ((i 1 (f2cl-lib:int-add i
1))
55 ((> i n
) (nreverse %ret
))
56 (declare (type f2cl-lib
:integer4 i
))
58 (f2cl-lib:fref x-%data%
63 (f2cl-lib:fformat mp
(" GRADIENT VECTOR G= " "~%"))
65 (4 ("~2@T" 1 (("~22,15,2,1,'*,,'DE"))) "~%")
66 (do ((i 1 (f2cl-lib:int-add i
1))
68 ((> i n
) (nreverse %ret
))
69 (declare (type f2cl-lib
:integer4 i
))
71 (f2cl-lib:fref g-%data%
77 ("*************************************************"
80 ("~%" " I NFN" "~5@T" "FUNC" "~20@T" "GNORM"
81 "~19@T" "STEPLENGTH" "~%" "~%")))
85 (= (f2cl-lib:fref iprint-%data%
(1) ((1 2)) iprint-%offset%
) 0)
86 (and (/= iter
1) (not finish
)))
89 ((/= (f2cl-lib:fref iprint
(1) ((1 2))) 0)
93 (mod (f2cl-lib:int-add iter
(f2cl-lib:int-sub
1))
94 (f2cl-lib:fref iprint
(1) ((1 2))))
100 (f2cl-lib:fref iprint-%data%
(2) ((1 2)) iprint-%offset%
)
104 ("~%" " I NFN" "~5@T" "FUNC" "~20@T"
105 "GNORM" "~19@T" "STEPLENGTH" "~%" "~%")))
107 (2 (1 (("~4D")) "~1@T") "~3@T" 3
108 (1 (("~22,15,2,1,'*,,'DE")) "~2@T") "~%")
119 (> (f2cl-lib:fref iprint-%data%
(2) ((1 2)) iprint-%offset%
)
123 ("~%" " I NFN" "~5@T" "FUNC" "~20@T"
124 "GNORM" "~19@T" "STEPLENGTH" "~%" "~%")))
126 (2 (1 (("~4D")) "~1@T") "~3@T" 3
127 (1 (("~22,15,2,1,'*,,'DE")) "~2@T") "~%")
134 ((or (= (f2cl-lib:fref iprint
(2) ((1 2))) 2)
135 (= (f2cl-lib:fref iprint
(2) ((1 2))) 3))
138 (f2cl-lib:fformat mp
(" FINAL POINT X= " "~%")))
140 (f2cl-lib:fformat mp
(" VECTOR X= " "~%"))))
142 (4 ("~2@T" 1 (("~22,15,2,1,'*,,'DE"))) "~%")
143 (do ((i 1 (f2cl-lib:int-add i
1))
145 ((> i n
) (nreverse %ret
))
146 (declare (type f2cl-lib
:integer4 i
))
148 (f2cl-lib:fref x-%data%
154 ((= (f2cl-lib:fref iprint
(2) ((1 2))) 3)
155 (f2cl-lib:fformat mp
(" GRADIENT VECTOR G= " "~%"))
157 (4 ("~2@T" 1 (("~22,15,2,1,'*,,'DE")))
159 (do ((i 1 (f2cl-lib:int-add i
1))
161 ((> i n
) (nreverse %ret
))
162 (declare (type f2cl-lib
:integer4 i
))
164 (f2cl-lib:fref g-%data%
172 " THE MINIMIZATION TERMINATED WITHOUT DETECTING ERRORS."
173 "~%" " IFLAG = 0" "~%")))))
176 (return (values nil nil nil nil nil nil nil nil nil nil nil
)))))))
178 (in-package #:cl-user
)
179 #+#.
(cl:if
(cl:find-package
'#:f2cl
) '(and) '(or))
180 (eval-when (:load-toplevel
:compile-toplevel
:execute
)
181 (setf (gethash 'fortran-to-lisp
::lb1 fortran-to-lisp
::*f2cl-function-info
*)
182 (fortran-to-lisp::make-f2cl-finfo
183 :arg-types
'((array fortran-to-lisp
::integer4
(2))
184 (fortran-to-lisp::integer4
) (fortran-to-lisp::integer4
)
185 (double-float) (fortran-to-lisp::integer4
)
186 (fortran-to-lisp::integer4
) (array double-float
(*))
187 (double-float) (array double-float
(*)) (double-float)
188 fortran-to-lisp
::logical
)
189 :return-values
'(nil nil nil nil nil nil nil nil nil nil nil
)