1 |
// $Header: $ |
2 |
|
3 |
#include "cblas.h" |
4 |
#include <complex.h> |
5 |
|
6 |
// cblas_?asum is a C interface to ?asum. |
7 |
float cblas_sasum(const int N, const float *X, const int incX) |
8 |
{ |
9 |
return sasum_(&N, X, &incX); |
10 |
} |
11 |
double cblas_dasum(const int N, const double *X, const int incX) |
12 |
{ |
13 |
return dasum_(&N, X, &incX); |
14 |
} |
15 |
|
16 |
float cblas_scasum(const int N, const _Complex float *X, const int incX) |
17 |
{ |
18 |
return scasum_(&N, X, &incX); |
19 |
} |
20 |
double cblas_dzasum(const int N, const _Complex double *X, const int incX) |
21 |
{ |
22 |
return dzasum_(&N, X, &incX); |
23 |
} |
24 |
|
25 |
// cblas_?axpy is a C interface to ?axpy. |
26 |
void cblas_saxpy(const int N, const float alpha, const float *X, const int incX, float *Y, const int incY) |
27 |
{ |
28 |
saxpy_(&N, &alpha, X, &incX, Y, &incY); |
29 |
} |
30 |
void cblas_daxpy(const int N, const double alpha, const double *X, const int incX, double *Y, const int incY) |
31 |
{ |
32 |
daxpy_(&N, &alpha, X, &incX, Y, &incY); |
33 |
} |
34 |
void cblas_caxpy(const int N, const _Complex float alpha, const _Complex float *X, const int incX, _Complex float *Y, const int incY) |
35 |
{ |
36 |
caxpy_(&N, &alpha, X, &incX, Y, &incY); |
37 |
} |
38 |
void cblas_zaxpy(const int N, const _Complex double alpha, const _Complex double *X, const int incX, _Complex double *Y, const int incY) |
39 |
{ |
40 |
zaxpy_(&N, &alpha, X, &incX, Y, &incY); |
41 |
} |
42 |
|
43 |
// cblas_?copy is a C interface to ?copy. |
44 |
void cblas_scopy(const int N, const float *X, const int incX, float *Y, const int incY) |
45 |
{ |
46 |
scopy_(&N, X, &incX, Y, &incY); |
47 |
} |
48 |
void cblas_dcopy(const int N, const double *X, const int incX, double *Y, const int incY) |
49 |
{ |
50 |
dcopy_(&N, X, &incX, Y, &incY); |
51 |
} |
52 |
void cblas_ccopy(const int N, const _Complex float *X, const int incX, _Complex float *Y, const int incY) |
53 |
{ |
54 |
ccopy_(&N, X, &incX, Y, &incY); |
55 |
} |
56 |
void cblas_zcopy(const int N, const _Complex double *X, const int incX, _Complex double *Y, const int incY) |
57 |
{ |
58 |
zcopy_(&N, X, &incX, Y, &incY); |
59 |
} |
60 |
|
61 |
// cblas_?dot is a C interface to ?dot. |
62 |
float cblas_sdot(const int N, const float *X, const int incX, const float *Y, const int incY) |
63 |
{ |
64 |
return sdot_(&N, X, &incX, Y, &incY); |
65 |
} |
66 |
double cblas_ddot(const int N, const double *X, const int incX, const double *Y, const int incY) |
67 |
{ |
68 |
return ddot_(&N, X, &incX, Y, &incY); |
69 |
} |
70 |
|
71 |
// cblas_?dotc is a C interface to ?dotc. |
72 |
_Complex float cblas_cdotc(const int N, const _Complex float *X, const int incX, const _Complex float *Y, const int incY) |
73 |
{ |
74 |
_Complex float cdotc; |
75 |
cdotc_(&cdotc,&N, X, &incX, Y, &incY); |
76 |
return cdotc; |
77 |
} |
78 |
_Complex double cblas_zdotc(const int N, const _Complex double *X, const int incX, const _Complex double *Y, const int incY) |
79 |
{ |
80 |
_Complex double zdotc; |
81 |
zdotc_(&zdotc,&N, X, &incX, Y, &incY); |
82 |
return zdotc; |
83 |
} |
84 |
|
85 |
|
86 |
// cblas_?dotu is a C interface to ?dotu. |
87 |
_Complex float cblas_cdotu(const int N, const _Complex float *X, const int incX, const _Complex float *Y, const int incY) |
88 |
{ |
89 |
_Complex float cdotu; |
90 |
cdotu_(&cdotu,&N, X, &incX, Y, &incY); |
91 |
return cdotu; |
92 |
} |
93 |
_Complex double cblas_zdotu(const int N, const _Complex double *X, const int incX, const _Complex double *Y, const int incY) |
94 |
{ |
95 |
_Complex double zdotu; |
96 |
zdotu_(&zdotu,&N, X, &incX, Y, &incY); |
97 |
return zdotu; |
98 |
} |
99 |
|
100 |
// cblas_nrm2 is a C interface to ?nrm2. |
101 |
float cblas_snrm2(const int N, const float *X, const int incX) |
102 |
{ |
103 |
return snrm2_(&N, X, &incX); |
104 |
} |
105 |
double cblas_dnrm2(const int N, const double *X, const int incX) |
106 |
{ |
107 |
return dnrm2_(&N, X, &incX); |
108 |
|
109 |
} |
110 |
float cblas_scnrm2(const int N, const _Complex float *X, const int incX) |
111 |
{ |
112 |
return scnrm2_(&N, X, &incX); |
113 |
} |
114 |
double cblas_dznrm2(const int N, const _Complex double *X, const int incX) |
115 |
{ |
116 |
return dznrm2_(&N, X, &incX); |
117 |
} |
118 |
|
119 |
// cblas_?rot is a C interface to ?rot. |
120 |
void cblas_srot(const int N, float *X, const int incX, float *Y, const int incY, const float c, const float s) |
121 |
{ |
122 |
srot_(&N, X, &incX, Y, &incY, &c, &s); |
123 |
} |
124 |
void cblas_drot(const int N, double *X, const int incX, double *Y, const int incY, const double c, const double s) |
125 |
{ |
126 |
drot_(&N, X, &incX, Y, &incY, &c, &s); |
127 |
} |
128 |
|
129 |
// cblas_?rotg is a C interface to ?rotg. |
130 |
void cblas_srotg(float *a, float *b, float *c, float *s) |
131 |
{ |
132 |
srotg_(a,b,c,s); |
133 |
} |
134 |
void cblas_drotg(double *a, double *b, double *c, double *s) |
135 |
{ |
136 |
drotg_(a,b,c,s); |
137 |
} |
138 |
|
139 |
// cblas_?rotm is a C interface to ?rotm. |
140 |
void cblas_srotm(const int N, float *X, const int incX, float *Y, const int incY, const float *P) |
141 |
{ |
142 |
srotm_(&N, X, &incX, Y, &incY, P); |
143 |
} |
144 |
void cblas_drotm(const int N, double *X, const int incX, double *Y, const int incY, const double *P) |
145 |
{ |
146 |
drotm_(&N, X, &incX, Y, &incY, P); |
147 |
} |
148 |
|
149 |
// cblas_?rotmg is a C interface to ?rotmg. |
150 |
void cblas_srotmg(float *d1, float *d2, float *b1, const float b2, float *P) |
151 |
{ |
152 |
srotmg_(d1,d2,b1,&b2,P); |
153 |
} |
154 |
void cblas_drotmg(double *d1, double *d2, double *b1, const double b2, double *P) |
155 |
{ |
156 |
drotmg_(d1,d2,b1,&b2,P); |
157 |
} |
158 |
|
159 |
// cblas_?scal is a C interface to ?scal. |
160 |
void cblas_sscal(const int N, const float alpha, float *X, const int incX) |
161 |
{ |
162 |
sscal_(&N, &alpha, X, &incX); |
163 |
} |
164 |
void cblas_dscal(const int N, const double alpha, double *X, const int incX) |
165 |
{ |
166 |
dscal_(&N, &alpha, X, &incX); |
167 |
} |
168 |
void cblas_cscal(const int N, const _Complex float alpha, _Complex float *X, const int incX) |
169 |
{ |
170 |
cscal_(&N, &alpha, X, &incX); |
171 |
} |
172 |
void cblas_zscal(const int N, const _Complex double alpha, _Complex double *X, const int incX) |
173 |
{ |
174 |
zscal_(&N, &alpha, X, &incX); |
175 |
} |
176 |
void cblas_csscal(const int N, const float alpha, _Complex float *X, const int incX) |
177 |
{ |
178 |
csscal_(&N, &alpha, X, &incX); |
179 |
} |
180 |
void cblas_zdscal(const int N, const double alpha, _Complex double *X, const int incX) |
181 |
{ |
182 |
zdscal_(&N, &alpha, X, &incX); |
183 |
} |
184 |
|
185 |
// cblas_?swap is a C interface to ?swap. |
186 |
void cblas_sswap(const int N, float *X, const int incX, float *Y, const int incY) |
187 |
{ |
188 |
sswap_(&N, X, &incX, Y, &incY); |
189 |
} |
190 |
void cblas_dswap(const int N, double *X, const int incX, double *Y, const int incY) |
191 |
{ |
192 |
dswap_(&N, X, &incX, Y, &incY); |
193 |
} |
194 |
void cblas_cswap(const int N, _Complex float *X, const int incX, _Complex float *Y, const int incY) |
195 |
{ |
196 |
cswap_(&N, X, &incX, Y, &incY); |
197 |
} |
198 |
void cblas_zswap(const int N, _Complex double *X, const int incX, _Complex double *Y, const int incY) |
199 |
{ |
200 |
zswap_(&N, X, &incX, Y, &incY); |
201 |
} |
202 |
|
203 |
// cblas_i?amax is a C interface to i?amax. |
204 |
int cblas_isamax(const int N, const float *X, const int incX) |
205 |
{ |
206 |
return isamax_(&N, X, &incX); |
207 |
} |
208 |
int cblas_idamax(const int N, const double *X, const int incX) |
209 |
{ |
210 |
return idamax_(&N, X, &incX); |
211 |
} |
212 |
int cblas_icamax(const int N, const _Complex float *X, const int incX) |
213 |
{ |
214 |
return icamax_(&N, X, &incX); |
215 |
} |
216 |
int cblas_izamax(const int N, const _Complex double *X, const int incX) |
217 |
{ |
218 |
return izamax_(&N, X, &incX); |
219 |
} |
220 |
|
221 |
// cblas_i?amin is a C interface to i?amin. |
222 |
int cblas_isamin(const int N, const float *X, const int incX) |
223 |
{ |
224 |
return isamin_(&N, X, &incX); |
225 |
} |
226 |
int cblas_idamin(const int N, const double *X, const int incX) |
227 |
{ |
228 |
return idamin_(&N, X, &incX); |
229 |
} |
230 |
int cblas_icamin(const int N, const _Complex float *X, const int incX) |
231 |
{ |
232 |
return icamin_(&N, X, &incX); |
233 |
} |
234 |
int cblas_izamin(const int N, const _Complex double *X, const int incX) |
235 |
{ |
236 |
return izamin_(&N, X, &incX); |
237 |
} |
238 |
|