Add some basic letsimp tests based on bug #3950
[maxima.git] / share / lapack / blas / zhpr2.lisp
blob73bba343a50ed405cde3d0d51955e7d5d9398a26
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 zhpr2 (uplo n alpha x incx y incy ap)
23 (declare (type (array f2cl-lib:complex16 (*)) ap y x)
24 (type (f2cl-lib:complex16) alpha)
25 (type (f2cl-lib:integer4) incy 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 (y f2cl-lib:complex16 y-%data% y-%offset%)
31 (ap f2cl-lib:complex16 ap-%data% ap-%offset%))
32 (prog ((i 0) (info 0) (ix 0) (iy 0) (j 0) (jx 0) (jy 0) (k 0) (kk 0)
33 (kx 0) (ky 0) (temp1 #C(0.0 0.0)) (temp2 #C(0.0 0.0)))
34 (declare (type (f2cl-lib:integer4) i info ix iy j jx jy k kk kx ky)
35 (type (f2cl-lib:complex16) temp1 temp2))
36 (setf info 0)
37 (cond
38 ((and (not (lsame uplo "U")) (not (lsame uplo "L")))
39 (setf info 1))
40 ((< n 0)
41 (setf info 2))
42 ((= incx 0)
43 (setf info 5))
44 ((= incy 0)
45 (setf info 7)))
46 (cond
47 ((/= info 0)
48 (xerbla "ZHPR2 " info)
49 (go end_label)))
50 (if (or (= n 0) (= alpha zero)) (go end_label))
51 (cond
52 ((or (/= incx 1) (/= incy 1))
53 (cond
54 ((> incx 0)
55 (setf kx 1))
57 (setf kx
58 (f2cl-lib:int-sub 1
59 (f2cl-lib:int-mul
60 (f2cl-lib:int-sub n 1)
61 incx)))))
62 (cond
63 ((> incy 0)
64 (setf ky 1))
66 (setf ky
67 (f2cl-lib:int-sub 1
68 (f2cl-lib:int-mul
69 (f2cl-lib:int-sub n 1)
70 incy)))))
71 (setf jx kx)
72 (setf jy ky)))
73 (setf kk 1)
74 (cond
75 ((lsame uplo "U")
76 (cond
77 ((and (= incx 1) (= incy 1))
78 (f2cl-lib:fdo (j 1 (f2cl-lib:int-add j 1))
79 ((> j n) nil)
80 (tagbody
81 (cond
82 ((or (/= (f2cl-lib:fref x (j) ((1 *))) zero)
83 (/= (f2cl-lib:fref y (j) ((1 *))) zero))
84 (setf temp1
85 (* alpha
86 (f2cl-lib:dconjg
87 (f2cl-lib:fref y-%data%
88 (j)
89 ((1 *))
90 y-%offset%))))
91 (setf temp2
92 (coerce
93 (f2cl-lib:dconjg
94 (* alpha
95 (f2cl-lib:fref x-%data%
96 (j)
97 ((1 *))
98 x-%offset%)))
99 'f2cl-lib:complex16))
100 (setf k kk)
101 (f2cl-lib:fdo (i 1 (f2cl-lib:int-add i 1))
102 ((> i
103 (f2cl-lib:int-add j
104 (f2cl-lib:int-sub 1)))
105 nil)
106 (tagbody
107 (setf (f2cl-lib:fref ap-%data%
109 ((1 *))
110 ap-%offset%)
112 (f2cl-lib:fref ap-%data%
114 ((1 *))
115 ap-%offset%)
117 (f2cl-lib:fref x-%data%
119 ((1 *))
120 x-%offset%)
121 temp1)
123 (f2cl-lib:fref y-%data%
125 ((1 *))
126 y-%offset%)
127 temp2)))
128 (setf k (f2cl-lib:int-add k 1))
129 label10))
130 (setf (f2cl-lib:fref ap-%data%
131 ((f2cl-lib:int-sub
132 (f2cl-lib:int-add kk j)
134 ((1 *))
135 ap-%offset%)
136 (coerce
138 (f2cl-lib:dble
139 (f2cl-lib:fref ap-%data%
140 ((f2cl-lib:int-sub
141 (f2cl-lib:int-add kk j)
143 ((1 *))
144 ap-%offset%))
145 (f2cl-lib:dble
148 (f2cl-lib:fref x-%data%
150 ((1 *))
151 x-%offset%)
152 temp1)
154 (f2cl-lib:fref y-%data%
156 ((1 *))
157 y-%offset%)
158 temp2))))
159 'f2cl-lib:complex16)))
161 (setf (f2cl-lib:fref ap-%data%
162 ((f2cl-lib:int-sub
163 (f2cl-lib:int-add kk j)
165 ((1 *))
166 ap-%offset%)
167 (coerce
168 (f2cl-lib:dble
169 (f2cl-lib:fref ap-%data%
170 ((f2cl-lib:int-sub
171 (f2cl-lib:int-add kk j)
173 ((1 *))
174 ap-%offset%))
175 'f2cl-lib:complex16))))
176 (setf kk (f2cl-lib:int-add kk j))
177 label20)))
179 (f2cl-lib:fdo (j 1 (f2cl-lib:int-add j 1))
180 ((> j n) nil)
181 (tagbody
182 (cond
183 ((or (/= (f2cl-lib:fref x (jx) ((1 *))) zero)
184 (/= (f2cl-lib:fref y (jy) ((1 *))) zero))
185 (setf temp1
186 (* alpha
187 (f2cl-lib:dconjg
188 (f2cl-lib:fref y-%data%
189 (jy)
190 ((1 *))
191 y-%offset%))))
192 (setf temp2
193 (coerce
194 (f2cl-lib:dconjg
195 (* alpha
196 (f2cl-lib:fref x-%data%
197 (jx)
198 ((1 *))
199 x-%offset%)))
200 'f2cl-lib:complex16))
201 (setf ix kx)
202 (setf iy ky)
203 (f2cl-lib:fdo (k kk (f2cl-lib:int-add k 1))
204 ((> k
205 (f2cl-lib:int-add kk
207 (f2cl-lib:int-sub 2)))
208 nil)
209 (tagbody
210 (setf (f2cl-lib:fref ap-%data%
212 ((1 *))
213 ap-%offset%)
215 (f2cl-lib:fref ap-%data%
217 ((1 *))
218 ap-%offset%)
220 (f2cl-lib:fref x-%data%
221 (ix)
222 ((1 *))
223 x-%offset%)
224 temp1)
226 (f2cl-lib:fref y-%data%
227 (iy)
228 ((1 *))
229 y-%offset%)
230 temp2)))
231 (setf ix (f2cl-lib:int-add ix incx))
232 (setf iy (f2cl-lib:int-add iy incy))
233 label30))
234 (setf (f2cl-lib:fref ap-%data%
235 ((f2cl-lib:int-sub
236 (f2cl-lib:int-add kk j)
238 ((1 *))
239 ap-%offset%)
240 (coerce
242 (f2cl-lib:dble
243 (f2cl-lib:fref ap-%data%
244 ((f2cl-lib:int-sub
245 (f2cl-lib:int-add kk j)
247 ((1 *))
248 ap-%offset%))
249 (f2cl-lib:dble
252 (f2cl-lib:fref x-%data%
253 (jx)
254 ((1 *))
255 x-%offset%)
256 temp1)
258 (f2cl-lib:fref y-%data%
259 (jy)
260 ((1 *))
261 y-%offset%)
262 temp2))))
263 'f2cl-lib:complex16)))
265 (setf (f2cl-lib:fref ap-%data%
266 ((f2cl-lib:int-sub
267 (f2cl-lib:int-add kk j)
269 ((1 *))
270 ap-%offset%)
271 (coerce
272 (f2cl-lib:dble
273 (f2cl-lib:fref ap-%data%
274 ((f2cl-lib:int-sub
275 (f2cl-lib:int-add kk j)
277 ((1 *))
278 ap-%offset%))
279 'f2cl-lib:complex16))))
280 (setf jx (f2cl-lib:int-add jx incx))
281 (setf jy (f2cl-lib:int-add jy incy))
282 (setf kk (f2cl-lib:int-add kk j))
283 label40)))))
285 (cond
286 ((and (= incx 1) (= incy 1))
287 (f2cl-lib:fdo (j 1 (f2cl-lib:int-add j 1))
288 ((> j n) nil)
289 (tagbody
290 (cond
291 ((or (/= (f2cl-lib:fref x (j) ((1 *))) zero)
292 (/= (f2cl-lib:fref y (j) ((1 *))) zero))
293 (setf temp1
294 (* alpha
295 (f2cl-lib:dconjg
296 (f2cl-lib:fref y-%data%
298 ((1 *))
299 y-%offset%))))
300 (setf temp2
301 (coerce
302 (f2cl-lib:dconjg
303 (* alpha
304 (f2cl-lib:fref x-%data%
306 ((1 *))
307 x-%offset%)))
308 'f2cl-lib:complex16))
309 (setf (f2cl-lib:fref ap-%data% (kk) ((1 *)) ap-%offset%)
310 (coerce
312 (f2cl-lib:dble
313 (f2cl-lib:fref ap-%data%
314 (kk)
315 ((1 *))
316 ap-%offset%))
317 (f2cl-lib:dble
320 (f2cl-lib:fref x-%data%
322 ((1 *))
323 x-%offset%)
324 temp1)
326 (f2cl-lib:fref y-%data%
328 ((1 *))
329 y-%offset%)
330 temp2))))
331 'f2cl-lib:complex16))
332 (setf k (f2cl-lib:int-add kk 1))
333 (f2cl-lib:fdo (i (f2cl-lib:int-add j 1)
334 (f2cl-lib:int-add i 1))
335 ((> i n) nil)
336 (tagbody
337 (setf (f2cl-lib:fref ap-%data%
339 ((1 *))
340 ap-%offset%)
342 (f2cl-lib:fref ap-%data%
344 ((1 *))
345 ap-%offset%)
347 (f2cl-lib:fref x-%data%
349 ((1 *))
350 x-%offset%)
351 temp1)
353 (f2cl-lib:fref y-%data%
355 ((1 *))
356 y-%offset%)
357 temp2)))
358 (setf k (f2cl-lib:int-add k 1))
359 label50)))
361 (setf (f2cl-lib:fref ap-%data% (kk) ((1 *)) ap-%offset%)
362 (coerce
363 (f2cl-lib:dble
364 (f2cl-lib:fref ap-%data%
365 (kk)
366 ((1 *))
367 ap-%offset%))
368 'f2cl-lib:complex16))))
369 (setf kk
370 (f2cl-lib:int-add
371 (f2cl-lib:int-sub (f2cl-lib:int-add kk n) j)
373 label60)))
375 (f2cl-lib:fdo (j 1 (f2cl-lib:int-add j 1))
376 ((> j n) nil)
377 (tagbody
378 (cond
379 ((or (/= (f2cl-lib:fref x (jx) ((1 *))) zero)
380 (/= (f2cl-lib:fref y (jy) ((1 *))) zero))
381 (setf temp1
382 (* alpha
383 (f2cl-lib:dconjg
384 (f2cl-lib:fref y-%data%
385 (jy)
386 ((1 *))
387 y-%offset%))))
388 (setf temp2
389 (coerce
390 (f2cl-lib:dconjg
391 (* alpha
392 (f2cl-lib:fref x-%data%
393 (jx)
394 ((1 *))
395 x-%offset%)))
396 'f2cl-lib:complex16))
397 (setf (f2cl-lib:fref ap-%data% (kk) ((1 *)) ap-%offset%)
398 (coerce
400 (f2cl-lib:dble
401 (f2cl-lib:fref ap-%data%
402 (kk)
403 ((1 *))
404 ap-%offset%))
405 (f2cl-lib:dble
408 (f2cl-lib:fref x-%data%
409 (jx)
410 ((1 *))
411 x-%offset%)
412 temp1)
414 (f2cl-lib:fref y-%data%
415 (jy)
416 ((1 *))
417 y-%offset%)
418 temp2))))
419 'f2cl-lib:complex16))
420 (setf ix jx)
421 (setf iy jy)
422 (f2cl-lib:fdo (k (f2cl-lib:int-add kk 1)
423 (f2cl-lib:int-add k 1))
424 ((> k
425 (f2cl-lib:int-add kk
427 (f2cl-lib:int-sub j)))
428 nil)
429 (tagbody
430 (setf ix (f2cl-lib:int-add ix incx))
431 (setf iy (f2cl-lib:int-add iy incy))
432 (setf (f2cl-lib:fref ap-%data%
434 ((1 *))
435 ap-%offset%)
437 (f2cl-lib:fref ap-%data%
439 ((1 *))
440 ap-%offset%)
442 (f2cl-lib:fref x-%data%
443 (ix)
444 ((1 *))
445 x-%offset%)
446 temp1)
448 (f2cl-lib:fref y-%data%
449 (iy)
450 ((1 *))
451 y-%offset%)
452 temp2)))
453 label70)))
455 (setf (f2cl-lib:fref ap-%data% (kk) ((1 *)) ap-%offset%)
456 (coerce
457 (f2cl-lib:dble
458 (f2cl-lib:fref ap-%data%
459 (kk)
460 ((1 *))
461 ap-%offset%))
462 'f2cl-lib:complex16))))
463 (setf jx (f2cl-lib:int-add jx incx))
464 (setf jy (f2cl-lib:int-add jy incy))
465 (setf kk
466 (f2cl-lib:int-add
467 (f2cl-lib:int-sub (f2cl-lib:int-add kk n) j)
469 label80))))))
470 (go end_label)
471 end_label
472 (return (values nil nil nil nil nil nil nil nil))))))
474 (in-package #-gcl #:cl-user #+gcl "CL-USER")
475 #+#.(cl:if (cl:find-package '#:f2cl) '(and) '(or))
476 (eval-when (:load-toplevel :compile-toplevel :execute)
477 (setf (gethash 'fortran-to-lisp::zhpr2 fortran-to-lisp::*f2cl-function-info*)
478 (fortran-to-lisp::make-f2cl-finfo
479 :arg-types '((simple-string) (fortran-to-lisp::integer4)
480 (fortran-to-lisp::complex16)
481 (array fortran-to-lisp::complex16 (*))
482 (fortran-to-lisp::integer4)
483 (array fortran-to-lisp::complex16 (*))
484 (fortran-to-lisp::integer4)
485 (array fortran-to-lisp::complex16 (*)))
486 :return-values '(nil nil nil nil nil nil nil nil)
487 :calls '(fortran-to-lisp::xerbla fortran-to-lisp::lsame))))