36 #ifndef MADNESS_TENSOR_TYPE_DATA_H__INCLUDED
37 #define MADNESS_TENSOR_TYPE_DATA_H__INCLUDED
92 #define TYPEINFO(num, T, iscmplx, mcpyok, realT,floatrealT) \
93 template<> class TensorTypeData<T> {\
96 enum {supported = true}; \
97 enum {iscomplex = iscmplx}; \
98 enum {memcopyok = mcpyok}; \
100 typedef realT scalar_type; \
101 typedef floatrealT float_scalar_type; \
103 template<> class TensorTypeFromId<num> {\
108 TYPEINFO(0,
int,
false,
true,
int,
double);
109 TYPEINFO(1,
long,
false,
true,
long,
double);
110 TYPEINFO(2,
float,
false,
true,
float,
float);
111 TYPEINFO(3,
double,
false,
true,
double,
double);
115 #ifdef HAVE_LONG_LONG
116 TYPEINFO(6,
long long,
false,
true,
long long,
double);
117 #define TENSOR_MAX_TYPE_ID 6
119 #define TENSOR_MAX_TYPE_ID 5
120 #endif // HAVE_LONG_LONG
126 "int",
"long",
"float",
"double",
"float_complex",
"double_complex"
127 #ifdef HAVE_LONG_LONG
129 #endif // HAVE_LONG_LONG
132 extern const char *tensor_type_names[];
149 template <
typename TypeData,
typename,
bool = TypeData::supported>
152 template <
typename TypeData,
typename ReturnType>
167 template <
typename leftT,
typename rightT>
170 #define SPEC(L,R,T) \
171 template <> struct TensorResultType<L,R> {typedef T type;}; \
172 template <> struct TensorResultType<R,L> {typedef T type;}
173 #define DPEC(L,R,T) \
174 template <> struct TensorResultType<L,L> {typedef T type;}
178 SPEC(
int,
float,
float);
179 SPEC(
int,
double,
double);
182 DPEC(
long,
long,
long);
183 SPEC(
long,
float,
float);
184 SPEC(
long,
double,
double);
187 DPEC(
float,
float,
float);
188 SPEC(
float,
double,
double);
191 DPEC(
double,
double,
double);
198 #ifdef HAVE_LONG_LONG
199 SPEC(
int,
long long,
long long);
200 SPEC(
long,
long long,
long long);
201 DPEC(
long long,
long long,
long long);
202 SPEC(
long long,
float,
float);
203 SPEC(
long long,
double,
double);
206 #endif // HAVE_LONG_LONG
209 #define TENSOR_RESULT_TYPE(L,R) typename TensorResultType<L,R>::type
215 #endif // MADNESS_TENSOR_TYPE_DATA_H__INCLUDED
Definition: type_data.h:61
std::complex< double > double_complex
Definition: lineplot.cc:16
This provides the reverse mapping from integer id to type name.
Definition: type_data.h:68
Definition: type_data.h:150
long type
Definition: type_data.h:70
ReturnType type
Definition: type_data.h:154
Definition: type_data.h:59
const T1 &f1 return GTEST_2_TUPLE_() T(f0, f1)
T type
Definition: type_data.h:62
TYPEINFO(0, int, false, true, int, double)
Definition: type_data.h:60
const char * tensor_type_names[]
std::complex< float > float_complex
Definition: ran.h:40
Holds machinery to set up Functions/FuncImpls using various Factories and Interfaces.
Definition: chem/atomutil.cc:45
TensorResultType::type is the type of (L op R) where op is nominally multiplication.
Definition: type_data.h:168
Traits class to specify support of numeric types.
Definition: type_data.h:56
#define TENSOR_MAX_TYPE_ID
Definition: type_data.h:119