1 #include <cxxblas/cxxblas.cxx>
 2 
 3 extern "C" {
 4 
 5 #ifndef COMPLEX_FLOAT1
 6     typedef CBLAS_FLOAT                 CXXBLAS_FLOAT;
 7 #else
 8     typedef std::complex<CBLAS_FLOAT>   CXXBLAS_FLOAT;
 9 #endif
10 
11     CBLAS_FLOAT
12     CBLAS_NAME(CBLAS_INT n,
13                const CBLAS_FLOAT *_x, CBLAS_INT incX,
14                const CBLAS_FLOAT *_y, CBLAS_INT incY)
15 #ifdef CREATE_CBLAS
16     {
17         const CXXBLAS_FLOAT *x = reinterpret_cast<const CXXBLAS_FLOAT *>(_x);
18         const CXXBLAS_FLOAT *y = reinterpret_cast<const CXXBLAS_FLOAT *>(_y);
19 
20         CBLAS_FLOAT result;
21         cxxblas::dot<CBLAS_INT,
22                      CXXBLAS_FLOAT,
23                      CBLAS_FLOAT>(n, x, incX, y, incY, result);
24         return result;
25     }
26 #else
27     ;
28 #endif // CREATE_CBLAS
29 
30 #ifdef CREATE_BLAS
31     CBLAS_FLOAT
32     BLAS_NAME(CBLAS_INT *_n,
33               const CBLAS_FLOAT *x, CBLAS_INT *_incX,
34               const CBLAS_FLOAT *y, CBLAS_INT *_incY)
35     {
36 
37         CBLAS_INT n    = *_n;
38         CBLAS_INT incX = *_incX;
39         CBLAS_INT incY = *_incY;
40 
41         // the blas interface calls the cblas interface
42         // so any blas-test will also test the cblas-interface
43         return CBLAS_NAME(n, x, incX, y, incY);
44     }
45 #endif // CREATE_BLAS
46 
47 // extern "C"