QDP++
generic_blas_vaxpy3_norm.h
Go to the documentation of this file.
1// $Id: generic_blas_vaxpy3_norm.h,v 1.2 2007-06-10 14:32:10 edwards Exp $
2
7
8#ifndef QDP_GENERIC_BLAS_VAXPY3_NORM
9#define QDP_GENERIC_BLAS_VAXPY3_NORM
10
11namespace QDP {
12
13inline
14void vaxpy3_norm(REAL *Out,REAL *scalep,REAL *InScale, REAL *Add,int n_3vec, REAL *norm)
15{
16 double a;
17 double x0r;
18 double x0i;
19
20 double x1r;
21 double x1i;
22
23 double x2r;
24 double x2i;
25
26 double y0r;
27 double y0i;
28
29 double y1r;
30 double y1i;
31
32 double y2r;
33 double y2i;
34
35 double z0r;
36 double z0i;
37
38 double z1r;
39 double z1i;
40
41 double z2r;
42 double z2i;
43 double norm_out=0;
44
45 a = *scalep;
46
47 int index_x = 0;
48 int index_y = 0;
49 int index_z = 0;
50
51 int counter;
52
53 for( counter = 0; counter < n_3vec; counter++) {
54 x0r = (double)InScale[index_x++];
55 y0r = (double)Add[index_y++];
56 z0r = a*x0r + y0r;
57 norm_out += z0r*z0r;
58 Out[index_z++] =(REAL) z0r;
59
60 x0i = (double)InScale[index_x++];
61 y0i = (double)Add[index_y++];
62 z0i = a*x0i + y0i;
63 norm_out += z0i*z0i;
64 Out[index_z++] =(REAL) z0i;
65
66
67 x1r = (double)InScale[index_x++];
68 y1r = (double)Add[index_y++];
69 z1r = a*x1r + y1r;
70 norm_out += z1r * z1r;
71 Out[index_z++] = (REAL)z1r;
72
73 x1i = (double)InScale[index_x++];
74 y1i = (double)Add[index_y++];
75 z1i = a*x1i + y1i;
76 norm_out += z1i*z1i;
77 Out[index_z++] = (REAL)z1i;
78
79 x2r = (double)InScale[index_x++];
80 y2r = (double)Add[index_y++];
81 z2r = a*x2r + y2r;
82 norm_out += z2r*z2r;
83 Out[index_z++] = (REAL)z2r;
84
85 x2i = (double)InScale[index_x++];
86 y2i = (double)Add[index_y++];
87 z2i = a*x2i + y2i;
88 norm_out += z2i*z2i;
89 Out[index_z++] = (REAL)z2i;
90
91 }
92 *norm=(REAL)norm_out;
93}
94
95} // namespace QDP;
96
97#endif // guard
REAL32 REAL
Yet another random number generator.
void vaxpy3_norm(REAL *Out, REAL *scalep, REAL *InScale, REAL *Add, int n_3vec, REAL *norm)