forked from Expander/FlexibleSUSY
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
as long as it is not supported by Eigen Conflicts: src/wrappers.hpp
- Loading branch information
Alexander Voigt
authored and
Alexander Voigt
committed
Jul 22, 2016
1 parent
a757413
commit 57d5248
Showing
3 changed files
with
74 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
// ==================================================================== | ||
// This file is part of FlexibleSUSY. | ||
// | ||
// FlexibleSUSY is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published | ||
// by the Free Software Foundation, either version 3 of the License, | ||
// or (at your option) any later version. | ||
// | ||
// FlexibleSUSY is distributed in the hope that it will be useful, but | ||
// WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
// General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU General Public License | ||
// along with FlexibleSUSY. If not, see | ||
// <http://www.gnu.org/licenses/>. | ||
// ==================================================================== | ||
|
||
#ifndef EIGEN_TENSOR_H | ||
#define EIGEN_TENSOR_H | ||
|
||
#include <Eigen/Core> | ||
|
||
#if EIGEN_VERSION_AT_LEAST(3,3,0) | ||
|
||
#include <unsupported/Eigen/CXX11/Tensor> | ||
|
||
namespace flexiblesusy { | ||
|
||
template <class Scalar, int N, int M, int K> | ||
class ZeroTensor3 : public Eigen::TensorFixedSize<Scalar, Eigen::Sizes<N,M,K> > { | ||
typedef Eigen::TensorFixedSize<Scalar, Eigen::Sizes<N,M,K> > Base; | ||
|
||
using Base::setZero; | ||
|
||
ZeroTensor3() : Base() { | ||
setZero(); | ||
} | ||
}; | ||
|
||
template <class Scalar, int N, int M, int K, int L> | ||
class ZeroTensor4 : public Eigen::TensorFixedSize<Scalar, Eigen::Sizes<N,M,K,L> > { | ||
typedef Eigen::TensorFixedSize<Scalar, Eigen::Sizes<N,M,K,L> > Base; | ||
|
||
using Base::setZero; | ||
|
||
ZeroTensor4() : Base() { | ||
setZero(); | ||
} | ||
}; | ||
|
||
} // namespace flexiblesusy | ||
|
||
#else | ||
|
||
namespace flexiblesusy { | ||
|
||
template <class Scalar, int N, int M, int K> | ||
class ZeroTensor3; | ||
|
||
template <class Scalar, int N, int M, int K, int L> | ||
class ZeroTensor4; | ||
|
||
} // namespace flexiblesusy | ||
|
||
#endif | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters