1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191
|
;;; Compiled by f2cl version:
;;; ("f2cl1.l,v 1.215 2009/04/07 22:05:21 rtoy Exp $"
;;; "f2cl2.l,v 1.37 2008/02/22 22:19:33 rtoy Exp $"
;;; "f2cl3.l,v 1.6 2008/02/22 22:19:33 rtoy Exp $"
;;; "f2cl4.l,v 1.7 2008/02/22 22:19:34 rtoy Exp $"
;;; "f2cl5.l,v 1.200 2009/01/19 02:38:17 rtoy Exp $"
;;; "f2cl6.l,v 1.48 2008/08/24 00:56:27 rtoy Exp $"
;;; "macros.l,v 1.112 2009/01/08 12:57:19 rtoy Exp $")
;;; Using Lisp CMU Common Lisp 19f (19F)
;;;
;;; Options: ((:prune-labels nil) (:auto-save t) (:relaxed-array-decls t)
;;; (:coerce-assigns :as-needed) (:array-type ':array)
;;; (:array-slicing t) (:declare-common nil)
;;; (:float-format double-float))
(in-package :common-lisp-user)
(defun lb1 (iprint iter nfun gnorm n m x f g stp finish)
(declare (type f2cl-lib:logical finish)
(type (array double-float (*)) g x)
(type (double-float) stp f gnorm)
(type (f2cl-lib:integer4) m n nfun iter)
(type (array f2cl-lib:integer4 (*)) iprint))
(let ()
(symbol-macrolet ((mp (lb3-mp *lb3-common-block*)))
(f2cl-lib:with-multi-array-data
((iprint f2cl-lib:integer4 iprint-%data% iprint-%offset%)
(x double-float x-%data% x-%offset%)
(g double-float g-%data% g-%offset%))
(prog nil
(cond
((= iter 0)
(f2cl-lib:fformat mp
("*************************************************"
"~%"))
(f2cl-lib:fformat mp
(" N=" 1 (("~5D")) " NUMBER OF CORRECTIONS="
1 (("~2D")) "~%" " INITIAL VALUES" "~%")
n
m)
(f2cl-lib:fformat mp
(" F= " 1 (("~22,15,2,1,'*,,'DE")) " GNORM= "
1 (("~22,15,2,1,'*,,'DE")) "~%")
f
gnorm)
(cond
((>= (f2cl-lib:fref iprint (2) ((1 2))) 1)
(f2cl-lib:fformat mp (" VECTOR X= " "~%"))
(f2cl-lib:fformat mp
(4 ("~2@T" 1 (("~22,15,2,1,'*,,'DE"))) "~%")
(do ((i 1 (f2cl-lib:int-add i 1))
(%ret nil))
((> i n) (nreverse %ret))
(declare (type f2cl-lib:integer4 i))
(push
(f2cl-lib:fref x-%data%
(i)
((1 n))
x-%offset%)
%ret)))
(f2cl-lib:fformat mp (" GRADIENT VECTOR G= " "~%"))
(f2cl-lib:fformat mp
(4 ("~2@T" 1 (("~22,15,2,1,'*,,'DE"))) "~%")
(do ((i 1 (f2cl-lib:int-add i 1))
(%ret nil))
((> i n) (nreverse %ret))
(declare (type f2cl-lib:integer4 i))
(push
(f2cl-lib:fref g-%data%
(i)
((1 n))
g-%offset%)
%ret)))))
(f2cl-lib:fformat mp
("*************************************************"
"~%"))
(f2cl-lib:fformat mp
("~%" " I NFN" "~5@T" "FUNC" "~20@T" "GNORM"
"~19@T" "STEPLENGTH" "~%" "~%")))
(t
(if
(and
(= (f2cl-lib:fref iprint-%data% (1) ((1 2)) iprint-%offset%) 0)
(and (/= iter 1) (not finish)))
(go end_label))
(cond
((/= (f2cl-lib:fref iprint (1) ((1 2))) 0)
(cond
((or
(=
(mod (f2cl-lib:int-add iter (f2cl-lib:int-sub 1))
(f2cl-lib:fref iprint (1) ((1 2))))
0)
finish)
(if
(and
(>
(f2cl-lib:fref iprint-%data% (2) ((1 2)) iprint-%offset%)
1)
(> iter 1))
(f2cl-lib:fformat mp
("~%" " I NFN" "~5@T" "FUNC" "~20@T"
"GNORM" "~19@T" "STEPLENGTH" "~%" "~%")))
(f2cl-lib:fformat mp
(2 (1 (("~4D")) "~1@T") "~3@T" 3
(1 (("~22,15,2,1,'*,,'DE")) "~2@T") "~%")
iter
nfun
f
gnorm
stp))
(t
(go end_label))))
(t
(if
(and
(> (f2cl-lib:fref iprint-%data% (2) ((1 2)) iprint-%offset%)
1)
finish)
(f2cl-lib:fformat mp
("~%" " I NFN" "~5@T" "FUNC" "~20@T"
"GNORM" "~19@T" "STEPLENGTH" "~%" "~%")))
(f2cl-lib:fformat mp
(2 (1 (("~4D")) "~1@T") "~3@T" 3
(1 (("~22,15,2,1,'*,,'DE")) "~2@T") "~%")
iter
nfun
f
gnorm
stp)))
(cond
((or (= (f2cl-lib:fref iprint (2) ((1 2))) 2)
(= (f2cl-lib:fref iprint (2) ((1 2))) 3))
(cond
(finish
(f2cl-lib:fformat mp (" FINAL POINT X= " "~%")))
(t
(f2cl-lib:fformat mp (" VECTOR X= " "~%"))))
(f2cl-lib:fformat mp
(4 ("~2@T" 1 (("~22,15,2,1,'*,,'DE"))) "~%")
(do ((i 1 (f2cl-lib:int-add i 1))
(%ret nil))
((> i n) (nreverse %ret))
(declare (type f2cl-lib:integer4 i))
(push
(f2cl-lib:fref x-%data%
(i)
((1 n))
x-%offset%)
%ret)))
(cond
((= (f2cl-lib:fref iprint (2) ((1 2))) 3)
(f2cl-lib:fformat mp (" GRADIENT VECTOR G= " "~%"))
(f2cl-lib:fformat mp
(4 ("~2@T" 1 (("~22,15,2,1,'*,,'DE")))
"~%")
(do ((i 1 (f2cl-lib:int-add i 1))
(%ret nil))
((> i n) (nreverse %ret))
(declare (type f2cl-lib:integer4 i))
(push
(f2cl-lib:fref g-%data%
(i)
((1 n))
g-%offset%)
%ret)))))))
(if finish
(f2cl-lib:fformat mp
("~%"
" THE MINIMIZATION TERMINATED WITHOUT DETECTING ERRORS."
"~%" " IFLAG = 0" "~%")))))
(go end_label)
end_label
(return (values nil nil nil nil nil nil nil nil nil nil nil)))))))
(in-package #-gcl #:cl-user #+gcl "CL-USER")
#+#.(cl:if (cl:find-package '#:f2cl) '(and) '(or))
(eval-when (:load-toplevel :compile-toplevel :execute)
(setf (gethash 'fortran-to-lisp::lb1 fortran-to-lisp::*f2cl-function-info*)
(fortran-to-lisp::make-f2cl-finfo
:arg-types '((array fortran-to-lisp::integer4 (2))
(fortran-to-lisp::integer4) (fortran-to-lisp::integer4)
(double-float) (fortran-to-lisp::integer4)
(fortran-to-lisp::integer4) (array double-float (*))
(double-float) (array double-float (*)) (double-float)
fortran-to-lisp::logical)
:return-values '(nil nil nil nil nil nil nil nil nil nil nil)
:calls 'nil)))
|