20 #ifndef TENSOR_TENSOR_BLAS_H
21 #define TENSOR_TENSOR_BLAS_H
23 #include <tensor/config.h>
24 #include <tensor/tensor.h>
27 # include <mkl_cblas.h>
28 # include <mkl_lapack.h>
32 #ifdef TENSOR_USE_ACML
36 #ifdef TENSOR_USE_VECLIB
37 # if defined(HAVE_VECLIB_CBLAS_H)
38 # include <vecLib/cblas.h>
39 # include <vecLib/clapack.h>
41 # error "Missing cblas.h"
43 # define F77NAME(x) x##_
46 #ifdef TENSOR_USE_ATLAS
48 # ifdef HAVE_ATLAS_CBLAS_H
49 # include <atlas/cblas.h>
50 # include <atlas/clapack.h>
51 # elif defined(HAVE_CBLAS_H)
55 # error "Header cblas.h not found"
58 # define F77NAME(x) x##_
61 #ifdef TENSOR_USE_CBLAPACK
62 # include <cblapack.h>
63 # define F77NAME(x) x##_
66 #ifdef TENSOR_USE_ESSL
71 #if !defined(TENSOR_USE_VECLIB) && !defined(TENSOR_USE_ATLAS) && !defined(TENSOR_USE_MKL) && !defined(TENSOR_USE_ESSL) && !defined(TENSOR_USE_CBLAPACK) && !defined(TENSOR_USE_ACML)
72 # error "We need to use one of these libraries: VecLib, Atlas, MKL, ESSL, CBLAPACK"
77 #ifdef TENSOR_USE_VECLIB
78 typedef __CLPK_integer integer;
79 typedef __CLPK_doublecomplex cdouble;
81 #ifdef TENSOR_USE_ATLAS
83 typedef struct {
double re, im; } cdouble;
84 typedef int __CLPK_integer;
85 typedef double __CLPK_doublereal;
86 typedef cdouble __CLPK_doublecomplex;
89 typedef MKL_INT integer;
90 typedef MKL_Complex16 cdouble;
92 #ifdef TENSOR_USE_ACML
94 typedef doublecomplex cdouble;
95 typedef int __CLPK_integer;
96 typedef double __CLPK_doublereal;
97 typedef cdouble __CLPK_doublecomplex;
99 #ifdef TENSOR_USE_ESSL
100 typedef _ESVINT integer;
101 typedef _ESVCOM cdouble;
102 typedef _ESVINT __CLPK_integer;
103 typedef double __CLPK_doublereal;
104 typedef _ESVCOM __CLPK_doublecomplex;
106 #ifdef TENSOR_USE_CBLAPACK
107 typedef integer integer;
108 typedef doublecomplex cdouble;
109 typedef integer __CLPK_integer;
110 typedef double __CLPK_doublereal;
111 typedef cdouble __CLPK_doublecomplex;
114 #if defined(TENSOR_USE_VECLIB) || defined(TENSOR_USE_ATLAS) || defined(TENSOR_USE_MKL) || defined(TENSOR_USE_CBLAPACK)
115 inline CBLAS_TRANSPOSE char_to_op(
char op)
120 return CblasConjTrans;
126 return static_cast<const double*
>(A.
begin());
130 return static_cast<const cdouble *
>((
void*)A.
begin());
134 return static_cast<double*
>(A.
begin());
138 return static_cast<cdouble *
>((
void*)A.
begin());
141 inline double real(cdouble &z) {
142 return tensor::real(*static_cast<tensor::cdouble *>((
void*)&z));
147 #endif // TENSOR_TENSOR_BLAS_H
Real Tensor with elements of type "double".
iterator begin()
Iterator at the beginning.
Complex Tensor with elements of type "cdouble".