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 pcgqs (nn aa lenaa maxa pp yp rho start work iflag
)
21 (declare (type (array f2cl-lib
:integer4
(*)) maxa
)
22 (type (array double-float
(*)) work start rho yp pp aa
)
23 (type (f2cl-lib:integer4
) iflag lenaa nn
))
24 (f2cl-lib:with-multi-array-data
25 ((aa double-float aa-%data% aa-%offset%
)
26 (pp double-float pp-%data% pp-%offset%
)
27 (yp double-float yp-%data% yp-%offset%
)
28 (rho double-float rho-%data% rho-%offset%
)
29 (start double-float start-%data% start-%offset%
)
30 (work double-float work-%data% work-%offset%
)
31 (maxa f2cl-lib
:integer4 maxa-%data% maxa-%offset%
))
32 (prog ((stillu nil
) (stillb nil
) (dir 0) (imax 0) (j 0) (lenq 0) (np1 0)
33 (q 0) (res 0) (zb 0) (zu 0) (ab 0.0) (au 0.0) (bb 0.0) (bu 0.0)
34 (dznrm 0.0) (pbnprd 0.0) (punprd 0.0) (rbnprd 0.0) (rbtol 0.0)
35 (rnprd 0.0) (runprd 0.0) (rutol 0.0) (temp 0.0) (zlen 0.0)
37 (declare (type (double-float) ztol zlen temp rutol runprd rnprd rbtol
38 rbnprd punprd pbnprd dznrm bu bb au ab
)
39 (type (f2cl-lib:integer4
) zu zb res q np1 lenq j imax dir
)
40 (type f2cl-lib
:logical stillb stillu
))
41 (setf np1
(f2cl-lib:int-add nn
1))
42 (setf zu
(f2cl-lib:int-add nn
2))
43 (setf zb
(f2cl-lib:int-add
(f2cl-lib:int-mul
2 nn
) 3))
44 (setf res
(f2cl-lib:int-add
(f2cl-lib:int-mul
3 nn
) 4))
45 (setf dir
(f2cl-lib:int-add
(f2cl-lib:int-mul
4 nn
) 5))
46 (setf q
(f2cl-lib:int-add
(f2cl-lib:int-mul
5 nn
) 6))
48 (f2cl-lib:array-slice work-%data%
53 (f2cl-lib:int-mul
6 (f2cl-lib:int-add nn
1))
58 (f2cl-lib:array-slice work-%data%
63 (f2cl-lib:int-mul
6 (f2cl-lib:int-add nn
1))
67 (setf (f2cl-lib:fref maxa-%data%
68 ((f2cl-lib:int-add nn
1))
69 ((1 (f2cl-lib:int-add nn
2)))
71 (f2cl-lib:int-add lenaa
1))
72 (setf (f2cl-lib:fref maxa-%data%
73 ((f2cl-lib:int-add nn
2))
74 ((1 (f2cl-lib:int-add nn
2)))
76 (f2cl-lib:int-add lenaa nn
2))
79 (f2cl-lib:fref maxa-%data%
80 ((f2cl-lib:int-add nn
2))
81 ((1 (f2cl-lib:int-add nn
2)))
85 (f2cl-lib:array-slice work-%data%
90 (f2cl-lib:int-mul
6 (f2cl-lib:int-add nn
1))
94 (dcopy nn pp
1 work
1)
95 (setf (f2cl-lib:fref work-%data%
99 (f2cl-lib:int-mul
6 (f2cl-lib:int-add nn
1))
102 (coerce 0.0f0
'double-float
))
103 (daxpy np1
1.0 yp
1 work
1)
104 (setf imax
(f2cl-lib:int-mul
10 np1
))
105 (setf stillu f2cl-lib
:%true%
)
106 (setf stillb f2cl-lib
:%true%
)
107 (setf ztol
(* 100.0f0
(f2cl-lib:d1mach
4)))
108 (setf rutol
(* ztol
(dnrm2 np1 work
1)))
109 (setf rbtol
(* ztol
(dnrm2 np1 rho
1)))
111 (f2cl-lib:array-slice work-%data%
116 (f2cl-lib:int-mul
6 (f2cl-lib:int-add nn
1))
120 (f2cl-lib:array-slice work-%data%
125 (f2cl-lib:int-mul
6 (f2cl-lib:int-add nn
1))
129 (setf (f2cl-lib:fref work-%data%
130 ((f2cl-lib:int-add res nn
))
133 (f2cl-lib:int-mul
6 (f2cl-lib:int-add nn
1))
137 (f2cl-lib:array-slice work-%data%
149 (f2cl-lib:fref work-%data%
150 ((f2cl-lib:int-add zu nn
))
153 (f2cl-lib:int-mul
6 (f2cl-lib:int-add nn
1))
157 (f2cl-lib:array-slice work-%data%
162 (f2cl-lib:int-mul
6 (f2cl-lib:int-add nn
1))
167 (f2cl-lib:array-slice work-%data%
172 (f2cl-lib:int-mul
6 (f2cl-lib:int-add nn
1))
177 (f2cl-lib:array-slice work-%data%
182 (f2cl-lib:int-mul
6 (f2cl-lib:int-add nn
1))
187 (f2cl-lib:array-slice work-%data%
192 (f2cl-lib:int-mul
6 (f2cl-lib:int-add nn
1))
197 (f2cl-lib:array-slice work-%data%
202 (f2cl-lib:int-mul
6 (f2cl-lib:int-add nn
1))
206 (f2cl-lib:array-slice work-%data%
211 (f2cl-lib:int-mul
6 (f2cl-lib:int-add nn
1))
215 (f2cl-lib:array-slice work-%data%
220 (f2cl-lib:int-mul
6 (f2cl-lib:int-add nn
1))
225 (f2cl-lib:array-slice work-%data%
230 (f2cl-lib:int-mul
6 (f2cl-lib:int-add nn
1))
235 (f2cl-lib:array-slice work-%data%
240 (f2cl-lib:int-mul
6 (f2cl-lib:int-add nn
1))
243 aa work maxa nn lenaa
)
244 (setf (f2cl-lib:fref work-%data%
245 ((f2cl-lib:int-add dir nn
))
248 (f2cl-lib:int-mul
6 (f2cl-lib:int-add nn
1))
251 (ddot nn yp
1 work
1))
253 (f2cl-lib:fref work-%data%
257 (f2cl-lib:int-mul
6 (f2cl-lib:int-add nn
1))
261 (f2cl-lib:array-slice work-%data%
266 (f2cl-lib:int-mul
6 (f2cl-lib:int-add nn
1))
272 (f2cl-lib:array-slice work-%data%
283 (f2cl-lib:array-slice work-%data%
296 (f2cl-lib:array-slice work-%data%
307 (f2cl-lib:array-slice work-%data%
320 (if (not (and stillu
(<= j imax
))) (go label200
))
322 ((> (f2cl-lib:fsqrt runprd
) rutol
)
326 (f2cl-lib:array-slice work-%data%
337 (f2cl-lib:array-slice work-%data%
348 (setf (f2cl-lib:fref work-%data%
349 ((f2cl-lib:int-add res nn
))
353 (f2cl-lib:int-add nn
1))
357 (f2cl-lib:array-slice work-%data%
370 (f2cl-lib:fref work-%data%
371 ((f2cl-lib:int-add zu nn
))
374 (f2cl-lib:int-mul
6 (f2cl-lib:int-add nn
1))
378 (f2cl-lib:array-slice work-%data%
390 (f2cl-lib:array-slice work-%data%
402 (f2cl-lib:array-slice work-%data%
414 (f2cl-lib:array-slice work-%data%
426 (f2cl-lib:array-slice work-%data%
437 (f2cl-lib:array-slice work-%data%
448 (f2cl-lib:array-slice work-%data%
460 (f2cl-lib:array-slice work-%data%
472 (f2cl-lib:array-slice work-%data%
482 aa work maxa nn lenaa
)
483 (setf (f2cl-lib:fref work-%data%
484 ((f2cl-lib:int-add dir nn
))
488 (f2cl-lib:int-add nn
1))
491 (ddot nn yp
1 work
1))
493 (f2cl-lib:fref work-%data%
497 (f2cl-lib:int-mul
6 (f2cl-lib:int-add nn
1))
501 (f2cl-lib:array-slice work-%data%
514 (f2cl-lib:array-slice work-%data%
526 (f2cl-lib:array-slice work-%data%
540 (f2cl-lib:array-slice work-%data%
552 (f2cl-lib:array-slice work-%data%
565 ((<= (f2cl-lib:fsqrt runprd
) rutol
)
566 (setf stillu f2cl-lib
:%false%
)))))
569 (setf au
(/ runprd punprd
))
571 (f2cl-lib:array-slice work-%data%
582 (f2cl-lib:array-slice work-%data%
593 (setf dznrm
(* au
(f2cl-lib:fsqrt punprd
)))
596 (f2cl-lib:array-slice work-%data%
608 (if (< (/ dznrm zlen
) ztol
) (setf stillu f2cl-lib
:%false%
)))))
610 (setf stillu f2cl-lib
:%false%
)))
614 (f2cl-lib:array-slice work-%data%
619 (f2cl-lib:int-mul
6 (f2cl-lib:int-add nn
1))
623 (setf (f2cl-lib:fref work-%data%
627 (f2cl-lib:int-mul
6 (f2cl-lib:int-add nn
1))
631 (f2cl-lib:array-slice work-%data%
644 (f2cl-lib:fref work-%data%
645 ((f2cl-lib:int-add dir nn
))
648 (f2cl-lib:int-mul
6 (f2cl-lib:int-add nn
1))
653 (f2cl-lib:array-slice work-%data%
658 (f2cl-lib:int-mul
6 (f2cl-lib:int-add nn
1))
662 (daxpy np1
(- au
) work
1
663 (f2cl-lib:array-slice work-%data%
668 (f2cl-lib:int-mul
6 (f2cl-lib:int-add nn
1))
674 (f2cl-lib:array-slice work-%data%
686 (f2cl-lib:array-slice work-%data%
698 (setf bu
(/ rnprd runprd
))
701 (f2cl-lib:array-slice work-%data%
706 (f2cl-lib:int-mul
6 (f2cl-lib:int-add nn
1))
711 (f2cl-lib:array-slice work-%data%
716 (f2cl-lib:int-mul
6 (f2cl-lib:int-add nn
1))
720 (multds start aa work maxa nn lenaa
)
721 (setf (f2cl-lib:fref start-%data%
723 ((1 (f2cl-lib:int-add nn
1)))
725 (ddot nn yp
1 work
1))
727 (f2cl-lib:fref work-%data%
731 (f2cl-lib:int-mul
6 (f2cl-lib:int-add nn
1))
736 (f2cl-lib:array-slice work-%data%
741 (f2cl-lib:int-mul
6 (f2cl-lib:int-add nn
1))
746 (f2cl-lib:array-slice work-%data%
751 (f2cl-lib:int-mul
6 (f2cl-lib:int-add nn
1))
757 (f2cl-lib:array-slice work-%data%
769 (f2cl-lib:array-slice work-%data%
781 (setf j
(f2cl-lib:int-add j
1))
789 (f2cl-lib:array-slice work-%data%
794 (f2cl-lib:int-mul
6 (f2cl-lib:int-add nn
1))
798 (f2cl-lib:array-slice work-%data%
803 (f2cl-lib:int-mul
6 (f2cl-lib:int-add nn
1))
807 (setf (f2cl-lib:fref work-%data%
808 ((f2cl-lib:int-add res nn
))
811 (f2cl-lib:int-mul
6 (f2cl-lib:int-add nn
1))
815 (f2cl-lib:array-slice work-%data%
827 (f2cl-lib:fref work-%data%
828 ((f2cl-lib:int-add zb nn
))
831 (f2cl-lib:int-mul
6 (f2cl-lib:int-add nn
1))
835 (f2cl-lib:array-slice work-%data%
840 (f2cl-lib:int-mul
6 (f2cl-lib:int-add nn
1))
845 (f2cl-lib:array-slice work-%data%
850 (f2cl-lib:int-mul
6 (f2cl-lib:int-add nn
1))
854 (daxpy np1 -
1.0 rho
1
855 (f2cl-lib:array-slice work-%data%
860 (f2cl-lib:int-mul
6 (f2cl-lib:int-add nn
1))
865 (f2cl-lib:array-slice work-%data%
870 (f2cl-lib:int-mul
6 (f2cl-lib:int-add nn
1))
874 (f2cl-lib:array-slice work-%data%
879 (f2cl-lib:int-mul
6 (f2cl-lib:int-add nn
1))
883 (f2cl-lib:array-slice work-%data%
888 (f2cl-lib:int-mul
6 (f2cl-lib:int-add nn
1))
893 (f2cl-lib:array-slice work-%data%
898 (f2cl-lib:int-mul
6 (f2cl-lib:int-add nn
1))
903 (f2cl-lib:array-slice work-%data%
908 (f2cl-lib:int-mul
6 (f2cl-lib:int-add nn
1))
911 aa work maxa nn lenaa
)
912 (setf (f2cl-lib:fref work-%data%
913 ((f2cl-lib:int-add dir nn
))
916 (f2cl-lib:int-mul
6 (f2cl-lib:int-add nn
1))
919 (ddot nn yp
1 work
1))
921 (f2cl-lib:fref work-%data%
925 (f2cl-lib:int-mul
6 (f2cl-lib:int-add nn
1))
929 (f2cl-lib:array-slice work-%data%
934 (f2cl-lib:int-mul
6 (f2cl-lib:int-add nn
1))
940 (f2cl-lib:array-slice work-%data%
951 (f2cl-lib:array-slice work-%data%
964 (f2cl-lib:array-slice work-%data%
975 (f2cl-lib:array-slice work-%data%
988 (if (not (and stillb
(<= j imax
))) (go label400
))
990 ((> (f2cl-lib:fsqrt rbnprd
) rbtol
)
994 (f2cl-lib:array-slice work-%data%
1000 (f2cl-lib:int-add nn
1005 (f2cl-lib:array-slice work-%data%
1011 (f2cl-lib:int-add nn
1016 (setf (f2cl-lib:fref work-%data%
1017 ((f2cl-lib:int-add res nn
))
1021 (f2cl-lib:int-add nn
1))
1025 (f2cl-lib:array-slice work-%data%
1038 (f2cl-lib:fref work-%data%
1039 ((f2cl-lib:int-add zb nn
))
1042 (f2cl-lib:int-mul
6 (f2cl-lib:int-add nn
1))
1046 (f2cl-lib:array-slice work-%data%
1052 (f2cl-lib:int-add nn
1058 (f2cl-lib:array-slice work-%data%
1064 (f2cl-lib:int-add nn
1069 (daxpy np1 -
1.0 rho
1
1070 (f2cl-lib:array-slice work-%data%
1076 (f2cl-lib:int-add nn
1082 (f2cl-lib:array-slice work-%data%
1088 (f2cl-lib:int-add nn
1093 (f2cl-lib:array-slice work-%data%
1099 (f2cl-lib:int-add nn
1104 (f2cl-lib:array-slice work-%data%
1110 (f2cl-lib:int-add nn
1116 (f2cl-lib:array-slice work-%data%
1122 (f2cl-lib:int-add nn
1128 (f2cl-lib:array-slice work-%data%
1134 (f2cl-lib:int-add nn
1138 aa work maxa nn lenaa
)
1139 (setf (f2cl-lib:fref work-%data%
1140 ((f2cl-lib:int-add dir nn
))
1144 (f2cl-lib:int-add nn
1))
1147 (ddot nn yp
1 work
1))
1149 (f2cl-lib:fref work-%data%
1153 (f2cl-lib:int-mul
6 (f2cl-lib:int-add nn
1))
1157 (f2cl-lib:array-slice work-%data%
1163 (f2cl-lib:int-add nn
1170 (f2cl-lib:array-slice work-%data%
1182 (f2cl-lib:array-slice work-%data%
1196 (f2cl-lib:array-slice work-%data%
1208 (f2cl-lib:array-slice work-%data%
1221 ((<= (f2cl-lib:fsqrt rbnprd
) rbtol
)
1222 (setf stillb f2cl-lib
:%false%
)))))
1225 (setf ab
(/ rbnprd pbnprd
))
1227 (f2cl-lib:array-slice work-%data%
1233 (f2cl-lib:int-add nn
1238 (f2cl-lib:array-slice work-%data%
1244 (f2cl-lib:int-add nn
1249 (setf dznrm
(* ab
(f2cl-lib:fsqrt pbnprd
)))
1252 (f2cl-lib:array-slice work-%data%
1264 (if (< (/ dznrm zlen
) ztol
) (setf stillb f2cl-lib
:%false%
)))))
1266 (setf stillb f2cl-lib
:%false%
)))
1270 (f2cl-lib:array-slice work-%data%
1275 (f2cl-lib:int-mul
6 (f2cl-lib:int-add nn
1))
1279 (setf (f2cl-lib:fref work-%data%
1283 (f2cl-lib:int-mul
6 (f2cl-lib:int-add nn
1))
1287 (f2cl-lib:array-slice work-%data%
1300 (f2cl-lib:fref work-%data%
1301 ((f2cl-lib:int-add dir nn
))
1304 (f2cl-lib:int-mul
6 (f2cl-lib:int-add nn
1))
1309 (f2cl-lib:array-slice work-%data%
1314 (f2cl-lib:int-mul
6 (f2cl-lib:int-add nn
1))
1318 (daxpy np1
(- ab
) work
1
1319 (f2cl-lib:array-slice work-%data%
1324 (f2cl-lib:int-mul
6 (f2cl-lib:int-add nn
1))
1330 (f2cl-lib:array-slice work-%data%
1342 (f2cl-lib:array-slice work-%data%
1354 (setf bb
(/ rnprd rbnprd
))
1357 (f2cl-lib:array-slice work-%data%
1362 (f2cl-lib:int-mul
6 (f2cl-lib:int-add nn
1))
1367 (f2cl-lib:array-slice work-%data%
1372 (f2cl-lib:int-mul
6 (f2cl-lib:int-add nn
1))
1376 (multds start aa work maxa nn lenaa
)
1377 (setf (f2cl-lib:fref start-%data%
1379 ((1 (f2cl-lib:int-add nn
1)))
1381 (ddot nn yp
1 work
1))
1383 (f2cl-lib:fref work-%data%
1387 (f2cl-lib:int-mul
6 (f2cl-lib:int-add nn
1))
1392 (f2cl-lib:array-slice work-%data%
1397 (f2cl-lib:int-mul
6 (f2cl-lib:int-add nn
1))
1402 (f2cl-lib:array-slice work-%data%
1407 (f2cl-lib:int-mul
6 (f2cl-lib:int-add nn
1))
1413 (f2cl-lib:array-slice work-%data%
1425 (f2cl-lib:array-slice work-%data%
1437 (setf j
(f2cl-lib:int-add j
1))
1447 (f2cl-lib:fref work-%data%
1448 ((f2cl-lib:int-add zb nn
))
1451 (f2cl-lib:int-mul
6 (f2cl-lib:int-add nn
1))
1455 (f2cl-lib:fref work-%data%
1456 ((f2cl-lib:int-add zu nn
))
1460 (f2cl-lib:int-add nn
1))
1464 (f2cl-lib:array-slice work-%data%
1469 (f2cl-lib:int-mul
6 (f2cl-lib:int-add nn
1))
1474 (f2cl-lib:array-slice work-%data%
1479 (f2cl-lib:int-mul
6 (f2cl-lib:int-add nn
1))
1485 (return (values nil nil nil nil nil nil nil nil nil iflag
)))))
1487 (in-package #:cl-user
)
1488 #+#.
(cl:if
(cl:find-package
'#:f2cl
) '(and) '(or))
1489 (eval-when (:load-toplevel
:compile-toplevel
:execute
)
1490 (setf (gethash 'fortran-to-lisp
::pcgqs fortran-to-lisp
::*f2cl-function-info
*)
1491 (fortran-to-lisp::make-f2cl-finfo
1492 :arg-types
'((fortran-to-lisp::integer4
) (array double-float
(*))
1493 (fortran-to-lisp::integer4
)
1494 (array fortran-to-lisp
::integer4
(*))
1495 (array double-float
(*)) (array double-float
(*))
1496 (array double-float
(*)) (array double-float
(*))
1497 (array double-float
(*)) (fortran-to-lisp::integer4
))
1498 :return-values
'(nil nil nil nil nil nil nil nil nil
1499 fortran-to-lisp
::iflag
)
1500 :calls
'(fortran-to-lisp::dscal fortran-to-lisp
::ddot
1501 fortran-to-lisp
::dnrm2 fortran-to-lisp
::daxpy
1502 fortran-to-lisp
::dcopy fortran-to-lisp
::solvds
1503 fortran-to-lisp
::multds fortran-to-lisp
::d1mach
1504 fortran-to-lisp
::gmfads
))))