In documentation for lreduce and rreduce, supply second argument as an explicit list
[maxima.git] / share / odepack / src / dhefa.lisp
blob6f0b4af5221bfaf5764f97893f44b68646ad171e
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)
11 ;;;
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")
20 (defun dhefa (a lda n ipvt info job)
21 (declare (type (array f2cl-lib:integer4 (*)) ipvt)
22 (type (f2cl-lib:integer4) job info n lda)
23 (type (array double-float (*)) a))
24 (f2cl-lib:with-multi-array-data
25 ((a double-float a-%data% a-%offset%)
26 (ipvt f2cl-lib:integer4 ipvt-%data% ipvt-%offset%))
27 (prog ((j 0) (k 0) (km1 0) (kp1 0) (l 0) (nm1 0) (t$ 0.0d0))
28 (declare (type (double-float) t$)
29 (type (f2cl-lib:integer4) nm1 l kp1 km1 k j))
30 (if (> job 1) (go label80))
31 (setf info 0)
32 (setf nm1 (f2cl-lib:int-sub n 1))
33 (if (< nm1 1) (go label70))
34 (f2cl-lib:fdo (k 1 (f2cl-lib:int-add k 1))
35 ((> k nm1) nil)
36 (tagbody
37 (setf kp1 (f2cl-lib:int-add k 1))
38 (setf l
39 (f2cl-lib:int-sub
40 (f2cl-lib:int-add
41 (idamax 2
42 (f2cl-lib:array-slice a-%data%
43 double-float
44 (k k)
45 ((1 lda) (1 *))
46 a-%offset%)
49 1))
50 (setf (f2cl-lib:fref ipvt-%data% (k) ((1 *)) ipvt-%offset%) l)
51 (if
52 (= (f2cl-lib:fref a-%data% (l k) ((1 lda) (1 *)) a-%offset%) 0.0d0)
53 (go label40))
54 (if (= l k) (go label10))
55 (setf t$ (f2cl-lib:fref a-%data% (l k) ((1 lda) (1 *)) a-%offset%))
56 (setf (f2cl-lib:fref a-%data% (l k) ((1 lda) (1 *)) a-%offset%)
57 (f2cl-lib:fref a-%data% (k k) ((1 lda) (1 *)) a-%offset%))
58 (setf (f2cl-lib:fref a-%data% (k k) ((1 lda) (1 *)) a-%offset%) t$)
59 label10
60 (setf t$
61 (/ -1.0d0
62 (f2cl-lib:fref a-%data%
63 (k k)
64 ((1 lda) (1 *))
65 a-%offset%)))
66 (setf (f2cl-lib:fref a-%data%
67 ((f2cl-lib:int-add k 1) k)
68 ((1 lda) (1 *))
69 a-%offset%)
71 (f2cl-lib:fref a-%data%
72 ((f2cl-lib:int-add k 1) k)
73 ((1 lda) (1 *))
74 a-%offset%)
75 t$))
76 (f2cl-lib:fdo (j kp1 (f2cl-lib:int-add j 1))
77 ((> j n) nil)
78 (tagbody
79 (setf t$
80 (f2cl-lib:fref a-%data%
81 (l j)
82 ((1 lda) (1 *))
83 a-%offset%))
84 (if (= l k) (go label20))
85 (setf (f2cl-lib:fref a-%data% (l j) ((1 lda) (1 *)) a-%offset%)
86 (f2cl-lib:fref a-%data%
87 (k j)
88 ((1 lda) (1 *))
89 a-%offset%))
90 (setf (f2cl-lib:fref a-%data% (k j) ((1 lda) (1 *)) a-%offset%)
91 t$)
92 label20
93 (daxpy (f2cl-lib:int-sub n k) t$
94 (f2cl-lib:array-slice a-%data%
95 double-float
96 ((+ k 1) k)
97 ((1 lda) (1 *))
98 a-%offset%)
100 (f2cl-lib:array-slice a-%data%
101 double-float
102 ((+ k 1) j)
103 ((1 lda) (1 *))
104 a-%offset%)
106 label30))
107 (go label50)
108 label40
109 (setf info k)
110 label50
111 label60))
112 label70
113 (setf (f2cl-lib:fref ipvt-%data% (n) ((1 *)) ipvt-%offset%) n)
114 (if (= (f2cl-lib:fref a-%data% (n n) ((1 lda) (1 *)) a-%offset%) 0.0d0)
115 (setf info n))
116 (go end_label)
117 label80
118 (setf nm1 (f2cl-lib:int-sub n 1))
119 (if (<= nm1 1) (go label105))
120 (f2cl-lib:fdo (k 2 (f2cl-lib:int-add k 1))
121 ((> k nm1) nil)
122 (tagbody
123 (setf km1 (f2cl-lib:int-sub k 1))
124 (setf l (f2cl-lib:fref ipvt-%data% (km1) ((1 *)) ipvt-%offset%))
125 (setf t$ (f2cl-lib:fref a-%data% (l n) ((1 lda) (1 *)) a-%offset%))
126 (if (= l km1) (go label90))
127 (setf (f2cl-lib:fref a-%data% (l n) ((1 lda) (1 *)) a-%offset%)
128 (f2cl-lib:fref a-%data% (km1 n) ((1 lda) (1 *)) a-%offset%))
129 (setf (f2cl-lib:fref a-%data% (km1 n) ((1 lda) (1 *)) a-%offset%) t$)
130 label90
131 (setf (f2cl-lib:fref a-%data% (k n) ((1 lda) (1 *)) a-%offset%)
132 (+ (f2cl-lib:fref a-%data% (k n) ((1 lda) (1 *)) a-%offset%)
134 (f2cl-lib:fref a-%data%
135 (k km1)
136 ((1 lda) (1 *))
137 a-%offset%)
138 t$)))
139 label100))
140 label105
141 (setf info 0)
142 (setf l
143 (f2cl-lib:int-sub
144 (f2cl-lib:int-add
145 (idamax 2
146 (f2cl-lib:array-slice a-%data%
147 double-float
148 (nm1 nm1)
149 ((1 lda) (1 *))
150 a-%offset%)
152 nm1)
154 (setf (f2cl-lib:fref ipvt-%data% (nm1) ((1 *)) ipvt-%offset%) l)
155 (if (= (f2cl-lib:fref a-%data% (l nm1) ((1 lda) (1 *)) a-%offset%) 0.0d0)
156 (go label140))
157 (if (= l nm1) (go label110))
158 (setf t$ (f2cl-lib:fref a-%data% (l nm1) ((1 lda) (1 *)) a-%offset%))
159 (setf (f2cl-lib:fref a-%data% (l nm1) ((1 lda) (1 *)) a-%offset%)
160 (f2cl-lib:fref a-%data% (nm1 nm1) ((1 lda) (1 *)) a-%offset%))
161 (setf (f2cl-lib:fref a-%data% (nm1 nm1) ((1 lda) (1 *)) a-%offset%) t$)
162 label110
163 (setf t$
164 (/ -1.0d0
165 (f2cl-lib:fref a-%data%
166 (nm1 nm1)
167 ((1 lda) (1 *))
168 a-%offset%)))
169 (setf (f2cl-lib:fref a-%data% (n nm1) ((1 lda) (1 *)) a-%offset%)
170 (* (f2cl-lib:fref a-%data% (n nm1) ((1 lda) (1 *)) a-%offset%)
171 t$))
172 (setf t$ (f2cl-lib:fref a-%data% (l n) ((1 lda) (1 *)) a-%offset%))
173 (if (= l nm1) (go label120))
174 (setf (f2cl-lib:fref a-%data% (l n) ((1 lda) (1 *)) a-%offset%)
175 (f2cl-lib:fref a-%data% (nm1 n) ((1 lda) (1 *)) a-%offset%))
176 (setf (f2cl-lib:fref a-%data% (nm1 n) ((1 lda) (1 *)) a-%offset%) t$)
177 label120
178 (setf (f2cl-lib:fref a-%data% (n n) ((1 lda) (1 *)) a-%offset%)
179 (+ (f2cl-lib:fref a-%data% (n n) ((1 lda) (1 *)) a-%offset%)
180 (* t$
181 (f2cl-lib:fref a-%data%
182 (n nm1)
183 ((1 lda) (1 *))
184 a-%offset%))))
185 (go label150)
186 label140
187 (setf info nm1)
188 label150
189 (setf (f2cl-lib:fref ipvt-%data% (n) ((1 *)) ipvt-%offset%) n)
190 (if (= (f2cl-lib:fref a-%data% (n n) ((1 lda) (1 *)) a-%offset%) 0.0d0)
191 (setf info n))
192 (go end_label)
193 end_label
194 (return (values nil nil nil nil info nil)))))
196 (in-package #:cl-user)
197 #+#.(cl:if (cl:find-package '#:f2cl) '(and) '(or))
198 (eval-when (:load-toplevel :compile-toplevel :execute)
199 (setf (gethash 'fortran-to-lisp::dhefa fortran-to-lisp::*f2cl-function-info*)
200 (fortran-to-lisp::make-f2cl-finfo
201 :arg-types '((array double-float (*)) (fortran-to-lisp::integer4)
202 (fortran-to-lisp::integer4)
203 (array fortran-to-lisp::integer4 (*))
204 (fortran-to-lisp::integer4)
205 (fortran-to-lisp::integer4))
206 :return-values '(nil nil nil nil fortran-to-lisp::info nil)
207 :calls '(fortran-to-lisp::daxpy fortran-to-lisp::idamax))))