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")
20 (defun tangnf (rholen y yp ypold a qr alpha tz pivot nfe n iflag par ipar
)
21 (declare (type (array f2cl-lib
:integer4
(*)) ipar
)
22 (type (array double-float
(*)) par
)
23 (type (f2cl-lib:integer4
) iflag n nfe
)
24 (type (array f2cl-lib
:integer4
(*)) pivot
)
25 (type (array double-float
(*)) tz alpha qr a ypold yp y
)
26 (type (double-float) rholen
))
27 (f2cl-lib:with-multi-array-data
28 ((y double-float y-%data% y-%offset%
)
29 (yp double-float yp-%data% yp-%offset%
)
30 (ypold double-float ypold-%data% ypold-%offset%
)
31 (a double-float a-%data% a-%offset%
)
32 (qr double-float qr-%data% qr-%offset%
)
33 (alpha double-float alpha-%data% alpha-%offset%
)
34 (tz double-float tz-%data% tz-%offset%
)
35 (pivot f2cl-lib
:integer4 pivot-%data% pivot-%offset%
)
36 (par double-float par-%data% par-%offset%
)
37 (ipar f2cl-lib
:integer4 ipar-%data% ipar-%offset%
))
38 (prog ((i 0) (j 0) (jbar 0) (k 0) (kp1 0) (np1 0) (np2 0) (alphak 0.0)
39 (beta 0.0) (qrkk 0.0) (sigma 0.0) (sum 0.0) (ypnorm 0.0)
41 (declare (type (double-float) lambda$ ypnorm sum sigma qrkk beta alphak
)
42 (type (f2cl-lib:integer4
) np2 np1 kp1 k jbar j i
))
44 (f2cl-lib:fref y-%data%
46 ((1 (f2cl-lib:int-add n
1)))
48 (setf np1
(f2cl-lib:int-add n
1))
49 (setf np2
(f2cl-lib:int-add n
2))
50 (setf nfe
(f2cl-lib:int-add nfe
1))
52 ((= iflag
(f2cl-lib:int-sub
2))
53 (f2cl-lib:fdo
(k 1 (f2cl-lib:int-add k
1))
56 (multiple-value-bind (var-0 var-1 var-2 var-3 var-4 var-5 var-6
)
58 (f2cl-lib:array-slice y-%data%
61 ((1 (f2cl-lib:int-add n
1)))
63 (f2cl-lib:array-slice qr-%data%
66 ((1 n
) (1 (f2cl-lib:int-add n
2)))
69 (declare (ignore var-0 var-2 var-3 var-4 var-5 var-6
))
72 (multiple-value-bind (var-0 var-1 var-2 var-3 var-4 var-5
)
74 (f2cl-lib:array-slice y-%data%
77 ((1 (f2cl-lib:int-add n
1)))
79 (f2cl-lib:array-slice qr-%data%
82 ((1 n
) (1 (f2cl-lib:int-add n
2)))
85 (declare (ignore var-0 var-2 var-3 var-4 var-5
))
86 (setf lambda$ var-1
)))
89 (f2cl-lib:array-slice y-%data%
92 ((1 (f2cl-lib:int-add n
1)))
97 (f2cl-lib:fdo
(j 1 (f2cl-lib:int-add j
1))
100 (setf sigma
(f2cl-lib:fref a-%data%
(j) ((1 n
)) a-%offset%
))
103 (f2cl-lib:fref tz-%data%
105 ((1 (f2cl-lib:int-add n
1)))
107 (setf (f2cl-lib:fref qr-%data%
109 ((1 n
) (1 (f2cl-lib:int-add n
2)))
113 (setf (f2cl-lib:fref qr-%data%
115 ((1 n
) (1 (f2cl-lib:int-add n
2)))
119 (f2cl-lib:fref y-%data%
120 ((f2cl-lib:int-add j
1))
121 ((1 (f2cl-lib:int-add n
1)))
125 (f2cl-lib:fdo
(k 1 (f2cl-lib:int-add k
1))
129 (f2cl-lib:array-slice y-%data%
132 ((1 (f2cl-lib:int-add n
1)))
135 (setf kp1
(f2cl-lib:int-add k
1))
136 (f2cl-lib:fdo
(j 1 (f2cl-lib:int-add j
1))
140 (setf (f2cl-lib:fref qr-%data%
142 ((1 n
) (1 (f2cl-lib:int-add n
2)))
145 (f2cl-lib:fref tz-%data%
147 ((1 (f2cl-lib:int-add n
1)))
150 (setf (f2cl-lib:fref qr-%data%
152 ((1 n
) (1 (f2cl-lib:int-add n
2)))
155 (f2cl-lib:fref qr-%data%
157 ((1 n
) (1 (f2cl-lib:int-add n
2)))
162 (f2cl-lib:fdo
(j 1 (f2cl-lib:int-add j
1))
167 (f2cl-lib:fref y-%data%
168 ((f2cl-lib:int-add j
1))
169 ((1 (f2cl-lib:int-add n
1)))
171 (f2cl-lib:fref a-%data%
(j) ((1 n
)) a-%offset%
)))
174 (f2cl-lib:fref tz-%data%
176 ((1 (f2cl-lib:int-add n
1)))
179 (setf (f2cl-lib:fref qr-%data%
181 ((1 n
) (1 (f2cl-lib:int-add n
2)))
185 (setf (f2cl-lib:fref qr-%data%
187 ((1 n
) (1 (f2cl-lib:int-add n
2)))
189 (+ sigma
(* lambda$ beta
)))))
190 (f2cl-lib:fdo
(k 1 (f2cl-lib:int-add k
1))
194 (f2cl-lib:array-slice y-%data%
197 ((1 (f2cl-lib:int-add n
1)))
200 (setf kp1
(f2cl-lib:int-add k
1))
201 (f2cl-lib:fdo
(j 1 (f2cl-lib:int-add j
1))
205 (setf (f2cl-lib:fref qr-%data%
207 ((1 n
) (1 (f2cl-lib:int-add n
2)))
210 (f2cl-lib:fref tz-%data%
212 ((1 (f2cl-lib:int-add n
1)))
215 (setf (f2cl-lib:fref qr-%data%
217 ((1 n
) (1 (f2cl-lib:int-add n
2)))
220 (f2cl-lib:fref qr-%data%
222 ((1 n
) (1 (f2cl-lib:int-add n
2)))
223 qr-%offset%
))))))))))
227 (f2cl-lib:array-slice qr-%data%
230 ((1 n
) (1 (f2cl-lib:int-add n
2)))
233 (f2cl-lib:fdo
(j 1 (f2cl-lib:int-add j
1))
236 (setf (f2cl-lib:fref yp-%data%
238 ((1 (f2cl-lib:int-add n
1)))
241 (f2cl-lib:array-slice qr-%data%
244 ((1 n
) (1 (f2cl-lib:int-add n
2)))
247 (f2cl-lib:array-slice qr-%data%
250 ((1 n
) (1 (f2cl-lib:int-add n
2)))
254 (setf (f2cl-lib:fref pivot-%data%
256 ((1 (f2cl-lib:int-add n
1)))
259 (f2cl-lib:fdo
(k 1 (f2cl-lib:int-add k
1))
263 (f2cl-lib:fref yp-%data%
265 ((1 (f2cl-lib:int-add n
1)))
268 (setf kp1
(f2cl-lib:int-add k
1))
269 (f2cl-lib:fdo
(j kp1
(f2cl-lib:int-add j
1))
274 (f2cl-lib:fref yp-%data%
276 ((1 (f2cl-lib:int-add n
1)))
280 (f2cl-lib:fref yp-%data%
282 ((1 (f2cl-lib:int-add n
1)))
286 (if (= jbar k
) (go label260
))
288 (f2cl-lib:fref pivot-%data%
290 ((1 (f2cl-lib:int-add n
1)))
292 (setf (f2cl-lib:fref pivot-%data%
294 ((1 (f2cl-lib:int-add n
1)))
296 (f2cl-lib:fref pivot-%data%
298 ((1 (f2cl-lib:int-add n
1)))
300 (setf (f2cl-lib:fref pivot-%data%
302 ((1 (f2cl-lib:int-add n
1)))
305 (setf (f2cl-lib:fref yp-%data%
307 ((1 (f2cl-lib:int-add n
1)))
309 (f2cl-lib:fref yp-%data%
311 ((1 (f2cl-lib:int-add n
1)))
313 (setf (f2cl-lib:fref yp-%data%
315 ((1 (f2cl-lib:int-add n
1)))
318 (f2cl-lib:fdo
(i 1 (f2cl-lib:int-add i
1))
322 (f2cl-lib:fref qr-%data%
324 ((1 n
) (1 (f2cl-lib:int-add n
2)))
326 (setf (f2cl-lib:fref qr-%data%
328 ((1 n
) (1 (f2cl-lib:int-add n
2)))
330 (f2cl-lib:fref qr-%data%
332 ((1 n
) (1 (f2cl-lib:int-add n
2)))
334 (setf (f2cl-lib:fref qr-%data%
336 ((1 n
) (1 (f2cl-lib:int-add n
2)))
342 (ddot (f2cl-lib:int-add
(f2cl-lib:int-sub n k
) 1)
343 (f2cl-lib:array-slice qr-%data%
346 ((1 n
) (1 (f2cl-lib:int-add n
2)))
349 (f2cl-lib:array-slice qr-%data%
352 ((1 n
) (1 (f2cl-lib:int-add n
2)))
360 (if (= k n
) (go label300
))
362 (f2cl-lib:fref qr-%data%
364 ((1 n
) (1 (f2cl-lib:int-add n
2)))
366 (setf alphak
(- (f2cl-lib:fsqrt sigma
)))
367 (if (< qrkk
0.0f0
) (setf alphak
(- alphak
)))
368 (setf (f2cl-lib:fref alpha-%data%
(k) ((1 n
)) alpha-%offset%
) alphak
)
369 (setf beta
(/ 1.0f0
(- sigma
(* qrkk alphak
))))
370 (setf (f2cl-lib:fref qr-%data%
372 ((1 n
) (1 (f2cl-lib:int-add n
2)))
375 (f2cl-lib:fdo
(j kp1
(f2cl-lib:int-add j
1))
380 (ddot (f2cl-lib:int-add
(f2cl-lib:int-sub n k
) 1)
381 (f2cl-lib:array-slice qr-%data%
385 (1 (f2cl-lib:int-add n
2)))
388 (f2cl-lib:array-slice qr-%data%
392 (1 (f2cl-lib:int-add n
2)))
395 (f2cl-lib:fdo
(i k
(f2cl-lib:int-add i
1))
398 (setf (f2cl-lib:fref qr-%data%
400 ((1 n
) (1 (f2cl-lib:int-add n
2)))
403 (f2cl-lib:fref qr-%data%
405 ((1 n
) (1 (f2cl-lib:int-add n
2)))
408 (f2cl-lib:fref qr-%data%
410 ((1 n
) (1 (f2cl-lib:int-add n
2)))
415 (setf (f2cl-lib:fref yp-%data%
417 ((1 (f2cl-lib:int-add n
1)))
420 (f2cl-lib:fref yp-%data%
422 ((1 (f2cl-lib:int-add n
1)))
425 (f2cl-lib:fref qr-%data%
427 ((1 n
) (1 (f2cl-lib:int-add n
2)))
432 (setf (f2cl-lib:fref alpha-%data%
(n) ((1 n
)) alpha-%offset%
)
433 (f2cl-lib:fref qr-%data%
435 ((1 n
) (1 (f2cl-lib:int-add n
2)))
437 (setf (f2cl-lib:fref tz-%data%
439 ((1 (f2cl-lib:int-add n
1)))
441 (coerce 1.0f0
'double-float
))
442 (f2cl-lib:fdo
(i n
(f2cl-lib:int-add i
(f2cl-lib:int-sub
1)))
445 (setf sum
(coerce 0.0f0
'double-float
))
446 (f2cl-lib:fdo
(j (f2cl-lib:int-add i
1) (f2cl-lib:int-add j
1))
453 (f2cl-lib:fref qr-%data%
455 ((1 n
) (1 (f2cl-lib:int-add n
2)))
457 (f2cl-lib:fref tz-%data%
459 ((1 (f2cl-lib:int-add n
1)))
462 (setf (f2cl-lib:fref tz-%data%
464 ((1 (f2cl-lib:int-add n
1)))
467 (f2cl-lib:fref alpha-%data%
471 (setf ypnorm
(dnrm2 np1 tz
1))
472 (f2cl-lib:fdo
(k 1 (f2cl-lib:int-add k
1))
476 (setf (f2cl-lib:fref yp-%data%
477 ((f2cl-lib:fref pivot
479 ((1 (f2cl-lib:int-add n
1)))))
480 ((1 (f2cl-lib:int-add n
1)))
483 (f2cl-lib:fref tz-%data%
485 ((1 (f2cl-lib:int-add n
1)))
488 (if (>= (ddot np1 yp
1 ypold
1) 0.0f0
) (go label380
))
489 (f2cl-lib:fdo
(i 1 (f2cl-lib:int-add i
1))
493 (setf (f2cl-lib:fref yp-%data%
495 ((1 (f2cl-lib:int-add n
1)))
498 (f2cl-lib:fref yp-%data%
500 ((1 (f2cl-lib:int-add n
1)))
503 (f2cl-lib:fdo
(i n
(f2cl-lib:int-add i
(f2cl-lib:int-sub
1)))
508 (f2cl-lib:fref qr-%data%
510 ((1 n
) (1 (f2cl-lib:int-add n
2)))
512 (f2cl-lib:fref qr-%data%
514 ((1 n
) (1 (f2cl-lib:int-add n
2)))
516 (f2cl-lib:fdo
(j (f2cl-lib:int-add i
1) (f2cl-lib:int-add j
1))
523 (f2cl-lib:fref qr-%data%
525 ((1 n
) (1 (f2cl-lib:int-add n
2)))
527 (f2cl-lib:fref alpha-%data%
532 (setf (f2cl-lib:fref alpha-%data%
(i) ((1 n
)) alpha-%offset%
)
534 (f2cl-lib:fref alpha-%data%
538 (f2cl-lib:fdo
(k 1 (f2cl-lib:int-add k
1))
542 (setf (f2cl-lib:fref tz-%data%
543 ((f2cl-lib:fref pivot
545 ((1 (f2cl-lib:int-add n
1)))))
546 ((1 (f2cl-lib:int-add n
1)))
548 (f2cl-lib:fref alpha-%data%
(k) ((1 n
)) alpha-%offset%
))))
549 (setf (f2cl-lib:fref tz-%data%
550 ((f2cl-lib:fref pivot
552 ((1 (f2cl-lib:int-add n
1)))))
553 ((1 (f2cl-lib:int-add n
1)))
555 (coerce 1.0f0
'double-float
))
556 (setf sigma
(ddot np1 tz
1 yp
1))
557 (f2cl-lib:fdo
(j 1 (f2cl-lib:int-add j
1))
560 (setf (f2cl-lib:fref tz-%data%
562 ((1 (f2cl-lib:int-add n
1)))
565 (f2cl-lib:fref tz-%data%
567 ((1 (f2cl-lib:int-add n
1)))
570 (f2cl-lib:fref yp-%data%
572 ((1 (f2cl-lib:int-add n
1)))
578 (values rholen nil nil nil nil nil nil nil nil nfe nil iflag nil nil
)))))
580 (in-package #:cl-user
)
581 #+#.
(cl:if
(cl:find-package
'#:f2cl
) '(and) '(or))
582 (eval-when (:load-toplevel
:compile-toplevel
:execute
)
583 (setf (gethash 'fortran-to-lisp
::tangnf
584 fortran-to-lisp
::*f2cl-function-info
*)
585 (fortran-to-lisp::make-f2cl-finfo
586 :arg-types
'((double-float) (array double-float
(*))
587 (array double-float
(*)) (array double-float
(*))
588 (array double-float
(*)) (array double-float
(*))
589 (array double-float
(*)) (array double-float
(*))
590 (array fortran-to-lisp
::integer4
(*))
591 (fortran-to-lisp::integer4
) (fortran-to-lisp::integer4
)
592 (fortran-to-lisp::integer4
) (array double-float
(*))
593 (array fortran-to-lisp
::integer4
(*)))
594 :return-values
'(fortran-to-lisp::rholen nil nil nil nil nil nil nil
595 nil fortran-to-lisp
::nfe nil fortran-to-lisp
::iflag
597 :calls
'(fortran-to-lisp::fjac fortran-to-lisp
::f
598 fortran-to-lisp
::ddot fortran-to-lisp
::dnrm2
599 fortran-to-lisp
::rho fortran-to-lisp
::rhojac
))))