In documentation for lreduce and rreduce, supply second argument as an explicit list
[maxima.git] / share / odepack / src / dgesl.lisp
blob65c7f91f9b651e68ca6da94a6b73f348cf3a1dc1
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-2017-01 (21B 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 double-float))
17 (in-package "ODEPACK")
20 (defun dgesl (a lda n ipvt b job)
21 (declare (type (array f2cl-lib:integer4 (*)) ipvt)
22 (type (f2cl-lib:integer4) job n lda)
23 (type (array double-float (*)) b a))
24 (f2cl-lib:with-multi-array-data
25 ((a double-float a-%data% a-%offset%)
26 (b double-float b-%data% b-%offset%)
27 (ipvt f2cl-lib:integer4 ipvt-%data% ipvt-%offset%))
28 (prog ((k 0) (kb 0) (l 0) (nm1 0) (t$ 0.0))
29 (declare (type (double-float) t$) (type (f2cl-lib:integer4) nm1 l kb k))
30 (setf nm1 (f2cl-lib:int-sub n 1))
31 (if (/= job 0) (go label50))
32 (if (< nm1 1) (go label30))
33 (f2cl-lib:fdo (k 1 (f2cl-lib:int-add k 1))
34 ((> k nm1) nil)
35 (tagbody
36 (setf l (f2cl-lib:fref ipvt-%data% (k) ((1 *)) ipvt-%offset%))
37 (setf t$ (f2cl-lib:fref b-%data% (l) ((1 *)) b-%offset%))
38 (if (= l k) (go label10))
39 (setf (f2cl-lib:fref b-%data% (l) ((1 *)) b-%offset%)
40 (f2cl-lib:fref b-%data% (k) ((1 *)) b-%offset%))
41 (setf (f2cl-lib:fref b-%data% (k) ((1 *)) b-%offset%) t$)
42 label10
43 (daxpy (f2cl-lib:int-sub n k) t$
44 (f2cl-lib:array-slice a-%data%
45 double-float
46 ((+ k 1) k)
47 ((1 lda) (1 *))
48 a-%offset%)
50 (f2cl-lib:array-slice b-%data%
51 double-float
52 ((+ k 1))
53 ((1 *))
54 b-%offset%)
56 label20))
57 label30
58 (f2cl-lib:fdo (kb 1 (f2cl-lib:int-add kb 1))
59 ((> kb n) nil)
60 (tagbody
61 (setf k (f2cl-lib:int-sub (f2cl-lib:int-add n 1) kb))
62 (setf (f2cl-lib:fref b-%data% (k) ((1 *)) b-%offset%)
63 (/ (f2cl-lib:fref b-%data% (k) ((1 *)) b-%offset%)
64 (f2cl-lib:fref a-%data%
65 (k k)
66 ((1 lda) (1 *))
67 a-%offset%)))
68 (setf t$ (- (f2cl-lib:fref b-%data% (k) ((1 *)) b-%offset%)))
69 (daxpy (f2cl-lib:int-sub k 1) t$
70 (f2cl-lib:array-slice a-%data%
71 double-float
72 (1 k)
73 ((1 lda) (1 *))
74 a-%offset%)
76 (f2cl-lib:array-slice b-%data% double-float (1) ((1 *)) b-%offset%)
78 label40))
79 (go label100)
80 label50
81 (f2cl-lib:fdo (k 1 (f2cl-lib:int-add k 1))
82 ((> k n) nil)
83 (tagbody
84 (setf t$
85 (ddot (f2cl-lib:int-sub k 1)
86 (f2cl-lib:array-slice a-%data%
87 double-float
88 (1 k)
89 ((1 lda) (1 *))
90 a-%offset%)
92 (f2cl-lib:array-slice b-%data%
93 double-float
94 (1)
95 ((1 *))
96 b-%offset%)
97 1))
98 (setf (f2cl-lib:fref b-%data% (k) ((1 *)) b-%offset%)
99 (/ (- (f2cl-lib:fref b-%data% (k) ((1 *)) b-%offset%) t$)
100 (f2cl-lib:fref a-%data%
101 (k k)
102 ((1 lda) (1 *))
103 a-%offset%)))
104 label60))
105 (if (< nm1 1) (go label90))
106 (f2cl-lib:fdo (kb 1 (f2cl-lib:int-add kb 1))
107 ((> kb nm1) nil)
108 (tagbody
109 (setf k (f2cl-lib:int-sub n kb))
110 (setf (f2cl-lib:fref b-%data% (k) ((1 *)) b-%offset%)
111 (+ (f2cl-lib:fref b-%data% (k) ((1 *)) b-%offset%)
112 (ddot (f2cl-lib:int-sub n k)
113 (f2cl-lib:array-slice a-%data%
114 double-float
115 ((+ k 1) k)
116 ((1 lda) (1 *))
117 a-%offset%)
119 (f2cl-lib:array-slice b-%data%
120 double-float
121 ((+ k 1))
122 ((1 *))
123 b-%offset%)
124 1)))
125 (setf l (f2cl-lib:fref ipvt-%data% (k) ((1 *)) ipvt-%offset%))
126 (if (= l k) (go label70))
127 (setf t$ (f2cl-lib:fref b-%data% (l) ((1 *)) b-%offset%))
128 (setf (f2cl-lib:fref b-%data% (l) ((1 *)) b-%offset%)
129 (f2cl-lib:fref b-%data% (k) ((1 *)) b-%offset%))
130 (setf (f2cl-lib:fref b-%data% (k) ((1 *)) b-%offset%) t$)
131 label70
132 label80))
133 label90
134 label100
135 (go end_label)
136 end_label
137 (return (values nil nil nil nil nil nil)))))
139 (in-package #:cl-user)
140 #+#.(cl:if (cl:find-package '#:f2cl) '(and) '(or))
141 (eval-when (:load-toplevel :compile-toplevel :execute)
142 (setf (gethash 'fortran-to-lisp::dgesl fortran-to-lisp::*f2cl-function-info*)
143 (fortran-to-lisp::make-f2cl-finfo
144 :arg-types '((array double-float (*)) (fortran-to-lisp::integer4)
145 (fortran-to-lisp::integer4)
146 (array fortran-to-lisp::integer4 (*))
147 (array double-float (*)) (fortran-to-lisp::integer4))
148 :return-values '(nil nil nil nil nil nil)
149 :calls '(fortran-to-lisp::ddot fortran-to-lisp::daxpy))))