Add some basic letsimp tests based on bug #3950
[maxima.git] / share / lapack / blas / zhpmv.lisp
blob94396d3dba0c2404262b115d3847f2554698f638
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* ((one (f2cl-lib:cmplx 1.0 0.0)) (zero (f2cl-lib:cmplx 0.0 0.0)))
21 (declare (type (f2cl-lib:complex16) one)
22 (type (f2cl-lib:complex16) zero)
23 (ignorable one zero))
24 (defun zhpmv (uplo n alpha ap x incx beta y incy)
25 (declare (type (array f2cl-lib:complex16 (*)) y x ap)
26 (type (f2cl-lib:complex16) beta alpha)
27 (type (f2cl-lib:integer4) incy incx n)
28 (type (simple-string *) uplo))
29 (f2cl-lib:with-multi-array-data
30 ((uplo character uplo-%data% uplo-%offset%)
31 (ap f2cl-lib:complex16 ap-%data% ap-%offset%)
32 (x f2cl-lib:complex16 x-%data% x-%offset%)
33 (y f2cl-lib:complex16 y-%data% y-%offset%))
34 (prog ((i 0) (info 0) (ix 0) (iy 0) (j 0) (jx 0) (jy 0) (k 0) (kk 0)
35 (kx 0) (ky 0) (temp1 #C(0.0 0.0)) (temp2 #C(0.0 0.0)))
36 (declare (type (f2cl-lib:integer4) i info ix iy j jx jy k kk kx ky)
37 (type (f2cl-lib:complex16) temp1 temp2))
38 (setf info 0)
39 (cond
40 ((and (not (lsame uplo "U")) (not (lsame uplo "L")))
41 (setf info 1))
42 ((< n 0)
43 (setf info 2))
44 ((= incx 0)
45 (setf info 6))
46 ((= incy 0)
47 (setf info 9)))
48 (cond
49 ((/= info 0)
50 (xerbla "ZHPMV " info)
51 (go end_label)))
52 (if (or (= n 0) (and (= alpha zero) (= beta one))) (go end_label))
53 (cond
54 ((> incx 0)
55 (setf kx 1))
57 (setf kx
58 (f2cl-lib:int-sub 1
59 (f2cl-lib:int-mul (f2cl-lib:int-sub n 1)
60 incx)))))
61 (cond
62 ((> incy 0)
63 (setf ky 1))
65 (setf ky
66 (f2cl-lib:int-sub 1
67 (f2cl-lib:int-mul (f2cl-lib:int-sub n 1)
68 incy)))))
69 (cond
70 ((/= beta one)
71 (cond
72 ((= incy 1)
73 (cond
74 ((= beta zero)
75 (f2cl-lib:fdo (i 1 (f2cl-lib:int-add i 1))
76 ((> i n) nil)
77 (tagbody
78 (setf (f2cl-lib:fref y-%data% (i) ((1 *)) y-%offset%)
79 zero)
80 label10)))
82 (f2cl-lib:fdo (i 1 (f2cl-lib:int-add i 1))
83 ((> i n) nil)
84 (tagbody
85 (setf (f2cl-lib:fref y-%data% (i) ((1 *)) y-%offset%)
86 (* beta
87 (f2cl-lib:fref y-%data%
88 (i)
89 ((1 *))
90 y-%offset%)))
91 label20)))))
93 (setf iy ky)
94 (cond
95 ((= beta zero)
96 (f2cl-lib:fdo (i 1 (f2cl-lib:int-add i 1))
97 ((> i n) nil)
98 (tagbody
99 (setf (f2cl-lib:fref y-%data% (iy) ((1 *)) y-%offset%)
100 zero)
101 (setf iy (f2cl-lib:int-add iy incy))
102 label30)))
104 (f2cl-lib:fdo (i 1 (f2cl-lib:int-add i 1))
105 ((> i n) nil)
106 (tagbody
107 (setf (f2cl-lib:fref y-%data% (iy) ((1 *)) y-%offset%)
108 (* beta
109 (f2cl-lib:fref y-%data%
110 (iy)
111 ((1 *))
112 y-%offset%)))
113 (setf iy (f2cl-lib:int-add iy incy))
114 label40))))))))
115 (if (= alpha zero) (go end_label))
116 (setf kk 1)
117 (cond
118 ((lsame uplo "U")
119 (cond
120 ((and (= incx 1) (= incy 1))
121 (f2cl-lib:fdo (j 1 (f2cl-lib:int-add j 1))
122 ((> j n) nil)
123 (tagbody
124 (setf temp1
125 (* alpha
126 (f2cl-lib:fref x-%data% (j) ((1 *)) x-%offset%)))
127 (setf temp2 zero)
128 (setf k kk)
129 (f2cl-lib:fdo (i 1 (f2cl-lib:int-add i 1))
130 ((> i
131 (f2cl-lib:int-add j (f2cl-lib:int-sub 1)))
132 nil)
133 (tagbody
134 (setf (f2cl-lib:fref y-%data% (i) ((1 *)) y-%offset%)
136 (f2cl-lib:fref y-%data% (i) ((1 *)) y-%offset%)
137 (* temp1
138 (f2cl-lib:fref ap-%data%
140 ((1 *))
141 ap-%offset%))))
142 (setf temp2
143 (+ temp2
145 (f2cl-lib:dconjg
146 (f2cl-lib:fref ap-%data%
148 ((1 *))
149 ap-%offset%))
150 (f2cl-lib:fref x-%data%
152 ((1 *))
153 x-%offset%))))
154 (setf k (f2cl-lib:int-add k 1))
155 label50))
156 (setf (f2cl-lib:fref y-%data% (j) ((1 *)) y-%offset%)
157 (+ (f2cl-lib:fref y-%data% (j) ((1 *)) y-%offset%)
158 (* temp1
159 (f2cl-lib:dble
160 (f2cl-lib:fref ap-%data%
161 ((f2cl-lib:int-sub
162 (f2cl-lib:int-add kk j)
164 ((1 *))
165 ap-%offset%)))
166 (* alpha temp2)))
167 (setf kk (f2cl-lib:int-add kk j))
168 label60)))
170 (setf jx kx)
171 (setf jy ky)
172 (f2cl-lib:fdo (j 1 (f2cl-lib:int-add j 1))
173 ((> j n) nil)
174 (tagbody
175 (setf temp1
176 (* alpha
177 (f2cl-lib:fref x-%data% (jx) ((1 *)) x-%offset%)))
178 (setf temp2 zero)
179 (setf ix kx)
180 (setf iy ky)
181 (f2cl-lib:fdo (k kk (f2cl-lib:int-add k 1))
182 ((> k
183 (f2cl-lib:int-add kk
185 (f2cl-lib:int-sub 2)))
186 nil)
187 (tagbody
188 (setf (f2cl-lib:fref y-%data% (iy) ((1 *)) y-%offset%)
190 (f2cl-lib:fref y-%data% (iy) ((1 *)) y-%offset%)
191 (* temp1
192 (f2cl-lib:fref ap-%data%
194 ((1 *))
195 ap-%offset%))))
196 (setf temp2
197 (+ temp2
199 (f2cl-lib:dconjg
200 (f2cl-lib:fref ap-%data%
202 ((1 *))
203 ap-%offset%))
204 (f2cl-lib:fref x-%data%
205 (ix)
206 ((1 *))
207 x-%offset%))))
208 (setf ix (f2cl-lib:int-add ix incx))
209 (setf iy (f2cl-lib:int-add iy incy))
210 label70))
211 (setf (f2cl-lib:fref y-%data% (jy) ((1 *)) y-%offset%)
212 (+ (f2cl-lib:fref y-%data% (jy) ((1 *)) y-%offset%)
213 (* temp1
214 (f2cl-lib:dble
215 (f2cl-lib:fref ap-%data%
216 ((f2cl-lib:int-sub
217 (f2cl-lib:int-add kk j)
219 ((1 *))
220 ap-%offset%)))
221 (* alpha temp2)))
222 (setf jx (f2cl-lib:int-add jx incx))
223 (setf jy (f2cl-lib:int-add jy incy))
224 (setf kk (f2cl-lib:int-add kk j))
225 label80)))))
227 (cond
228 ((and (= incx 1) (= incy 1))
229 (f2cl-lib:fdo (j 1 (f2cl-lib:int-add j 1))
230 ((> j n) nil)
231 (tagbody
232 (setf temp1
233 (* alpha
234 (f2cl-lib:fref x-%data% (j) ((1 *)) x-%offset%)))
235 (setf temp2 zero)
236 (setf (f2cl-lib:fref y-%data% (j) ((1 *)) y-%offset%)
237 (+ (f2cl-lib:fref y-%data% (j) ((1 *)) y-%offset%)
238 (* temp1
239 (f2cl-lib:dble
240 (f2cl-lib:fref ap-%data%
241 (kk)
242 ((1 *))
243 ap-%offset%)))))
244 (setf k (f2cl-lib:int-add kk 1))
245 (f2cl-lib:fdo (i (f2cl-lib:int-add j 1)
246 (f2cl-lib:int-add i 1))
247 ((> i n) nil)
248 (tagbody
249 (setf (f2cl-lib:fref y-%data% (i) ((1 *)) y-%offset%)
251 (f2cl-lib:fref y-%data% (i) ((1 *)) y-%offset%)
252 (* temp1
253 (f2cl-lib:fref ap-%data%
255 ((1 *))
256 ap-%offset%))))
257 (setf temp2
258 (+ temp2
260 (f2cl-lib:dconjg
261 (f2cl-lib:fref ap-%data%
263 ((1 *))
264 ap-%offset%))
265 (f2cl-lib:fref x-%data%
267 ((1 *))
268 x-%offset%))))
269 (setf k (f2cl-lib:int-add k 1))
270 label90))
271 (setf (f2cl-lib:fref y-%data% (j) ((1 *)) y-%offset%)
272 (+ (f2cl-lib:fref y-%data% (j) ((1 *)) y-%offset%)
273 (* alpha temp2)))
274 (setf kk
275 (f2cl-lib:int-add kk
276 (f2cl-lib:int-add
277 (f2cl-lib:int-sub n j)
278 1)))
279 label100)))
281 (setf jx kx)
282 (setf jy ky)
283 (f2cl-lib:fdo (j 1 (f2cl-lib:int-add j 1))
284 ((> j n) nil)
285 (tagbody
286 (setf temp1
287 (* alpha
288 (f2cl-lib:fref x-%data% (jx) ((1 *)) x-%offset%)))
289 (setf temp2 zero)
290 (setf (f2cl-lib:fref y-%data% (jy) ((1 *)) y-%offset%)
291 (+ (f2cl-lib:fref y-%data% (jy) ((1 *)) y-%offset%)
292 (* temp1
293 (f2cl-lib:dble
294 (f2cl-lib:fref ap-%data%
295 (kk)
296 ((1 *))
297 ap-%offset%)))))
298 (setf ix jx)
299 (setf iy jy)
300 (f2cl-lib:fdo (k (f2cl-lib:int-add kk 1)
301 (f2cl-lib:int-add k 1))
302 ((> k
303 (f2cl-lib:int-add kk
305 (f2cl-lib:int-sub j)))
306 nil)
307 (tagbody
308 (setf ix (f2cl-lib:int-add ix incx))
309 (setf iy (f2cl-lib:int-add iy incy))
310 (setf (f2cl-lib:fref y-%data% (iy) ((1 *)) y-%offset%)
312 (f2cl-lib:fref y-%data% (iy) ((1 *)) y-%offset%)
313 (* temp1
314 (f2cl-lib:fref ap-%data%
316 ((1 *))
317 ap-%offset%))))
318 (setf temp2
319 (+ temp2
321 (f2cl-lib:dconjg
322 (f2cl-lib:fref ap-%data%
324 ((1 *))
325 ap-%offset%))
326 (f2cl-lib:fref x-%data%
327 (ix)
328 ((1 *))
329 x-%offset%))))
330 label110))
331 (setf (f2cl-lib:fref y-%data% (jy) ((1 *)) y-%offset%)
332 (+ (f2cl-lib:fref y-%data% (jy) ((1 *)) y-%offset%)
333 (* alpha temp2)))
334 (setf jx (f2cl-lib:int-add jx incx))
335 (setf jy (f2cl-lib:int-add jy incy))
336 (setf kk
337 (f2cl-lib:int-add kk
338 (f2cl-lib:int-add
339 (f2cl-lib:int-sub n j)
340 1)))
341 label120))))))
342 (go end_label)
343 end_label
344 (return (values nil nil nil nil nil nil nil nil nil))))))
346 (in-package #-gcl #:cl-user #+gcl "CL-USER")
347 #+#.(cl:if (cl:find-package '#:f2cl) '(and) '(or))
348 (eval-when (:load-toplevel :compile-toplevel :execute)
349 (setf (gethash 'fortran-to-lisp::zhpmv fortran-to-lisp::*f2cl-function-info*)
350 (fortran-to-lisp::make-f2cl-finfo
351 :arg-types '((simple-string) (fortran-to-lisp::integer4)
352 (fortran-to-lisp::complex16)
353 (array fortran-to-lisp::complex16 (*))
354 (array fortran-to-lisp::complex16 (*))
355 (fortran-to-lisp::integer4)
356 (fortran-to-lisp::complex16)
357 (array fortran-to-lisp::complex16 (*))
358 (fortran-to-lisp::integer4))
359 :return-values '(nil nil nil nil nil nil nil nil nil)
360 :calls '(fortran-to-lisp::xerbla fortran-to-lisp::lsame))))