NiHu  2.0
eigen_utils.hpp
Go to the documentation of this file.
1 // This file is a part of NiHu, a C++ BEM template library.
2 //
3 // Copyright (C) 2012-2014 Peter Fiala <fiala@hit.bme.hu>
4 // Copyright (C) 2012-2014 Peter Rucz <rucz@hit.bme.hu>
5 //
6 // This program is free software: you can redistribute it and/or modify
7 // it under the terms of the GNU General Public License as published by
8 // the Free Software Foundation, either version 3 of the License, or
9 // (at your option) any later version.
10 //
11 // This program is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
15 //
16 // You should have received a copy of the GNU General Public License
17 // along with this program. If not, see <http://www.gnu.org/licenses/>.
18 
25 #ifndef EIGEN_UTILS_HPP_INCLUDED
26 #define EIGEN_UTILS_HPP_INCLUDED
27 
28 #include <Eigen/Geometry>
29 #include <Eigen/Dense>
30 #include <Eigen/StdVector>
31 
32 #include <type_traits>
33 
34 namespace NiHu
35 {
36 
40 template <class T>
42 {
43  typedef std::vector<T, Eigen::aligned_allocator<T> > type;
44 };
45 
50 template <class T>
51 struct is_eigen : std::is_base_of<
52  Eigen::EigenBase<typename std::decay<T>::type>,
53  typename std::decay<T>::type
54 > {};
55 
56 } // end of namespace NiHu
57 
58 #endif // EIGEN_UTILS_HPP_INCLUDED
59 
NiHu::eigen_std_vector
Convert T to an std::vector<T> with Eigen allocator.
Definition: eigen_utils.hpp:41
NiHu::is_eigen
metafunction determining if its argument is an Eigen expression or not
Definition: eigen_utils.hpp:51