1 #include <stdio.h>
2 #include <stdlib.h>
3 #include "blas_extended.h"
4 #include "blas_extended_test.h"
5 
BLAS_sspmv_testgen(int norm,enum blas_order_type order,enum blas_uplo_type uplo,int n,int randomize,float * alpha,int alpha_flag,float * beta,int beta_flag,float * a,float * x,int incx,float * y,int incy,int * seed,double * r_true_l,double * r_true_t)6 void BLAS_sspmv_testgen(int norm, enum blas_order_type order,
7 			enum blas_uplo_type uplo, int n, int randomize,
8 			float *alpha, int alpha_flag, float *beta,
9 			int beta_flag, float *a, float *x, int incx, float *y,
10 			int incy, int *seed, double *r_true_l,
11 			double *r_true_t)
12 
13 /*
14  * Purpose
15  * =======
16  *
17  *   Generates the test inputs to BLAS_sspmv{_x}
18  *
19  * Arguments
20  * =========
21  *
22  * norm    (input) int
23  *           = -1: the vectors are scaled with norms near underflow.
24  *           =  0: the vectors have norms of order 1.
25  *           =  1: the vectors are scaled with norms near overflow.
26  *
27  * order   (input) enum blas_order_type
28  *           storage format of the matrices
29  *
30  * uplo    (input) enum blas_uplo_type
31  *           which half of the symmetric matrix a is to be stored.
32  *
33  * n       (input) int
34  *           sizes of symmetrical matrix a, size of vectors x, y:
35  *              matrix a is n-by-n.
36  *
37  * randomize (input) int
38  *           if 0, entries in matrices A, x will be chosen for
39  *              maximum cancellation, but with less randomness.
40  *           if 1, every entry in the matrix A, x will be
41  *              random.
42  *
43  * alpha   (input/output) float*
44  *           if alpha_flag = 1, alpha is input.
45  *           if alpha_flag = 0, alpha is output.
46  *
47  * alpha_flag (input) int
48  *           = 0: alpha is free, and is output.
49  *           = 1: alpha is fixed on input.
50  *
51  * beta    (input/output) float*
52  *           if beta_flag = 1, beta is input.
53  *           if beta_flag = 0, beta is output.
54  *
55  * beta_flag (input) int
56  *           = 0: beta is free, and is output.
57  *           = 1: beta is fixed on input.
58  *
59  * a       (input/output) float* The Packed Symmetric Matrix
60  *
61  *
62  * x       (input/output) float*
63  *
64  * incx    (input) int
65  *         stride of vector x.
66  *
67  * y       (input/output) float*
68  *         generated vector y that will be used as an input to SPMV.
69  *
70  * incy    (input) int
71  *         leading dimension of vector y.
72  *
73  * seed    (input/output) int *
74  *         seed for the random number generator.
75  *
76  * r_true_l  (output) double *
77  *         the leading part of the truth in double-double.
78  *
79  * r_true_t  (output) double *
80  *         the trailing part of the truth in double-double
81  *
82  */
83 {
84   {
85 
86     /* Strategy:
87 
88        Use the SYMV generator, then simply pack the
89        output.
90      */
91 
92     float *a_full;
93     a_full = (float *) blas_malloc(n * n * sizeof(float));
94     if (n * n > 0 && a_full == NULL) {
95       BLAS_error("blas_malloc", 0, 0, "malloc failed.\n");
96     }
97 
98     BLAS_ssymv_testgen(norm, order, uplo,
99 		       n, randomize, alpha, alpha_flag, beta, beta_flag,
100 		       a_full, n /* lda */ , x, incx, y, incy,
101 		       seed, r_true_l, r_true_t);
102     sspmv_pack_matrix(order, uplo, n, a, a_full, n /*lda */ );
103 
104     blas_free(a_full);
105   }
106 }				/* end BLAS_sspmv_testgen */
BLAS_dspmv_testgen(int norm,enum blas_order_type order,enum blas_uplo_type uplo,int n,int randomize,double * alpha,int alpha_flag,double * beta,int beta_flag,double * a,double * x,int incx,double * y,int incy,int * seed,double * r_true_l,double * r_true_t)107 void BLAS_dspmv_testgen(int norm, enum blas_order_type order,
108 			enum blas_uplo_type uplo, int n, int randomize,
109 			double *alpha, int alpha_flag, double *beta,
110 			int beta_flag, double *a, double *x, int incx,
111 			double *y, int incy, int *seed, double *r_true_l,
112 			double *r_true_t)
113 
114 /*
115  * Purpose
116  * =======
117  *
118  *   Generates the test inputs to BLAS_dspmv{_x}
119  *
120  * Arguments
121  * =========
122  *
123  * norm    (input) int
124  *           = -1: the vectors are scaled with norms near underflow.
125  *           =  0: the vectors have norms of order 1.
126  *           =  1: the vectors are scaled with norms near overflow.
127  *
128  * order   (input) enum blas_order_type
129  *           storage format of the matrices
130  *
131  * uplo    (input) enum blas_uplo_type
132  *           which half of the symmetric matrix a is to be stored.
133  *
134  * n       (input) int
135  *           sizes of symmetrical matrix a, size of vectors x, y:
136  *              matrix a is n-by-n.
137  *
138  * randomize (input) int
139  *           if 0, entries in matrices A, x will be chosen for
140  *              maximum cancellation, but with less randomness.
141  *           if 1, every entry in the matrix A, x will be
142  *              random.
143  *
144  * alpha   (input/output) double*
145  *           if alpha_flag = 1, alpha is input.
146  *           if alpha_flag = 0, alpha is output.
147  *
148  * alpha_flag (input) int
149  *           = 0: alpha is free, and is output.
150  *           = 1: alpha is fixed on input.
151  *
152  * beta    (input/output) double*
153  *           if beta_flag = 1, beta is input.
154  *           if beta_flag = 0, beta is output.
155  *
156  * beta_flag (input) int
157  *           = 0: beta is free, and is output.
158  *           = 1: beta is fixed on input.
159  *
160  * a       (input/output) double* The Packed Symmetric Matrix
161  *
162  *
163  * x       (input/output) double*
164  *
165  * incx    (input) int
166  *         stride of vector x.
167  *
168  * y       (input/output) double*
169  *         generated vector y that will be used as an input to SPMV.
170  *
171  * incy    (input) int
172  *         leading dimension of vector y.
173  *
174  * seed    (input/output) int *
175  *         seed for the random number generator.
176  *
177  * r_true_l  (output) double *
178  *         the leading part of the truth in double-double.
179  *
180  * r_true_t  (output) double *
181  *         the trailing part of the truth in double-double
182  *
183  */
184 {
185   {
186 
187     /* Strategy:
188 
189        Use the SYMV generator, then simply pack the
190        output.
191      */
192 
193     double *a_full;
194     a_full = (double *) blas_malloc(n * n * sizeof(double));
195     if (n * n > 0 && a_full == NULL) {
196       BLAS_error("blas_malloc", 0, 0, "malloc failed.\n");
197     }
198 
199     BLAS_dsymv_testgen(norm, order, uplo,
200 		       n, randomize, alpha, alpha_flag, beta, beta_flag,
201 		       a_full, n /* lda */ , x, incx, y, incy,
202 		       seed, r_true_l, r_true_t);
203     dspmv_pack_matrix(order, uplo, n, a, a_full, n /*lda */ );
204 
205     blas_free(a_full);
206   }
207 }				/* end BLAS_dspmv_testgen */
BLAS_cspmv_testgen(int norm,enum blas_order_type order,enum blas_uplo_type uplo,int n,int randomize,void * alpha,int alpha_flag,void * beta,int beta_flag,void * a,void * x,int incx,void * y,int incy,int * seed,double * r_true_l,double * r_true_t)208 void BLAS_cspmv_testgen(int norm, enum blas_order_type order,
209 			enum blas_uplo_type uplo, int n, int randomize,
210 			void *alpha, int alpha_flag, void *beta,
211 			int beta_flag, void *a, void *x, int incx, void *y,
212 			int incy, int *seed, double *r_true_l,
213 			double *r_true_t)
214 
215 /*
216  * Purpose
217  * =======
218  *
219  *   Generates the test inputs to BLAS_cspmv{_x}
220  *
221  * Arguments
222  * =========
223  *
224  * norm    (input) int
225  *           = -1: the vectors are scaled with norms near underflow.
226  *           =  0: the vectors have norms of order 1.
227  *           =  1: the vectors are scaled with norms near overflow.
228  *
229  * order   (input) enum blas_order_type
230  *           storage format of the matrices
231  *
232  * uplo    (input) enum blas_uplo_type
233  *           which half of the symmetric matrix a is to be stored.
234  *
235  * n       (input) int
236  *           sizes of symmetrical matrix a, size of vectors x, y:
237  *              matrix a is n-by-n.
238  *
239  * randomize (input) int
240  *           if 0, entries in matrices A, x will be chosen for
241  *              maximum cancellation, but with less randomness.
242  *           if 1, every entry in the matrix A, x will be
243  *              random.
244  *
245  * alpha   (input/output) void*
246  *           if alpha_flag = 1, alpha is input.
247  *           if alpha_flag = 0, alpha is output.
248  *
249  * alpha_flag (input) int
250  *           = 0: alpha is free, and is output.
251  *           = 1: alpha is fixed on input.
252  *
253  * beta    (input/output) void*
254  *           if beta_flag = 1, beta is input.
255  *           if beta_flag = 0, beta is output.
256  *
257  * beta_flag (input) int
258  *           = 0: beta is free, and is output.
259  *           = 1: beta is fixed on input.
260  *
261  * a       (input/output) void* The Packed Symmetric Matrix
262  *
263  *
264  * x       (input/output) void*
265  *
266  * incx    (input) int
267  *         stride of vector x.
268  *
269  * y       (input/output) void*
270  *         generated vector y that will be used as an input to SPMV.
271  *
272  * incy    (input) int
273  *         leading dimension of vector y.
274  *
275  * seed    (input/output) int *
276  *         seed for the random number generator.
277  *
278  * r_true_l  (output) double *
279  *         the leading part of the truth in double-double.
280  *
281  * r_true_t  (output) double *
282  *         the trailing part of the truth in double-double
283  *
284  */
285 {
286   {
287 
288     /* Strategy:
289 
290        Use the SYMV generator, then simply pack the
291        output.
292      */
293 
294     float *a_full;
295     a_full = (float *) blas_malloc(n * n * sizeof(float) * 2);
296     if (n * n > 0 && a_full == NULL) {
297       BLAS_error("blas_malloc", 0, 0, "malloc failed.\n");
298     }
299 
300     BLAS_csymv_testgen(norm, order, uplo,
301 		       n, randomize, alpha, alpha_flag, beta, beta_flag,
302 		       a_full, n /* lda */ , x, incx, y, incy,
303 		       seed, r_true_l, r_true_t);
304     cspmv_pack_matrix(order, uplo, n, a, a_full, n /*lda */ );
305 
306     blas_free(a_full);
307   }
308 }				/* end BLAS_cspmv_testgen */
BLAS_zspmv_testgen(int norm,enum blas_order_type order,enum blas_uplo_type uplo,int n,int randomize,void * alpha,int alpha_flag,void * beta,int beta_flag,void * a,void * x,int incx,void * y,int incy,int * seed,double * r_true_l,double * r_true_t)309 void BLAS_zspmv_testgen(int norm, enum blas_order_type order,
310 			enum blas_uplo_type uplo, int n, int randomize,
311 			void *alpha, int alpha_flag, void *beta,
312 			int beta_flag, void *a, void *x, int incx, void *y,
313 			int incy, int *seed, double *r_true_l,
314 			double *r_true_t)
315 
316 /*
317  * Purpose
318  * =======
319  *
320  *   Generates the test inputs to BLAS_zspmv{_x}
321  *
322  * Arguments
323  * =========
324  *
325  * norm    (input) int
326  *           = -1: the vectors are scaled with norms near underflow.
327  *           =  0: the vectors have norms of order 1.
328  *           =  1: the vectors are scaled with norms near overflow.
329  *
330  * order   (input) enum blas_order_type
331  *           storage format of the matrices
332  *
333  * uplo    (input) enum blas_uplo_type
334  *           which half of the symmetric matrix a is to be stored.
335  *
336  * n       (input) int
337  *           sizes of symmetrical matrix a, size of vectors x, y:
338  *              matrix a is n-by-n.
339  *
340  * randomize (input) int
341  *           if 0, entries in matrices A, x will be chosen for
342  *              maximum cancellation, but with less randomness.
343  *           if 1, every entry in the matrix A, x will be
344  *              random.
345  *
346  * alpha   (input/output) void*
347  *           if alpha_flag = 1, alpha is input.
348  *           if alpha_flag = 0, alpha is output.
349  *
350  * alpha_flag (input) int
351  *           = 0: alpha is free, and is output.
352  *           = 1: alpha is fixed on input.
353  *
354  * beta    (input/output) void*
355  *           if beta_flag = 1, beta is input.
356  *           if beta_flag = 0, beta is output.
357  *
358  * beta_flag (input) int
359  *           = 0: beta is free, and is output.
360  *           = 1: beta is fixed on input.
361  *
362  * a       (input/output) void* The Packed Symmetric Matrix
363  *
364  *
365  * x       (input/output) void*
366  *
367  * incx    (input) int
368  *         stride of vector x.
369  *
370  * y       (input/output) void*
371  *         generated vector y that will be used as an input to SPMV.
372  *
373  * incy    (input) int
374  *         leading dimension of vector y.
375  *
376  * seed    (input/output) int *
377  *         seed for the random number generator.
378  *
379  * r_true_l  (output) double *
380  *         the leading part of the truth in double-double.
381  *
382  * r_true_t  (output) double *
383  *         the trailing part of the truth in double-double
384  *
385  */
386 {
387   {
388 
389     /* Strategy:
390 
391        Use the SYMV generator, then simply pack the
392        output.
393      */
394 
395     double *a_full;
396     a_full = (double *) blas_malloc(n * n * sizeof(double) * 2);
397     if (n * n > 0 && a_full == NULL) {
398       BLAS_error("blas_malloc", 0, 0, "malloc failed.\n");
399     }
400 
401     BLAS_zsymv_testgen(norm, order, uplo,
402 		       n, randomize, alpha, alpha_flag, beta, beta_flag,
403 		       a_full, n /* lda */ , x, incx, y, incy,
404 		       seed, r_true_l, r_true_t);
405     zspmv_pack_matrix(order, uplo, n, a, a_full, n /*lda */ );
406 
407     blas_free(a_full);
408   }
409 }				/* end BLAS_zspmv_testgen */
BLAS_cspmv_s_s_testgen(int norm,enum blas_order_type order,enum blas_uplo_type uplo,int n,int randomize,void * alpha,int alpha_flag,void * beta,int beta_flag,float * a,float * x,int incx,void * y,int incy,int * seed,double * r_true_l,double * r_true_t)410 void BLAS_cspmv_s_s_testgen(int norm, enum blas_order_type order,
411 			    enum blas_uplo_type uplo, int n, int randomize,
412 			    void *alpha, int alpha_flag, void *beta,
413 			    int beta_flag, float *a, float *x, int incx,
414 			    void *y, int incy, int *seed, double *r_true_l,
415 			    double *r_true_t)
416 
417 /*
418  * Purpose
419  * =======
420  *
421  *   Generates the test inputs to BLAS_cspmv_s_s{_x}
422  *
423  * Arguments
424  * =========
425  *
426  * norm    (input) int
427  *           = -1: the vectors are scaled with norms near underflow.
428  *           =  0: the vectors have norms of order 1.
429  *           =  1: the vectors are scaled with norms near overflow.
430  *
431  * order   (input) enum blas_order_type
432  *           storage format of the matrices
433  *
434  * uplo    (input) enum blas_uplo_type
435  *           which half of the symmetric matrix a is to be stored.
436  *
437  * n       (input) int
438  *           sizes of symmetrical matrix a, size of vectors x, y:
439  *              matrix a is n-by-n.
440  *
441  * randomize (input) int
442  *           if 0, entries in matrices A, x will be chosen for
443  *              maximum cancellation, but with less randomness.
444  *           if 1, every entry in the matrix A, x will be
445  *              random.
446  *
447  * alpha   (input/output) void*
448  *           if alpha_flag = 1, alpha is input.
449  *           if alpha_flag = 0, alpha is output.
450  *
451  * alpha_flag (input) int
452  *           = 0: alpha is free, and is output.
453  *           = 1: alpha is fixed on input.
454  *
455  * beta    (input/output) void*
456  *           if beta_flag = 1, beta is input.
457  *           if beta_flag = 0, beta is output.
458  *
459  * beta_flag (input) int
460  *           = 0: beta is free, and is output.
461  *           = 1: beta is fixed on input.
462  *
463  * a       (input/output) float* The Packed Symmetric Matrix
464  *
465  *
466  * x       (input/output) float*
467  *
468  * incx    (input) int
469  *         stride of vector x.
470  *
471  * y       (input/output) void*
472  *         generated vector y that will be used as an input to SPMV.
473  *
474  * incy    (input) int
475  *         leading dimension of vector y.
476  *
477  * seed    (input/output) int *
478  *         seed for the random number generator.
479  *
480  * r_true_l  (output) double *
481  *         the leading part of the truth in double-double.
482  *
483  * r_true_t  (output) double *
484  *         the trailing part of the truth in double-double
485  *
486  */
487 {
488   {
489 
490     /* Strategy:
491 
492        Use the SYMV generator, then simply pack the
493        output.
494      */
495 
496     float *a_full;
497     a_full = (float *) blas_malloc(n * n * sizeof(float));
498     if (n * n > 0 && a_full == NULL) {
499       BLAS_error("blas_malloc", 0, 0, "malloc failed.\n");
500     }
501 
502     BLAS_csymv_s_s_testgen(norm, order, uplo,
503 			   n, randomize, alpha, alpha_flag, beta, beta_flag,
504 			   a_full, n /* lda */ , x, incx, y, incy,
505 			   seed, r_true_l, r_true_t);
506     sspmv_pack_matrix(order, uplo, n, a, a_full, n /*lda */ );
507 
508     blas_free(a_full);
509   }
510 }				/* end BLAS_cspmv_s_s_testgen */
BLAS_cspmv_s_c_testgen(int norm,enum blas_order_type order,enum blas_uplo_type uplo,int n,int randomize,void * alpha,int alpha_flag,void * beta,int beta_flag,float * a,void * x,int incx,void * y,int incy,int * seed,double * r_true_l,double * r_true_t)511 void BLAS_cspmv_s_c_testgen(int norm, enum blas_order_type order,
512 			    enum blas_uplo_type uplo, int n, int randomize,
513 			    void *alpha, int alpha_flag, void *beta,
514 			    int beta_flag, float *a, void *x, int incx,
515 			    void *y, int incy, int *seed, double *r_true_l,
516 			    double *r_true_t)
517 
518 /*
519  * Purpose
520  * =======
521  *
522  *   Generates the test inputs to BLAS_cspmv_s_c{_x}
523  *
524  * Arguments
525  * =========
526  *
527  * norm    (input) int
528  *           = -1: the vectors are scaled with norms near underflow.
529  *           =  0: the vectors have norms of order 1.
530  *           =  1: the vectors are scaled with norms near overflow.
531  *
532  * order   (input) enum blas_order_type
533  *           storage format of the matrices
534  *
535  * uplo    (input) enum blas_uplo_type
536  *           which half of the symmetric matrix a is to be stored.
537  *
538  * n       (input) int
539  *           sizes of symmetrical matrix a, size of vectors x, y:
540  *              matrix a is n-by-n.
541  *
542  * randomize (input) int
543  *           if 0, entries in matrices A, x will be chosen for
544  *              maximum cancellation, but with less randomness.
545  *           if 1, every entry in the matrix A, x will be
546  *              random.
547  *
548  * alpha   (input/output) void*
549  *           if alpha_flag = 1, alpha is input.
550  *           if alpha_flag = 0, alpha is output.
551  *
552  * alpha_flag (input) int
553  *           = 0: alpha is free, and is output.
554  *           = 1: alpha is fixed on input.
555  *
556  * beta    (input/output) void*
557  *           if beta_flag = 1, beta is input.
558  *           if beta_flag = 0, beta is output.
559  *
560  * beta_flag (input) int
561  *           = 0: beta is free, and is output.
562  *           = 1: beta is fixed on input.
563  *
564  * a       (input/output) float* The Packed Symmetric Matrix
565  *
566  *
567  * x       (input/output) void*
568  *
569  * incx    (input) int
570  *         stride of vector x.
571  *
572  * y       (input/output) void*
573  *         generated vector y that will be used as an input to SPMV.
574  *
575  * incy    (input) int
576  *         leading dimension of vector y.
577  *
578  * seed    (input/output) int *
579  *         seed for the random number generator.
580  *
581  * r_true_l  (output) double *
582  *         the leading part of the truth in double-double.
583  *
584  * r_true_t  (output) double *
585  *         the trailing part of the truth in double-double
586  *
587  */
588 {
589   {
590 
591     /* Strategy:
592 
593        Use the SYMV generator, then simply pack the
594        output.
595      */
596 
597     float *a_full;
598     a_full = (float *) blas_malloc(n * n * sizeof(float));
599     if (n * n > 0 && a_full == NULL) {
600       BLAS_error("blas_malloc", 0, 0, "malloc failed.\n");
601     }
602 
603     BLAS_csymv_s_c_testgen(norm, order, uplo,
604 			   n, randomize, alpha, alpha_flag, beta, beta_flag,
605 			   a_full, n /* lda */ , x, incx, y, incy,
606 			   seed, r_true_l, r_true_t);
607     sspmv_pack_matrix(order, uplo, n, a, a_full, n /*lda */ );
608 
609     blas_free(a_full);
610   }
611 }				/* end BLAS_cspmv_s_c_testgen */
BLAS_cspmv_c_s_testgen(int norm,enum blas_order_type order,enum blas_uplo_type uplo,int n,int randomize,void * alpha,int alpha_flag,void * beta,int beta_flag,void * a,float * x,int incx,void * y,int incy,int * seed,double * r_true_l,double * r_true_t)612 void BLAS_cspmv_c_s_testgen(int norm, enum blas_order_type order,
613 			    enum blas_uplo_type uplo, int n, int randomize,
614 			    void *alpha, int alpha_flag, void *beta,
615 			    int beta_flag, void *a, float *x, int incx,
616 			    void *y, int incy, int *seed, double *r_true_l,
617 			    double *r_true_t)
618 
619 /*
620  * Purpose
621  * =======
622  *
623  *   Generates the test inputs to BLAS_cspmv_c_s{_x}
624  *
625  * Arguments
626  * =========
627  *
628  * norm    (input) int
629  *           = -1: the vectors are scaled with norms near underflow.
630  *           =  0: the vectors have norms of order 1.
631  *           =  1: the vectors are scaled with norms near overflow.
632  *
633  * order   (input) enum blas_order_type
634  *           storage format of the matrices
635  *
636  * uplo    (input) enum blas_uplo_type
637  *           which half of the symmetric matrix a is to be stored.
638  *
639  * n       (input) int
640  *           sizes of symmetrical matrix a, size of vectors x, y:
641  *              matrix a is n-by-n.
642  *
643  * randomize (input) int
644  *           if 0, entries in matrices A, x will be chosen for
645  *              maximum cancellation, but with less randomness.
646  *           if 1, every entry in the matrix A, x will be
647  *              random.
648  *
649  * alpha   (input/output) void*
650  *           if alpha_flag = 1, alpha is input.
651  *           if alpha_flag = 0, alpha is output.
652  *
653  * alpha_flag (input) int
654  *           = 0: alpha is free, and is output.
655  *           = 1: alpha is fixed on input.
656  *
657  * beta    (input/output) void*
658  *           if beta_flag = 1, beta is input.
659  *           if beta_flag = 0, beta is output.
660  *
661  * beta_flag (input) int
662  *           = 0: beta is free, and is output.
663  *           = 1: beta is fixed on input.
664  *
665  * a       (input/output) void* The Packed Symmetric Matrix
666  *
667  *
668  * x       (input/output) float*
669  *
670  * incx    (input) int
671  *         stride of vector x.
672  *
673  * y       (input/output) void*
674  *         generated vector y that will be used as an input to SPMV.
675  *
676  * incy    (input) int
677  *         leading dimension of vector y.
678  *
679  * seed    (input/output) int *
680  *         seed for the random number generator.
681  *
682  * r_true_l  (output) double *
683  *         the leading part of the truth in double-double.
684  *
685  * r_true_t  (output) double *
686  *         the trailing part of the truth in double-double
687  *
688  */
689 {
690   {
691 
692     /* Strategy:
693 
694        Use the SYMV generator, then simply pack the
695        output.
696      */
697 
698     float *a_full;
699     a_full = (float *) blas_malloc(n * n * sizeof(float) * 2);
700     if (n * n > 0 && a_full == NULL) {
701       BLAS_error("blas_malloc", 0, 0, "malloc failed.\n");
702     }
703 
704     BLAS_csymv_c_s_testgen(norm, order, uplo,
705 			   n, randomize, alpha, alpha_flag, beta, beta_flag,
706 			   a_full, n /* lda */ , x, incx, y, incy,
707 			   seed, r_true_l, r_true_t);
708     cspmv_pack_matrix(order, uplo, n, a, a_full, n /*lda */ );
709 
710     blas_free(a_full);
711   }
712 }				/* end BLAS_cspmv_c_s_testgen */
BLAS_zspmv_d_d_testgen(int norm,enum blas_order_type order,enum blas_uplo_type uplo,int n,int randomize,void * alpha,int alpha_flag,void * beta,int beta_flag,double * a,double * x,int incx,void * y,int incy,int * seed,double * r_true_l,double * r_true_t)713 void BLAS_zspmv_d_d_testgen(int norm, enum blas_order_type order,
714 			    enum blas_uplo_type uplo, int n, int randomize,
715 			    void *alpha, int alpha_flag, void *beta,
716 			    int beta_flag, double *a, double *x, int incx,
717 			    void *y, int incy, int *seed, double *r_true_l,
718 			    double *r_true_t)
719 
720 /*
721  * Purpose
722  * =======
723  *
724  *   Generates the test inputs to BLAS_zspmv_d_d{_x}
725  *
726  * Arguments
727  * =========
728  *
729  * norm    (input) int
730  *           = -1: the vectors are scaled with norms near underflow.
731  *           =  0: the vectors have norms of order 1.
732  *           =  1: the vectors are scaled with norms near overflow.
733  *
734  * order   (input) enum blas_order_type
735  *           storage format of the matrices
736  *
737  * uplo    (input) enum blas_uplo_type
738  *           which half of the symmetric matrix a is to be stored.
739  *
740  * n       (input) int
741  *           sizes of symmetrical matrix a, size of vectors x, y:
742  *              matrix a is n-by-n.
743  *
744  * randomize (input) int
745  *           if 0, entries in matrices A, x will be chosen for
746  *              maximum cancellation, but with less randomness.
747  *           if 1, every entry in the matrix A, x will be
748  *              random.
749  *
750  * alpha   (input/output) void*
751  *           if alpha_flag = 1, alpha is input.
752  *           if alpha_flag = 0, alpha is output.
753  *
754  * alpha_flag (input) int
755  *           = 0: alpha is free, and is output.
756  *           = 1: alpha is fixed on input.
757  *
758  * beta    (input/output) void*
759  *           if beta_flag = 1, beta is input.
760  *           if beta_flag = 0, beta is output.
761  *
762  * beta_flag (input) int
763  *           = 0: beta is free, and is output.
764  *           = 1: beta is fixed on input.
765  *
766  * a       (input/output) double* The Packed Symmetric Matrix
767  *
768  *
769  * x       (input/output) double*
770  *
771  * incx    (input) int
772  *         stride of vector x.
773  *
774  * y       (input/output) void*
775  *         generated vector y that will be used as an input to SPMV.
776  *
777  * incy    (input) int
778  *         leading dimension of vector y.
779  *
780  * seed    (input/output) int *
781  *         seed for the random number generator.
782  *
783  * r_true_l  (output) double *
784  *         the leading part of the truth in double-double.
785  *
786  * r_true_t  (output) double *
787  *         the trailing part of the truth in double-double
788  *
789  */
790 {
791   {
792 
793     /* Strategy:
794 
795        Use the SYMV generator, then simply pack the
796        output.
797      */
798 
799     double *a_full;
800     a_full = (double *) blas_malloc(n * n * sizeof(double));
801     if (n * n > 0 && a_full == NULL) {
802       BLAS_error("blas_malloc", 0, 0, "malloc failed.\n");
803     }
804 
805     BLAS_zsymv_d_d_testgen(norm, order, uplo,
806 			   n, randomize, alpha, alpha_flag, beta, beta_flag,
807 			   a_full, n /* lda */ , x, incx, y, incy,
808 			   seed, r_true_l, r_true_t);
809     dspmv_pack_matrix(order, uplo, n, a, a_full, n /*lda */ );
810 
811     blas_free(a_full);
812   }
813 }				/* end BLAS_zspmv_d_d_testgen */
BLAS_zspmv_d_z_testgen(int norm,enum blas_order_type order,enum blas_uplo_type uplo,int n,int randomize,void * alpha,int alpha_flag,void * beta,int beta_flag,double * a,void * x,int incx,void * y,int incy,int * seed,double * r_true_l,double * r_true_t)814 void BLAS_zspmv_d_z_testgen(int norm, enum blas_order_type order,
815 			    enum blas_uplo_type uplo, int n, int randomize,
816 			    void *alpha, int alpha_flag, void *beta,
817 			    int beta_flag, double *a, void *x, int incx,
818 			    void *y, int incy, int *seed, double *r_true_l,
819 			    double *r_true_t)
820 
821 /*
822  * Purpose
823  * =======
824  *
825  *   Generates the test inputs to BLAS_zspmv_d_z{_x}
826  *
827  * Arguments
828  * =========
829  *
830  * norm    (input) int
831  *           = -1: the vectors are scaled with norms near underflow.
832  *           =  0: the vectors have norms of order 1.
833  *           =  1: the vectors are scaled with norms near overflow.
834  *
835  * order   (input) enum blas_order_type
836  *           storage format of the matrices
837  *
838  * uplo    (input) enum blas_uplo_type
839  *           which half of the symmetric matrix a is to be stored.
840  *
841  * n       (input) int
842  *           sizes of symmetrical matrix a, size of vectors x, y:
843  *              matrix a is n-by-n.
844  *
845  * randomize (input) int
846  *           if 0, entries in matrices A, x will be chosen for
847  *              maximum cancellation, but with less randomness.
848  *           if 1, every entry in the matrix A, x will be
849  *              random.
850  *
851  * alpha   (input/output) void*
852  *           if alpha_flag = 1, alpha is input.
853  *           if alpha_flag = 0, alpha is output.
854  *
855  * alpha_flag (input) int
856  *           = 0: alpha is free, and is output.
857  *           = 1: alpha is fixed on input.
858  *
859  * beta    (input/output) void*
860  *           if beta_flag = 1, beta is input.
861  *           if beta_flag = 0, beta is output.
862  *
863  * beta_flag (input) int
864  *           = 0: beta is free, and is output.
865  *           = 1: beta is fixed on input.
866  *
867  * a       (input/output) double* The Packed Symmetric Matrix
868  *
869  *
870  * x       (input/output) void*
871  *
872  * incx    (input) int
873  *         stride of vector x.
874  *
875  * y       (input/output) void*
876  *         generated vector y that will be used as an input to SPMV.
877  *
878  * incy    (input) int
879  *         leading dimension of vector y.
880  *
881  * seed    (input/output) int *
882  *         seed for the random number generator.
883  *
884  * r_true_l  (output) double *
885  *         the leading part of the truth in double-double.
886  *
887  * r_true_t  (output) double *
888  *         the trailing part of the truth in double-double
889  *
890  */
891 {
892   {
893 
894     /* Strategy:
895 
896        Use the SYMV generator, then simply pack the
897        output.
898      */
899 
900     double *a_full;
901     a_full = (double *) blas_malloc(n * n * sizeof(double));
902     if (n * n > 0 && a_full == NULL) {
903       BLAS_error("blas_malloc", 0, 0, "malloc failed.\n");
904     }
905 
906     BLAS_zsymv_d_z_testgen(norm, order, uplo,
907 			   n, randomize, alpha, alpha_flag, beta, beta_flag,
908 			   a_full, n /* lda */ , x, incx, y, incy,
909 			   seed, r_true_l, r_true_t);
910     dspmv_pack_matrix(order, uplo, n, a, a_full, n /*lda */ );
911 
912     blas_free(a_full);
913   }
914 }				/* end BLAS_zspmv_d_z_testgen */
BLAS_zspmv_z_d_testgen(int norm,enum blas_order_type order,enum blas_uplo_type uplo,int n,int randomize,void * alpha,int alpha_flag,void * beta,int beta_flag,void * a,double * x,int incx,void * y,int incy,int * seed,double * r_true_l,double * r_true_t)915 void BLAS_zspmv_z_d_testgen(int norm, enum blas_order_type order,
916 			    enum blas_uplo_type uplo, int n, int randomize,
917 			    void *alpha, int alpha_flag, void *beta,
918 			    int beta_flag, void *a, double *x, int incx,
919 			    void *y, int incy, int *seed, double *r_true_l,
920 			    double *r_true_t)
921 
922 /*
923  * Purpose
924  * =======
925  *
926  *   Generates the test inputs to BLAS_zspmv_z_d{_x}
927  *
928  * Arguments
929  * =========
930  *
931  * norm    (input) int
932  *           = -1: the vectors are scaled with norms near underflow.
933  *           =  0: the vectors have norms of order 1.
934  *           =  1: the vectors are scaled with norms near overflow.
935  *
936  * order   (input) enum blas_order_type
937  *           storage format of the matrices
938  *
939  * uplo    (input) enum blas_uplo_type
940  *           which half of the symmetric matrix a is to be stored.
941  *
942  * n       (input) int
943  *           sizes of symmetrical matrix a, size of vectors x, y:
944  *              matrix a is n-by-n.
945  *
946  * randomize (input) int
947  *           if 0, entries in matrices A, x will be chosen for
948  *              maximum cancellation, but with less randomness.
949  *           if 1, every entry in the matrix A, x will be
950  *              random.
951  *
952  * alpha   (input/output) void*
953  *           if alpha_flag = 1, alpha is input.
954  *           if alpha_flag = 0, alpha is output.
955  *
956  * alpha_flag (input) int
957  *           = 0: alpha is free, and is output.
958  *           = 1: alpha is fixed on input.
959  *
960  * beta    (input/output) void*
961  *           if beta_flag = 1, beta is input.
962  *           if beta_flag = 0, beta is output.
963  *
964  * beta_flag (input) int
965  *           = 0: beta is free, and is output.
966  *           = 1: beta is fixed on input.
967  *
968  * a       (input/output) void* The Packed Symmetric Matrix
969  *
970  *
971  * x       (input/output) double*
972  *
973  * incx    (input) int
974  *         stride of vector x.
975  *
976  * y       (input/output) void*
977  *         generated vector y that will be used as an input to SPMV.
978  *
979  * incy    (input) int
980  *         leading dimension of vector y.
981  *
982  * seed    (input/output) int *
983  *         seed for the random number generator.
984  *
985  * r_true_l  (output) double *
986  *         the leading part of the truth in double-double.
987  *
988  * r_true_t  (output) double *
989  *         the trailing part of the truth in double-double
990  *
991  */
992 {
993   {
994 
995     /* Strategy:
996 
997        Use the SYMV generator, then simply pack the
998        output.
999      */
1000 
1001     double *a_full;
1002     a_full = (double *) blas_malloc(n * n * sizeof(double) * 2);
1003     if (n * n > 0 && a_full == NULL) {
1004       BLAS_error("blas_malloc", 0, 0, "malloc failed.\n");
1005     }
1006 
1007     BLAS_zsymv_z_d_testgen(norm, order, uplo,
1008 			   n, randomize, alpha, alpha_flag, beta, beta_flag,
1009 			   a_full, n /* lda */ , x, incx, y, incy,
1010 			   seed, r_true_l, r_true_t);
1011     zspmv_pack_matrix(order, uplo, n, a, a_full, n /*lda */ );
1012 
1013     blas_free(a_full);
1014   }
1015 }				/* end BLAS_zspmv_z_d_testgen */
BLAS_dspmv_s_s_testgen(int norm,enum blas_order_type order,enum blas_uplo_type uplo,int n,int randomize,double * alpha,int alpha_flag,double * beta,int beta_flag,float * a,float * x,int incx,double * y,int incy,int * seed,double * r_true_l,double * r_true_t)1016 void BLAS_dspmv_s_s_testgen(int norm, enum blas_order_type order,
1017 			    enum blas_uplo_type uplo, int n, int randomize,
1018 			    double *alpha, int alpha_flag, double *beta,
1019 			    int beta_flag, float *a, float *x, int incx,
1020 			    double *y, int incy, int *seed, double *r_true_l,
1021 			    double *r_true_t)
1022 
1023 /*
1024  * Purpose
1025  * =======
1026  *
1027  *   Generates the test inputs to BLAS_dspmv_s_s{_x}
1028  *
1029  * Arguments
1030  * =========
1031  *
1032  * norm    (input) int
1033  *           = -1: the vectors are scaled with norms near underflow.
1034  *           =  0: the vectors have norms of order 1.
1035  *           =  1: the vectors are scaled with norms near overflow.
1036  *
1037  * order   (input) enum blas_order_type
1038  *           storage format of the matrices
1039  *
1040  * uplo    (input) enum blas_uplo_type
1041  *           which half of the symmetric matrix a is to be stored.
1042  *
1043  * n       (input) int
1044  *           sizes of symmetrical matrix a, size of vectors x, y:
1045  *              matrix a is n-by-n.
1046  *
1047  * randomize (input) int
1048  *           if 0, entries in matrices A, x will be chosen for
1049  *              maximum cancellation, but with less randomness.
1050  *           if 1, every entry in the matrix A, x will be
1051  *              random.
1052  *
1053  * alpha   (input/output) double*
1054  *           if alpha_flag = 1, alpha is input.
1055  *           if alpha_flag = 0, alpha is output.
1056  *
1057  * alpha_flag (input) int
1058  *           = 0: alpha is free, and is output.
1059  *           = 1: alpha is fixed on input.
1060  *
1061  * beta    (input/output) double*
1062  *           if beta_flag = 1, beta is input.
1063  *           if beta_flag = 0, beta is output.
1064  *
1065  * beta_flag (input) int
1066  *           = 0: beta is free, and is output.
1067  *           = 1: beta is fixed on input.
1068  *
1069  * a       (input/output) float* The Packed Symmetric Matrix
1070  *
1071  *
1072  * x       (input/output) float*
1073  *
1074  * incx    (input) int
1075  *         stride of vector x.
1076  *
1077  * y       (input/output) double*
1078  *         generated vector y that will be used as an input to SPMV.
1079  *
1080  * incy    (input) int
1081  *         leading dimension of vector y.
1082  *
1083  * seed    (input/output) int *
1084  *         seed for the random number generator.
1085  *
1086  * r_true_l  (output) double *
1087  *         the leading part of the truth in double-double.
1088  *
1089  * r_true_t  (output) double *
1090  *         the trailing part of the truth in double-double
1091  *
1092  */
1093 {
1094   {
1095 
1096     /* Strategy:
1097 
1098        Use the SYMV generator, then simply pack the
1099        output.
1100      */
1101 
1102     float *a_full;
1103     a_full = (float *) blas_malloc(n * n * sizeof(float));
1104     if (n * n > 0 && a_full == NULL) {
1105       BLAS_error("blas_malloc", 0, 0, "malloc failed.\n");
1106     }
1107 
1108     BLAS_dsymv_s_s_testgen(norm, order, uplo,
1109 			   n, randomize, alpha, alpha_flag, beta, beta_flag,
1110 			   a_full, n /* lda */ , x, incx, y, incy,
1111 			   seed, r_true_l, r_true_t);
1112     sspmv_pack_matrix(order, uplo, n, a, a_full, n /*lda */ );
1113 
1114     blas_free(a_full);
1115   }
1116 }				/* end BLAS_dspmv_s_s_testgen */
BLAS_dspmv_s_d_testgen(int norm,enum blas_order_type order,enum blas_uplo_type uplo,int n,int randomize,double * alpha,int alpha_flag,double * beta,int beta_flag,float * a,double * x,int incx,double * y,int incy,int * seed,double * r_true_l,double * r_true_t)1117 void BLAS_dspmv_s_d_testgen(int norm, enum blas_order_type order,
1118 			    enum blas_uplo_type uplo, int n, int randomize,
1119 			    double *alpha, int alpha_flag, double *beta,
1120 			    int beta_flag, float *a, double *x, int incx,
1121 			    double *y, int incy, int *seed, double *r_true_l,
1122 			    double *r_true_t)
1123 
1124 /*
1125  * Purpose
1126  * =======
1127  *
1128  *   Generates the test inputs to BLAS_dspmv_s_d{_x}
1129  *
1130  * Arguments
1131  * =========
1132  *
1133  * norm    (input) int
1134  *           = -1: the vectors are scaled with norms near underflow.
1135  *           =  0: the vectors have norms of order 1.
1136  *           =  1: the vectors are scaled with norms near overflow.
1137  *
1138  * order   (input) enum blas_order_type
1139  *           storage format of the matrices
1140  *
1141  * uplo    (input) enum blas_uplo_type
1142  *           which half of the symmetric matrix a is to be stored.
1143  *
1144  * n       (input) int
1145  *           sizes of symmetrical matrix a, size of vectors x, y:
1146  *              matrix a is n-by-n.
1147  *
1148  * randomize (input) int
1149  *           if 0, entries in matrices A, x will be chosen for
1150  *              maximum cancellation, but with less randomness.
1151  *           if 1, every entry in the matrix A, x will be
1152  *              random.
1153  *
1154  * alpha   (input/output) double*
1155  *           if alpha_flag = 1, alpha is input.
1156  *           if alpha_flag = 0, alpha is output.
1157  *
1158  * alpha_flag (input) int
1159  *           = 0: alpha is free, and is output.
1160  *           = 1: alpha is fixed on input.
1161  *
1162  * beta    (input/output) double*
1163  *           if beta_flag = 1, beta is input.
1164  *           if beta_flag = 0, beta is output.
1165  *
1166  * beta_flag (input) int
1167  *           = 0: beta is free, and is output.
1168  *           = 1: beta is fixed on input.
1169  *
1170  * a       (input/output) float* The Packed Symmetric Matrix
1171  *
1172  *
1173  * x       (input/output) double*
1174  *
1175  * incx    (input) int
1176  *         stride of vector x.
1177  *
1178  * y       (input/output) double*
1179  *         generated vector y that will be used as an input to SPMV.
1180  *
1181  * incy    (input) int
1182  *         leading dimension of vector y.
1183  *
1184  * seed    (input/output) int *
1185  *         seed for the random number generator.
1186  *
1187  * r_true_l  (output) double *
1188  *         the leading part of the truth in double-double.
1189  *
1190  * r_true_t  (output) double *
1191  *         the trailing part of the truth in double-double
1192  *
1193  */
1194 {
1195   {
1196 
1197     /* Strategy:
1198 
1199        Use the SYMV generator, then simply pack the
1200        output.
1201      */
1202 
1203     float *a_full;
1204     a_full = (float *) blas_malloc(n * n * sizeof(float));
1205     if (n * n > 0 && a_full == NULL) {
1206       BLAS_error("blas_malloc", 0, 0, "malloc failed.\n");
1207     }
1208 
1209     BLAS_dsymv_s_d_testgen(norm, order, uplo,
1210 			   n, randomize, alpha, alpha_flag, beta, beta_flag,
1211 			   a_full, n /* lda */ , x, incx, y, incy,
1212 			   seed, r_true_l, r_true_t);
1213     sspmv_pack_matrix(order, uplo, n, a, a_full, n /*lda */ );
1214 
1215     blas_free(a_full);
1216   }
1217 }				/* end BLAS_dspmv_s_d_testgen */
BLAS_dspmv_d_s_testgen(int norm,enum blas_order_type order,enum blas_uplo_type uplo,int n,int randomize,double * alpha,int alpha_flag,double * beta,int beta_flag,double * a,float * x,int incx,double * y,int incy,int * seed,double * r_true_l,double * r_true_t)1218 void BLAS_dspmv_d_s_testgen(int norm, enum blas_order_type order,
1219 			    enum blas_uplo_type uplo, int n, int randomize,
1220 			    double *alpha, int alpha_flag, double *beta,
1221 			    int beta_flag, double *a, float *x, int incx,
1222 			    double *y, int incy, int *seed, double *r_true_l,
1223 			    double *r_true_t)
1224 
1225 /*
1226  * Purpose
1227  * =======
1228  *
1229  *   Generates the test inputs to BLAS_dspmv_d_s{_x}
1230  *
1231  * Arguments
1232  * =========
1233  *
1234  * norm    (input) int
1235  *           = -1: the vectors are scaled with norms near underflow.
1236  *           =  0: the vectors have norms of order 1.
1237  *           =  1: the vectors are scaled with norms near overflow.
1238  *
1239  * order   (input) enum blas_order_type
1240  *           storage format of the matrices
1241  *
1242  * uplo    (input) enum blas_uplo_type
1243  *           which half of the symmetric matrix a is to be stored.
1244  *
1245  * n       (input) int
1246  *           sizes of symmetrical matrix a, size of vectors x, y:
1247  *              matrix a is n-by-n.
1248  *
1249  * randomize (input) int
1250  *           if 0, entries in matrices A, x will be chosen for
1251  *              maximum cancellation, but with less randomness.
1252  *           if 1, every entry in the matrix A, x will be
1253  *              random.
1254  *
1255  * alpha   (input/output) double*
1256  *           if alpha_flag = 1, alpha is input.
1257  *           if alpha_flag = 0, alpha is output.
1258  *
1259  * alpha_flag (input) int
1260  *           = 0: alpha is free, and is output.
1261  *           = 1: alpha is fixed on input.
1262  *
1263  * beta    (input/output) double*
1264  *           if beta_flag = 1, beta is input.
1265  *           if beta_flag = 0, beta is output.
1266  *
1267  * beta_flag (input) int
1268  *           = 0: beta is free, and is output.
1269  *           = 1: beta is fixed on input.
1270  *
1271  * a       (input/output) double* The Packed Symmetric Matrix
1272  *
1273  *
1274  * x       (input/output) float*
1275  *
1276  * incx    (input) int
1277  *         stride of vector x.
1278  *
1279  * y       (input/output) double*
1280  *         generated vector y that will be used as an input to SPMV.
1281  *
1282  * incy    (input) int
1283  *         leading dimension of vector y.
1284  *
1285  * seed    (input/output) int *
1286  *         seed for the random number generator.
1287  *
1288  * r_true_l  (output) double *
1289  *         the leading part of the truth in double-double.
1290  *
1291  * r_true_t  (output) double *
1292  *         the trailing part of the truth in double-double
1293  *
1294  */
1295 {
1296   {
1297 
1298     /* Strategy:
1299 
1300        Use the SYMV generator, then simply pack the
1301        output.
1302      */
1303 
1304     double *a_full;
1305     a_full = (double *) blas_malloc(n * n * sizeof(double));
1306     if (n * n > 0 && a_full == NULL) {
1307       BLAS_error("blas_malloc", 0, 0, "malloc failed.\n");
1308     }
1309 
1310     BLAS_dsymv_d_s_testgen(norm, order, uplo,
1311 			   n, randomize, alpha, alpha_flag, beta, beta_flag,
1312 			   a_full, n /* lda */ , x, incx, y, incy,
1313 			   seed, r_true_l, r_true_t);
1314     dspmv_pack_matrix(order, uplo, n, a, a_full, n /*lda */ );
1315 
1316     blas_free(a_full);
1317   }
1318 }				/* end BLAS_dspmv_d_s_testgen */
BLAS_zspmv_c_c_testgen(int norm,enum blas_order_type order,enum blas_uplo_type uplo,int n,int randomize,void * alpha,int alpha_flag,void * beta,int beta_flag,void * a,void * x,int incx,void * y,int incy,int * seed,double * r_true_l,double * r_true_t)1319 void BLAS_zspmv_c_c_testgen(int norm, enum blas_order_type order,
1320 			    enum blas_uplo_type uplo, int n, int randomize,
1321 			    void *alpha, int alpha_flag, void *beta,
1322 			    int beta_flag, void *a, void *x, int incx,
1323 			    void *y, int incy, int *seed, double *r_true_l,
1324 			    double *r_true_t)
1325 
1326 /*
1327  * Purpose
1328  * =======
1329  *
1330  *   Generates the test inputs to BLAS_zspmv_c_c{_x}
1331  *
1332  * Arguments
1333  * =========
1334  *
1335  * norm    (input) int
1336  *           = -1: the vectors are scaled with norms near underflow.
1337  *           =  0: the vectors have norms of order 1.
1338  *           =  1: the vectors are scaled with norms near overflow.
1339  *
1340  * order   (input) enum blas_order_type
1341  *           storage format of the matrices
1342  *
1343  * uplo    (input) enum blas_uplo_type
1344  *           which half of the symmetric matrix a is to be stored.
1345  *
1346  * n       (input) int
1347  *           sizes of symmetrical matrix a, size of vectors x, y:
1348  *              matrix a is n-by-n.
1349  *
1350  * randomize (input) int
1351  *           if 0, entries in matrices A, x will be chosen for
1352  *              maximum cancellation, but with less randomness.
1353  *           if 1, every entry in the matrix A, x will be
1354  *              random.
1355  *
1356  * alpha   (input/output) void*
1357  *           if alpha_flag = 1, alpha is input.
1358  *           if alpha_flag = 0, alpha is output.
1359  *
1360  * alpha_flag (input) int
1361  *           = 0: alpha is free, and is output.
1362  *           = 1: alpha is fixed on input.
1363  *
1364  * beta    (input/output) void*
1365  *           if beta_flag = 1, beta is input.
1366  *           if beta_flag = 0, beta is output.
1367  *
1368  * beta_flag (input) int
1369  *           = 0: beta is free, and is output.
1370  *           = 1: beta is fixed on input.
1371  *
1372  * a       (input/output) void* The Packed Symmetric Matrix
1373  *
1374  *
1375  * x       (input/output) void*
1376  *
1377  * incx    (input) int
1378  *         stride of vector x.
1379  *
1380  * y       (input/output) void*
1381  *         generated vector y that will be used as an input to SPMV.
1382  *
1383  * incy    (input) int
1384  *         leading dimension of vector y.
1385  *
1386  * seed    (input/output) int *
1387  *         seed for the random number generator.
1388  *
1389  * r_true_l  (output) double *
1390  *         the leading part of the truth in double-double.
1391  *
1392  * r_true_t  (output) double *
1393  *         the trailing part of the truth in double-double
1394  *
1395  */
1396 {
1397   {
1398 
1399     /* Strategy:
1400 
1401        Use the SYMV generator, then simply pack the
1402        output.
1403      */
1404 
1405     float *a_full;
1406     a_full = (float *) blas_malloc(n * n * sizeof(float) * 2);
1407     if (n * n > 0 && a_full == NULL) {
1408       BLAS_error("blas_malloc", 0, 0, "malloc failed.\n");
1409     }
1410 
1411     BLAS_zsymv_c_c_testgen(norm, order, uplo,
1412 			   n, randomize, alpha, alpha_flag, beta, beta_flag,
1413 			   a_full, n /* lda */ , x, incx, y, incy,
1414 			   seed, r_true_l, r_true_t);
1415     cspmv_pack_matrix(order, uplo, n, a, a_full, n /*lda */ );
1416 
1417     blas_free(a_full);
1418   }
1419 }				/* end BLAS_zspmv_c_c_testgen */
BLAS_zspmv_c_z_testgen(int norm,enum blas_order_type order,enum blas_uplo_type uplo,int n,int randomize,void * alpha,int alpha_flag,void * beta,int beta_flag,void * a,void * x,int incx,void * y,int incy,int * seed,double * r_true_l,double * r_true_t)1420 void BLAS_zspmv_c_z_testgen(int norm, enum blas_order_type order,
1421 			    enum blas_uplo_type uplo, int n, int randomize,
1422 			    void *alpha, int alpha_flag, void *beta,
1423 			    int beta_flag, void *a, void *x, int incx,
1424 			    void *y, int incy, int *seed, double *r_true_l,
1425 			    double *r_true_t)
1426 
1427 /*
1428  * Purpose
1429  * =======
1430  *
1431  *   Generates the test inputs to BLAS_zspmv_c_z{_x}
1432  *
1433  * Arguments
1434  * =========
1435  *
1436  * norm    (input) int
1437  *           = -1: the vectors are scaled with norms near underflow.
1438  *           =  0: the vectors have norms of order 1.
1439  *           =  1: the vectors are scaled with norms near overflow.
1440  *
1441  * order   (input) enum blas_order_type
1442  *           storage format of the matrices
1443  *
1444  * uplo    (input) enum blas_uplo_type
1445  *           which half of the symmetric matrix a is to be stored.
1446  *
1447  * n       (input) int
1448  *           sizes of symmetrical matrix a, size of vectors x, y:
1449  *              matrix a is n-by-n.
1450  *
1451  * randomize (input) int
1452  *           if 0, entries in matrices A, x will be chosen for
1453  *              maximum cancellation, but with less randomness.
1454  *           if 1, every entry in the matrix A, x will be
1455  *              random.
1456  *
1457  * alpha   (input/output) void*
1458  *           if alpha_flag = 1, alpha is input.
1459  *           if alpha_flag = 0, alpha is output.
1460  *
1461  * alpha_flag (input) int
1462  *           = 0: alpha is free, and is output.
1463  *           = 1: alpha is fixed on input.
1464  *
1465  * beta    (input/output) void*
1466  *           if beta_flag = 1, beta is input.
1467  *           if beta_flag = 0, beta is output.
1468  *
1469  * beta_flag (input) int
1470  *           = 0: beta is free, and is output.
1471  *           = 1: beta is fixed on input.
1472  *
1473  * a       (input/output) void* The Packed Symmetric Matrix
1474  *
1475  *
1476  * x       (input/output) void*
1477  *
1478  * incx    (input) int
1479  *         stride of vector x.
1480  *
1481  * y       (input/output) void*
1482  *         generated vector y that will be used as an input to SPMV.
1483  *
1484  * incy    (input) int
1485  *         leading dimension of vector y.
1486  *
1487  * seed    (input/output) int *
1488  *         seed for the random number generator.
1489  *
1490  * r_true_l  (output) double *
1491  *         the leading part of the truth in double-double.
1492  *
1493  * r_true_t  (output) double *
1494  *         the trailing part of the truth in double-double
1495  *
1496  */
1497 {
1498   {
1499 
1500     /* Strategy:
1501 
1502        Use the SYMV generator, then simply pack the
1503        output.
1504      */
1505 
1506     float *a_full;
1507     a_full = (float *) blas_malloc(n * n * sizeof(float) * 2);
1508     if (n * n > 0 && a_full == NULL) {
1509       BLAS_error("blas_malloc", 0, 0, "malloc failed.\n");
1510     }
1511 
1512     BLAS_zsymv_c_z_testgen(norm, order, uplo,
1513 			   n, randomize, alpha, alpha_flag, beta, beta_flag,
1514 			   a_full, n /* lda */ , x, incx, y, incy,
1515 			   seed, r_true_l, r_true_t);
1516     cspmv_pack_matrix(order, uplo, n, a, a_full, n /*lda */ );
1517 
1518     blas_free(a_full);
1519   }
1520 }				/* end BLAS_zspmv_c_z_testgen */
BLAS_zspmv_z_c_testgen(int norm,enum blas_order_type order,enum blas_uplo_type uplo,int n,int randomize,void * alpha,int alpha_flag,void * beta,int beta_flag,void * a,void * x,int incx,void * y,int incy,int * seed,double * r_true_l,double * r_true_t)1521 void BLAS_zspmv_z_c_testgen(int norm, enum blas_order_type order,
1522 			    enum blas_uplo_type uplo, int n, int randomize,
1523 			    void *alpha, int alpha_flag, void *beta,
1524 			    int beta_flag, void *a, void *x, int incx,
1525 			    void *y, int incy, int *seed, double *r_true_l,
1526 			    double *r_true_t)
1527 
1528 /*
1529  * Purpose
1530  * =======
1531  *
1532  *   Generates the test inputs to BLAS_zspmv_z_c{_x}
1533  *
1534  * Arguments
1535  * =========
1536  *
1537  * norm    (input) int
1538  *           = -1: the vectors are scaled with norms near underflow.
1539  *           =  0: the vectors have norms of order 1.
1540  *           =  1: the vectors are scaled with norms near overflow.
1541  *
1542  * order   (input) enum blas_order_type
1543  *           storage format of the matrices
1544  *
1545  * uplo    (input) enum blas_uplo_type
1546  *           which half of the symmetric matrix a is to be stored.
1547  *
1548  * n       (input) int
1549  *           sizes of symmetrical matrix a, size of vectors x, y:
1550  *              matrix a is n-by-n.
1551  *
1552  * randomize (input) int
1553  *           if 0, entries in matrices A, x will be chosen for
1554  *              maximum cancellation, but with less randomness.
1555  *           if 1, every entry in the matrix A, x will be
1556  *              random.
1557  *
1558  * alpha   (input/output) void*
1559  *           if alpha_flag = 1, alpha is input.
1560  *           if alpha_flag = 0, alpha is output.
1561  *
1562  * alpha_flag (input) int
1563  *           = 0: alpha is free, and is output.
1564  *           = 1: alpha is fixed on input.
1565  *
1566  * beta    (input/output) void*
1567  *           if beta_flag = 1, beta is input.
1568  *           if beta_flag = 0, beta is output.
1569  *
1570  * beta_flag (input) int
1571  *           = 0: beta is free, and is output.
1572  *           = 1: beta is fixed on input.
1573  *
1574  * a       (input/output) void* The Packed Symmetric Matrix
1575  *
1576  *
1577  * x       (input/output) void*
1578  *
1579  * incx    (input) int
1580  *         stride of vector x.
1581  *
1582  * y       (input/output) void*
1583  *         generated vector y that will be used as an input to SPMV.
1584  *
1585  * incy    (input) int
1586  *         leading dimension of vector y.
1587  *
1588  * seed    (input/output) int *
1589  *         seed for the random number generator.
1590  *
1591  * r_true_l  (output) double *
1592  *         the leading part of the truth in double-double.
1593  *
1594  * r_true_t  (output) double *
1595  *         the trailing part of the truth in double-double
1596  *
1597  */
1598 {
1599   {
1600 
1601     /* Strategy:
1602 
1603        Use the SYMV generator, then simply pack the
1604        output.
1605      */
1606 
1607     double *a_full;
1608     a_full = (double *) blas_malloc(n * n * sizeof(double) * 2);
1609     if (n * n > 0 && a_full == NULL) {
1610       BLAS_error("blas_malloc", 0, 0, "malloc failed.\n");
1611     }
1612 
1613     BLAS_zsymv_z_c_testgen(norm, order, uplo,
1614 			   n, randomize, alpha, alpha_flag, beta, beta_flag,
1615 			   a_full, n /* lda */ , x, incx, y, incy,
1616 			   seed, r_true_l, r_true_t);
1617     zspmv_pack_matrix(order, uplo, n, a, a_full, n /*lda */ );
1618 
1619     blas_free(a_full);
1620   }
1621 }				/* end BLAS_zspmv_z_c_testgen */
1622