Added script front-end for primer-design code
[htsworkflow.git] / htswanalysis / MACS / lib / gsl / gsl-1.11 / cblas / test_hpmv.c
1 #include <gsl/gsl_test.h>
2 #include <gsl/gsl_ieee_utils.h>
3 #include <gsl/gsl_math.h>
4 #include <gsl/gsl_cblas.h>
5
6 #include "tests.h"
7
8 void
9 test_hpmv (void) {
10 const double flteps = 1e-4, dbleps = 1e-6;
11   {
12    int order = 101;
13    int uplo = 121;
14    float alpha[2] = {-0.3f, 0.1f};
15    float beta[2] = {0.0f, 1.0f};
16    int N = 2;
17    float A[] = { 0.339f, -0.102f, 0.908f, 0.097f, -0.808f, 0.236f };
18    float X[] = { 0.993f, -0.502f, -0.653f, 0.796f };
19    int incX = -1;
20    float Y[] = { -0.35f, 0.339f, -0.269f, -0.122f };
21    int incY = -1;
22    float y_expected[] = { -0.0627557f, -0.839323f, -0.0877262f, -0.169208f };
23    cblas_chpmv(order, uplo, N, alpha, A, X, incX, beta, Y, incY);
24    {
25      int i;
26      for (i = 0; i < 2; i++) {
27        gsl_test_rel(Y[2*i], y_expected[2*i], flteps, "chpmv(case 1118) real");
28        gsl_test_rel(Y[2*i+1], y_expected[2*i+1], flteps, "chpmv(case 1118) imag");
29      };
30    };
31   };
32
33
34   {
35    int order = 101;
36    int uplo = 121;
37    float alpha[2] = {-0.3f, 0.1f};
38    float beta[2] = {0.0f, 1.0f};
39    int N = 2;
40    float A[] = { 0.339f, -0.102f, 0.908f, 0.097f, -0.808f, 0.236f };
41    float X[] = { 0.993f, -0.502f, -0.653f, 0.796f };
42    int incX = -1;
43    float Y[] = { -0.35f, 0.339f, -0.269f, -0.122f };
44    int incY = -1;
45    float y_expected[] = { -0.0627557f, -0.839323f, -0.0877262f, -0.169208f };
46    cblas_chpmv(order, uplo, N, alpha, A, X, incX, beta, Y, incY);
47    {
48      int i;
49      for (i = 0; i < 2; i++) {
50        gsl_test_rel(Y[2*i], y_expected[2*i], flteps, "chpmv(case 1119) real");
51        gsl_test_rel(Y[2*i+1], y_expected[2*i+1], flteps, "chpmv(case 1119) imag");
52      };
53    };
54   };
55
56
57   {
58    int order = 101;
59    int uplo = 122;
60    float alpha[2] = {-0.3f, 0.1f};
61    float beta[2] = {0.0f, 1.0f};
62    int N = 2;
63    float A[] = { 0.339f, -0.102f, 0.908f, 0.097f, -0.808f, 0.236f };
64    float X[] = { 0.993f, -0.502f, -0.653f, 0.796f };
65    int incX = -1;
66    float Y[] = { -0.35f, 0.339f, -0.269f, -0.122f };
67    int incY = -1;
68    float y_expected[] = { -0.0037603f, -0.816761f, -0.0392456f, -0.121154f };
69    cblas_chpmv(order, uplo, N, alpha, A, X, incX, beta, Y, incY);
70    {
71      int i;
72      for (i = 0; i < 2; i++) {
73        gsl_test_rel(Y[2*i], y_expected[2*i], flteps, "chpmv(case 1120) real");
74        gsl_test_rel(Y[2*i+1], y_expected[2*i+1], flteps, "chpmv(case 1120) imag");
75      };
76    };
77   };
78
79
80   {
81    int order = 101;
82    int uplo = 122;
83    float alpha[2] = {-0.3f, 0.1f};
84    float beta[2] = {0.0f, 1.0f};
85    int N = 2;
86    float A[] = { 0.339f, -0.102f, 0.908f, 0.097f, -0.808f, 0.236f };
87    float X[] = { 0.993f, -0.502f, -0.653f, 0.796f };
88    int incX = -1;
89    float Y[] = { -0.35f, 0.339f, -0.269f, -0.122f };
90    int incY = -1;
91    float y_expected[] = { -0.0037603f, -0.816761f, -0.0392456f, -0.121154f };
92    cblas_chpmv(order, uplo, N, alpha, A, X, incX, beta, Y, incY);
93    {
94      int i;
95      for (i = 0; i < 2; i++) {
96        gsl_test_rel(Y[2*i], y_expected[2*i], flteps, "chpmv(case 1121) real");
97        gsl_test_rel(Y[2*i+1], y_expected[2*i+1], flteps, "chpmv(case 1121) imag");
98      };
99    };
100   };
101
102
103   {
104    int order = 102;
105    int uplo = 121;
106    float alpha[2] = {-0.3f, 0.1f};
107    float beta[2] = {0.0f, 1.0f};
108    int N = 2;
109    float A[] = { 0.339f, -0.102f, 0.908f, 0.097f, -0.808f, 0.236f };
110    float X[] = { 0.993f, -0.502f, -0.653f, 0.796f };
111    int incX = -1;
112    float Y[] = { -0.35f, 0.339f, -0.269f, -0.122f };
113    int incY = -1;
114    float y_expected[] = { -0.0627557f, -0.839323f, -0.0877262f, -0.169208f };
115    cblas_chpmv(order, uplo, N, alpha, A, X, incX, beta, Y, incY);
116    {
117      int i;
118      for (i = 0; i < 2; i++) {
119        gsl_test_rel(Y[2*i], y_expected[2*i], flteps, "chpmv(case 1122) real");
120        gsl_test_rel(Y[2*i+1], y_expected[2*i+1], flteps, "chpmv(case 1122) imag");
121      };
122    };
123   };
124
125
126   {
127    int order = 102;
128    int uplo = 121;
129    float alpha[2] = {-0.3f, 0.1f};
130    float beta[2] = {0.0f, 1.0f};
131    int N = 2;
132    float A[] = { 0.339f, -0.102f, 0.908f, 0.097f, -0.808f, 0.236f };
133    float X[] = { 0.993f, -0.502f, -0.653f, 0.796f };
134    int incX = -1;
135    float Y[] = { -0.35f, 0.339f, -0.269f, -0.122f };
136    int incY = -1;
137    float y_expected[] = { -0.0627557f, -0.839323f, -0.0877262f, -0.169208f };
138    cblas_chpmv(order, uplo, N, alpha, A, X, incX, beta, Y, incY);
139    {
140      int i;
141      for (i = 0; i < 2; i++) {
142        gsl_test_rel(Y[2*i], y_expected[2*i], flteps, "chpmv(case 1123) real");
143        gsl_test_rel(Y[2*i+1], y_expected[2*i+1], flteps, "chpmv(case 1123) imag");
144      };
145    };
146   };
147
148
149   {
150    int order = 102;
151    int uplo = 122;
152    float alpha[2] = {-0.3f, 0.1f};
153    float beta[2] = {0.0f, 1.0f};
154    int N = 2;
155    float A[] = { 0.339f, -0.102f, 0.908f, 0.097f, -0.808f, 0.236f };
156    float X[] = { 0.993f, -0.502f, -0.653f, 0.796f };
157    int incX = -1;
158    float Y[] = { -0.35f, 0.339f, -0.269f, -0.122f };
159    int incY = -1;
160    float y_expected[] = { -0.0037603f, -0.816761f, -0.0392456f, -0.121154f };
161    cblas_chpmv(order, uplo, N, alpha, A, X, incX, beta, Y, incY);
162    {
163      int i;
164      for (i = 0; i < 2; i++) {
165        gsl_test_rel(Y[2*i], y_expected[2*i], flteps, "chpmv(case 1124) real");
166        gsl_test_rel(Y[2*i+1], y_expected[2*i+1], flteps, "chpmv(case 1124) imag");
167      };
168    };
169   };
170
171
172   {
173    int order = 102;
174    int uplo = 122;
175    float alpha[2] = {-0.3f, 0.1f};
176    float beta[2] = {0.0f, 1.0f};
177    int N = 2;
178    float A[] = { 0.339f, -0.102f, 0.908f, 0.097f, -0.808f, 0.236f };
179    float X[] = { 0.993f, -0.502f, -0.653f, 0.796f };
180    int incX = -1;
181    float Y[] = { -0.35f, 0.339f, -0.269f, -0.122f };
182    int incY = -1;
183    float y_expected[] = { -0.0037603f, -0.816761f, -0.0392456f, -0.121154f };
184    cblas_chpmv(order, uplo, N, alpha, A, X, incX, beta, Y, incY);
185    {
186      int i;
187      for (i = 0; i < 2; i++) {
188        gsl_test_rel(Y[2*i], y_expected[2*i], flteps, "chpmv(case 1125) real");
189        gsl_test_rel(Y[2*i+1], y_expected[2*i+1], flteps, "chpmv(case 1125) imag");
190      };
191    };
192   };
193
194
195   {
196    int order = 101;
197    int uplo = 121;
198    double alpha[2] = {1, 0};
199    double beta[2] = {0, 1};
200    int N = 2;
201    double A[] = { 0.543, -0.737, 0.281, -0.053, -0.098, -0.826 };
202    double X[] = { 0.67, -0.857, -0.613, -0.927 };
203    int incX = -1;
204    double Y[] = { -0.398, -0.934, -0.204, 0.183 };
205    int incY = -1;
206    double y_expected[] = { 0.745218, -0.60699, -0.37301, -0.983688 };
207    cblas_zhpmv(order, uplo, N, alpha, A, X, incX, beta, Y, incY);
208    {
209      int i;
210      for (i = 0; i < 2; i++) {
211        gsl_test_rel(Y[2*i], y_expected[2*i], dbleps, "zhpmv(case 1126) real");
212        gsl_test_rel(Y[2*i+1], y_expected[2*i+1], dbleps, "zhpmv(case 1126) imag");
213      };
214    };
215   };
216
217
218   {
219    int order = 101;
220    int uplo = 121;
221    double alpha[2] = {1, 0};
222    double beta[2] = {0, 1};
223    int N = 2;
224    double A[] = { 0.543, -0.737, 0.281, -0.053, -0.098, -0.826 };
225    double X[] = { 0.67, -0.857, -0.613, -0.927 };
226    int incX = -1;
227    double Y[] = { -0.398, -0.934, -0.204, 0.183 };
228    int incY = -1;
229    double y_expected[] = { 0.745218, -0.60699, -0.37301, -0.983688 };
230    cblas_zhpmv(order, uplo, N, alpha, A, X, incX, beta, Y, incY);
231    {
232      int i;
233      for (i = 0; i < 2; i++) {
234        gsl_test_rel(Y[2*i], y_expected[2*i], dbleps, "zhpmv(case 1127) real");
235        gsl_test_rel(Y[2*i+1], y_expected[2*i+1], dbleps, "zhpmv(case 1127) imag");
236      };
237    };
238   };
239
240
241   {
242    int order = 101;
243    int uplo = 122;
244    double alpha[2] = {1, 0};
245    double beta[2] = {0, 1};
246    int N = 2;
247    double A[] = { 0.543, -0.737, 0.281, -0.053, -0.098, -0.826 };
248    double X[] = { 0.67, -0.857, -0.613, -0.927 };
249    int incX = -1;
250    double Y[] = { -0.398, -0.934, -0.204, 0.183 };
251    int incY = -1;
252    double y_expected[] = { 0.646956, -0.542012, -0.282168, -0.912668 };
253    cblas_zhpmv(order, uplo, N, alpha, A, X, incX, beta, Y, incY);
254    {
255      int i;
256      for (i = 0; i < 2; i++) {
257        gsl_test_rel(Y[2*i], y_expected[2*i], dbleps, "zhpmv(case 1128) real");
258        gsl_test_rel(Y[2*i+1], y_expected[2*i+1], dbleps, "zhpmv(case 1128) imag");
259      };
260    };
261   };
262
263
264   {
265    int order = 101;
266    int uplo = 122;
267    double alpha[2] = {1, 0};
268    double beta[2] = {0, 1};
269    int N = 2;
270    double A[] = { 0.543, -0.737, 0.281, -0.053, -0.098, -0.826 };
271    double X[] = { 0.67, -0.857, -0.613, -0.927 };
272    int incX = -1;
273    double Y[] = { -0.398, -0.934, -0.204, 0.183 };
274    int incY = -1;
275    double y_expected[] = { 0.646956, -0.542012, -0.282168, -0.912668 };
276    cblas_zhpmv(order, uplo, N, alpha, A, X, incX, beta, Y, incY);
277    {
278      int i;
279      for (i = 0; i < 2; i++) {
280        gsl_test_rel(Y[2*i], y_expected[2*i], dbleps, "zhpmv(case 1129) real");
281        gsl_test_rel(Y[2*i+1], y_expected[2*i+1], dbleps, "zhpmv(case 1129) imag");
282      };
283    };
284   };
285
286
287   {
288    int order = 102;
289    int uplo = 121;
290    double alpha[2] = {1, 0};
291    double beta[2] = {0, 1};
292    int N = 2;
293    double A[] = { 0.543, -0.737, 0.281, -0.053, -0.098, -0.826 };
294    double X[] = { 0.67, -0.857, -0.613, -0.927 };
295    int incX = -1;
296    double Y[] = { -0.398, -0.934, -0.204, 0.183 };
297    int incY = -1;
298    double y_expected[] = { 0.745218, -0.60699, -0.37301, -0.983688 };
299    cblas_zhpmv(order, uplo, N, alpha, A, X, incX, beta, Y, incY);
300    {
301      int i;
302      for (i = 0; i < 2; i++) {
303        gsl_test_rel(Y[2*i], y_expected[2*i], dbleps, "zhpmv(case 1130) real");
304        gsl_test_rel(Y[2*i+1], y_expected[2*i+1], dbleps, "zhpmv(case 1130) imag");
305      };
306    };
307   };
308
309
310   {
311    int order = 102;
312    int uplo = 121;
313    double alpha[2] = {1, 0};
314    double beta[2] = {0, 1};
315    int N = 2;
316    double A[] = { 0.543, -0.737, 0.281, -0.053, -0.098, -0.826 };
317    double X[] = { 0.67, -0.857, -0.613, -0.927 };
318    int incX = -1;
319    double Y[] = { -0.398, -0.934, -0.204, 0.183 };
320    int incY = -1;
321    double y_expected[] = { 0.745218, -0.60699, -0.37301, -0.983688 };
322    cblas_zhpmv(order, uplo, N, alpha, A, X, incX, beta, Y, incY);
323    {
324      int i;
325      for (i = 0; i < 2; i++) {
326        gsl_test_rel(Y[2*i], y_expected[2*i], dbleps, "zhpmv(case 1131) real");
327        gsl_test_rel(Y[2*i+1], y_expected[2*i+1], dbleps, "zhpmv(case 1131) imag");
328      };
329    };
330   };
331
332
333   {
334    int order = 102;
335    int uplo = 122;
336    double alpha[2] = {1, 0};
337    double beta[2] = {0, 1};
338    int N = 2;
339    double A[] = { 0.543, -0.737, 0.281, -0.053, -0.098, -0.826 };
340    double X[] = { 0.67, -0.857, -0.613, -0.927 };
341    int incX = -1;
342    double Y[] = { -0.398, -0.934, -0.204, 0.183 };
343    int incY = -1;
344    double y_expected[] = { 0.646956, -0.542012, -0.282168, -0.912668 };
345    cblas_zhpmv(order, uplo, N, alpha, A, X, incX, beta, Y, incY);
346    {
347      int i;
348      for (i = 0; i < 2; i++) {
349        gsl_test_rel(Y[2*i], y_expected[2*i], dbleps, "zhpmv(case 1132) real");
350        gsl_test_rel(Y[2*i+1], y_expected[2*i+1], dbleps, "zhpmv(case 1132) imag");
351      };
352    };
353   };
354
355
356   {
357    int order = 102;
358    int uplo = 122;
359    double alpha[2] = {1, 0};
360    double beta[2] = {0, 1};
361    int N = 2;
362    double A[] = { 0.543, -0.737, 0.281, -0.053, -0.098, -0.826 };
363    double X[] = { 0.67, -0.857, -0.613, -0.927 };
364    int incX = -1;
365    double Y[] = { -0.398, -0.934, -0.204, 0.183 };
366    int incY = -1;
367    double y_expected[] = { 0.646956, -0.542012, -0.282168, -0.912668 };
368    cblas_zhpmv(order, uplo, N, alpha, A, X, incX, beta, Y, incY);
369    {
370      int i;
371      for (i = 0; i < 2; i++) {
372        gsl_test_rel(Y[2*i], y_expected[2*i], dbleps, "zhpmv(case 1133) real");
373        gsl_test_rel(Y[2*i+1], y_expected[2*i+1], dbleps, "zhpmv(case 1133) imag");
374      };
375    };
376   };
377
378
379 }