flexiblesusy is hosted by Hepforge, IPPP Durham
FlexibleSUSY
eigen_tensor.hpp
Go to the documentation of this file.
1// ====================================================================
2// This file is part of FlexibleSUSY.
3//
4// FlexibleSUSY is free software: you can redistribute it and/or modify
5// it under the terms of the GNU General Public License as published
6// by the Free Software Foundation, either version 3 of the License,
7// or (at your option) any later version.
8//
9// FlexibleSUSY is distributed in the hope that it will be useful, but
10// WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12// General Public License for more details.
13//
14// You should have received a copy of the GNU General Public License
15// along with FlexibleSUSY. If not, see
16// <http://www.gnu.org/licenses/>.
17// ====================================================================
18
19#ifndef EIGEN_TENSOR_H
20#define EIGEN_TENSOR_H
21
22#include <Eigen/Core>
23
24// disable Eigen tensor module as it does not compiler with clang 5.0
25#if 0 && EIGEN_VERSION_AT_LEAST(3,3,0)
26
27#include <unsupported/Eigen/CXX11/Tensor>
28
29namespace flexiblesusy {
30
31template <class Scalar, int N, int M, int K>
32class ZeroTensor3 : public Eigen::TensorFixedSize<Scalar, Eigen::Sizes<N,M,K> > {
33public:
34 using Base = Eigen::TensorFixedSize<Scalar, Eigen::Sizes<N,M,K>>;
35 using Base::setZero;
36
37 ZeroTensor3() : Base() {
38 setZero();
39 }
40};
41
42template <class Scalar, int N, int M, int K, int L>
43class ZeroTensor4 : public Eigen::TensorFixedSize<Scalar, Eigen::Sizes<N,M,K,L> > {
44public:
45 using Base = Eigen::TensorFixedSize<Scalar, Eigen::Sizes<N,M,K,L>>;
46 using Base::setZero;
47
48 ZeroTensor4() : Base() {
49 setZero();
50 }
51};
52
53} // namespace flexiblesusy
54
55#else
56
57namespace flexiblesusy {
58
59template <class Scalar, int N, int M, int K>
61
62template <class Scalar, int N, int M, int K, int L>
64
65} // namespace flexiblesusy
66
67#endif
68
69#endif