Xped
Loading...
Searching...
No Matches
PlainInterface.hpp
Go to the documentation of this file.
1#ifndef PLAIN_INTERFACE_H_
2#define PLAIN_INTERFACE_H_
3
4#ifdef XPED_USE_ARRAY_TENSOR_LIB
5# define XPED_DEFAULT_TENSORLIB Xped::ArrayTensorLib
6#elif defined(XPED_USE_EIGEN_TENSOR_LIB)
7# define XPED_DEFAULT_TENSORLIB Xped::EigenTensorLib
8#elif defined(XPED_USE_CYCLOPS_TENSOR_LIB)
9# define XPED_DEFAULT_TENSORLIB Xped::CyclopsTensorLib
10#endif
11
12#ifdef XPED_USE_ARRAY_MATRIX_LIB
13# define XPED_DEFAULT_MATRIXLIB Xped::ArrayMatrixLib
14#elif defined(XPED_USE_EIGEN_MATRIX_LIB)
15# define XPED_DEFAULT_MATRIXLIB Xped::EigenMatrixLib
16#elif defined(XPED_USE_CYCLOPS_MATRIX_LIB)
17# define XPED_DEFAULT_MATRIXLIB Xped::CyclopsMatrixLib
18#endif
19
20#ifdef XPED_USE_ARRAY_VECTOR_LIB
21# define XPED_DEFAULT_VECTORLIB Xped::ArrayVectorLib
22#elif defined(XPED_USE_EIGEN_VECTOR_LIB)
23# define XPED_DEFAULT_VECTORLIB Xped::EigenVectorLib
24#elif defined(XPED_USE_CYCLOPS_VECTOR_LIB)
25# define XPED_DEFAULT_VECTORLIB Xped::CyclopsVectorLib
26#endif
27
29
33
34// namespace Xped {
35
36// template <typename MatrixLibrary, typename TensorLibrary, typename VectorLibrary>
37// struct PlainInterface
38// {
39// **********************************
40// ******** Matrix Interface ********
41// **********************************
42
43// constructor (rows,cols)
44// constructor with pointer, rows, cols <-- Interchange data with TensorLib!
45
46// resize(rows, cols)
47// rows(), cols()
48
49// initialization
50// setZero
51// setRandom
52// setConstant
53// setIdentity
54// static Identity
55
56// block(r,c,dr,dc) l and r value
57// leftCols
58// topRows
59// head
60// diagonal
61
62// svd
63// qr
64
65// data() <-- Interchange data with TensorLib!
66
67// kroneckerProduct
68
69// print
70
71// operations +, - , *, coefficient-wise
72
73// adjoint
74
75// **********************************
76// ******** Tensor Interface ********
77// **********************************
78
79// constructor with dim array [x] [x]
80// constructor with map [x] [x]
81
82// initialization
83// setZero [x] [x]
84// setRandom [x] [x]
85// setConstant [x] [x]
86
87// contract [x] [x]
88// shuffle [x] [x]
89
90// lvalue methods
91// shuffle ??? <-- not in Eigen
92// reshape with dims [x] [x]
93// slice [x] [x]
94
95// tensorProd [x] [x]
96
97// return dimensions [x] [x]
98// };
99
100// } // namespace Xped
101
102#if defined XPED_USE_EIGEN_TENSOR_LIB && defined XPED_USE_EIGEN_MATRIX_LIB && defined XPED_USE_EIGEN_VECTOR_LIB
104#elif defined XPED_USE_ARRAY_TENSOR_LIB && defined XPED_USE_EIGEN_MATRIX_LIB && defined XPED_USE_EIGEN_VECTOR_LIB
106#elif defined XPED_USE_CYCLOPS_TENSOR_LIB && defined XPED_USE_CYCLOPS_MATRIX_LIB && defined XPED_USE_CYCLOPS_VECTOR_LIB
108#else
109# error "You specified an invalid combination of plain matrix library, plain tensor library and plain vector library."
110#endif
111#endif