Add some basic letsimp tests based on bug #3950
[maxima.git] / share / lapack / blas / zhpr.lisp
blob14a411d86399f066c32f970983893a3f40196bdb
1 ;;; Compiled by f2cl version:
2 ;;; ("f2cl1.l,v 2edcbd958861 2012/05/30 03:34:52 toy $"
3 ;;; "f2cl2.l,v 96616d88fb7e 2008/02/22 22:19:34 rtoy $"
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 3fe93de3be82 2012/05/06 02:17:14 toy $"
7 ;;; "f2cl6.l,v 1d5cbacbb977 2008/08/24 00:56:27 rtoy $"
8 ;;; "macros.l,v 3fe93de3be82 2012/05/06 02:17:14 toy $")
10 ;;; Using Lisp CMU Common Lisp 20d (20D 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 :blas)
20 (let* ((zero (f2cl-lib:cmplx 0.0 0.0)))
21 (declare (type (f2cl-lib:complex16) zero) (ignorable zero))
22 (defun zhpr (uplo n alpha x incx ap)
23 (declare (type (array f2cl-lib:complex16 (*)) ap x)
24 (type (double-float) alpha)
25 (type (f2cl-lib:integer4) incx n)
26 (type (simple-string *) uplo))
27 (f2cl-lib:with-multi-array-data
28 ((uplo character uplo-%data% uplo-%offset%)
29 (x f2cl-lib:complex16 x-%data% x-%offset%)
30 (ap f2cl-lib:complex16 ap-%data% ap-%offset%))
31 (prog ((i 0) (info 0) (ix 0) (j 0) (jx 0) (k 0) (kk 0) (kx 0)
32 (temp #C(0.0 0.0)))
33 (declare (type (f2cl-lib:integer4) i info ix j jx k kk kx)
34 (type (f2cl-lib:complex16) temp))
35 (setf info 0)
36 (cond
37 ((and (not (lsame uplo "U")) (not (lsame uplo "L")))
38 (setf info 1))
39 ((< n 0)
40 (setf info 2))
41 ((= incx 0)
42 (setf info 5)))
43 (cond
44 ((/= info 0)
45 (xerbla "ZHPR " info)
46 (go end_label)))
47 (if (or (= n 0) (= alpha (f2cl-lib:dble zero))) (go end_label))
48 (cond
49 ((<= incx 0)
50 (setf kx
51 (f2cl-lib:int-sub 1
52 (f2cl-lib:int-mul (f2cl-lib:int-sub n 1)
53 incx))))
54 ((/= incx 1)
55 (setf kx 1)))
56 (setf kk 1)
57 (cond
58 ((lsame uplo "U")
59 (cond
60 ((= incx 1)
61 (f2cl-lib:fdo (j 1 (f2cl-lib:int-add j 1))
62 ((> j n) nil)
63 (tagbody
64 (cond
65 ((/= (f2cl-lib:fref x (j) ((1 *))) zero)
66 (setf temp
67 (coerce
68 (* alpha
69 (f2cl-lib:dconjg
70 (f2cl-lib:fref x-%data%
71 (j)
72 ((1 *))
73 x-%offset%)))
74 'f2cl-lib:complex16))
75 (setf k kk)
76 (f2cl-lib:fdo (i 1 (f2cl-lib:int-add i 1))
77 ((> i
78 (f2cl-lib:int-add j
79 (f2cl-lib:int-sub 1)))
80 nil)
81 (tagbody
82 (setf (f2cl-lib:fref ap-%data%
83 (k)
84 ((1 *))
85 ap-%offset%)
87 (f2cl-lib:fref ap-%data%
88 (k)
89 ((1 *))
90 ap-%offset%)
92 (f2cl-lib:fref x-%data%
93 (i)
94 ((1 *))
95 x-%offset%)
96 temp)))
97 (setf k (f2cl-lib:int-add k 1))
98 label10))
99 (setf (f2cl-lib:fref ap-%data%
100 ((f2cl-lib:int-sub
101 (f2cl-lib:int-add kk j)
103 ((1 *))
104 ap-%offset%)
105 (coerce
107 (f2cl-lib:dble
108 (f2cl-lib:fref ap-%data%
109 ((f2cl-lib:int-sub
110 (f2cl-lib:int-add kk j)
112 ((1 *))
113 ap-%offset%))
114 (f2cl-lib:dble
116 (f2cl-lib:fref x-%data%
118 ((1 *))
119 x-%offset%)
120 temp)))
121 'f2cl-lib:complex16)))
123 (setf (f2cl-lib:fref ap-%data%
124 ((f2cl-lib:int-sub
125 (f2cl-lib:int-add kk j)
127 ((1 *))
128 ap-%offset%)
129 (coerce
130 (f2cl-lib:dble
131 (f2cl-lib:fref ap-%data%
132 ((f2cl-lib:int-sub
133 (f2cl-lib:int-add kk j)
135 ((1 *))
136 ap-%offset%))
137 'f2cl-lib:complex16))))
138 (setf kk (f2cl-lib:int-add kk j))
139 label20)))
141 (setf jx kx)
142 (f2cl-lib:fdo (j 1 (f2cl-lib:int-add j 1))
143 ((> j n) nil)
144 (tagbody
145 (cond
146 ((/= (f2cl-lib:fref x (jx) ((1 *))) zero)
147 (setf temp
148 (coerce
149 (* alpha
150 (f2cl-lib:dconjg
151 (f2cl-lib:fref x-%data%
152 (jx)
153 ((1 *))
154 x-%offset%)))
155 'f2cl-lib:complex16))
156 (setf ix kx)
157 (f2cl-lib:fdo (k kk (f2cl-lib:int-add k 1))
158 ((> k
159 (f2cl-lib:int-add kk
161 (f2cl-lib:int-sub 2)))
162 nil)
163 (tagbody
164 (setf (f2cl-lib:fref ap-%data%
166 ((1 *))
167 ap-%offset%)
169 (f2cl-lib:fref ap-%data%
171 ((1 *))
172 ap-%offset%)
174 (f2cl-lib:fref x-%data%
175 (ix)
176 ((1 *))
177 x-%offset%)
178 temp)))
179 (setf ix (f2cl-lib:int-add ix incx))
180 label30))
181 (setf (f2cl-lib:fref ap-%data%
182 ((f2cl-lib:int-sub
183 (f2cl-lib:int-add kk j)
185 ((1 *))
186 ap-%offset%)
187 (coerce
189 (f2cl-lib:dble
190 (f2cl-lib:fref ap-%data%
191 ((f2cl-lib:int-sub
192 (f2cl-lib:int-add kk j)
194 ((1 *))
195 ap-%offset%))
196 (f2cl-lib:dble
198 (f2cl-lib:fref x-%data%
199 (jx)
200 ((1 *))
201 x-%offset%)
202 temp)))
203 'f2cl-lib:complex16)))
205 (setf (f2cl-lib:fref ap-%data%
206 ((f2cl-lib:int-sub
207 (f2cl-lib:int-add kk j)
209 ((1 *))
210 ap-%offset%)
211 (coerce
212 (f2cl-lib:dble
213 (f2cl-lib:fref ap-%data%
214 ((f2cl-lib:int-sub
215 (f2cl-lib:int-add kk j)
217 ((1 *))
218 ap-%offset%))
219 'f2cl-lib:complex16))))
220 (setf jx (f2cl-lib:int-add jx incx))
221 (setf kk (f2cl-lib:int-add kk j))
222 label40)))))
224 (cond
225 ((= incx 1)
226 (f2cl-lib:fdo (j 1 (f2cl-lib:int-add j 1))
227 ((> j n) nil)
228 (tagbody
229 (cond
230 ((/= (f2cl-lib:fref x (j) ((1 *))) zero)
231 (setf temp
232 (coerce
233 (* alpha
234 (f2cl-lib:dconjg
235 (f2cl-lib:fref x-%data%
237 ((1 *))
238 x-%offset%)))
239 'f2cl-lib:complex16))
240 (setf (f2cl-lib:fref ap-%data% (kk) ((1 *)) ap-%offset%)
241 (coerce
243 (f2cl-lib:dble
244 (f2cl-lib:fref ap-%data%
245 (kk)
246 ((1 *))
247 ap-%offset%))
248 (f2cl-lib:dble
249 (* temp
250 (f2cl-lib:fref x-%data%
252 ((1 *))
253 x-%offset%))))
254 'f2cl-lib:complex16))
255 (setf k (f2cl-lib:int-add kk 1))
256 (f2cl-lib:fdo (i (f2cl-lib:int-add j 1)
257 (f2cl-lib:int-add i 1))
258 ((> i n) nil)
259 (tagbody
260 (setf (f2cl-lib:fref ap-%data%
262 ((1 *))
263 ap-%offset%)
265 (f2cl-lib:fref ap-%data%
267 ((1 *))
268 ap-%offset%)
270 (f2cl-lib:fref x-%data%
272 ((1 *))
273 x-%offset%)
274 temp)))
275 (setf k (f2cl-lib:int-add k 1))
276 label50)))
278 (setf (f2cl-lib:fref ap-%data% (kk) ((1 *)) ap-%offset%)
279 (coerce
280 (f2cl-lib:dble
281 (f2cl-lib:fref ap-%data%
282 (kk)
283 ((1 *))
284 ap-%offset%))
285 'f2cl-lib:complex16))))
286 (setf kk
287 (f2cl-lib:int-add
288 (f2cl-lib:int-sub (f2cl-lib:int-add kk n) j)
290 label60)))
292 (setf jx kx)
293 (f2cl-lib:fdo (j 1 (f2cl-lib:int-add j 1))
294 ((> j n) nil)
295 (tagbody
296 (cond
297 ((/= (f2cl-lib:fref x (jx) ((1 *))) zero)
298 (setf temp
299 (coerce
300 (* alpha
301 (f2cl-lib:dconjg
302 (f2cl-lib:fref x-%data%
303 (jx)
304 ((1 *))
305 x-%offset%)))
306 'f2cl-lib:complex16))
307 (setf (f2cl-lib:fref ap-%data% (kk) ((1 *)) ap-%offset%)
308 (coerce
310 (f2cl-lib:dble
311 (f2cl-lib:fref ap-%data%
312 (kk)
313 ((1 *))
314 ap-%offset%))
315 (f2cl-lib:dble
316 (* temp
317 (f2cl-lib:fref x-%data%
318 (jx)
319 ((1 *))
320 x-%offset%))))
321 'f2cl-lib:complex16))
322 (setf ix jx)
323 (f2cl-lib:fdo (k (f2cl-lib:int-add kk 1)
324 (f2cl-lib:int-add k 1))
325 ((> k
326 (f2cl-lib:int-add kk
328 (f2cl-lib:int-sub j)))
329 nil)
330 (tagbody
331 (setf ix (f2cl-lib:int-add ix incx))
332 (setf (f2cl-lib:fref ap-%data%
334 ((1 *))
335 ap-%offset%)
337 (f2cl-lib:fref ap-%data%
339 ((1 *))
340 ap-%offset%)
342 (f2cl-lib:fref x-%data%
343 (ix)
344 ((1 *))
345 x-%offset%)
346 temp)))
347 label70)))
349 (setf (f2cl-lib:fref ap-%data% (kk) ((1 *)) ap-%offset%)
350 (coerce
351 (f2cl-lib:dble
352 (f2cl-lib:fref ap-%data%
353 (kk)
354 ((1 *))
355 ap-%offset%))
356 'f2cl-lib:complex16))))
357 (setf jx (f2cl-lib:int-add jx incx))
358 (setf kk
359 (f2cl-lib:int-add
360 (f2cl-lib:int-sub (f2cl-lib:int-add kk n) j)
362 label80))))))
363 (go end_label)
364 end_label
365 (return (values nil nil nil nil nil nil))))))
367 (in-package #-gcl #:cl-user #+gcl "CL-USER")
368 #+#.(cl:if (cl:find-package '#:f2cl) '(and) '(or))
369 (eval-when (:load-toplevel :compile-toplevel :execute)
370 (setf (gethash 'fortran-to-lisp::zhpr fortran-to-lisp::*f2cl-function-info*)
371 (fortran-to-lisp::make-f2cl-finfo
372 :arg-types '((simple-string) (fortran-to-lisp::integer4)
373 (double-float) (array fortran-to-lisp::complex16 (*))
374 (fortran-to-lisp::integer4)
375 (array fortran-to-lisp::complex16 (*)))
376 :return-values '(nil nil nil nil nil nil)
377 :calls '(fortran-to-lisp::xerbla fortran-to-lisp::lsame))))