1 // This file is part of Eigen, a lightweight C++ template library
4 // Copyright (C) 2009 Gael Guennebaud <gael.guennebaud@inria.fr>
6 // This Source Code Form is subject to the terms of the Mozilla
7 // Public License v. 2.0. If a copy of the MPL was not distributed
8 // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
10 #ifndef EIGEN2SUPPORT_H
11 #define EIGEN2SUPPORT_H
13 #if (!defined(EIGEN2_SUPPORT)) || (!defined(EIGEN_CORE_H))
14 #error Eigen2 support must be enabled by defining EIGEN2_SUPPORT before including any Eigen header
17 #ifndef EIGEN_NO_EIGEN2_DEPRECATED_WARNING
19 #if defined(__GNUC__) || defined(__INTEL_COMPILER) || defined(__clang__)
20 #warning "Eigen2 support is deprecated in Eigen 3.2.x and it will be removed in Eigen 3.3. (Define EIGEN_NO_EIGEN2_DEPRECATED_WARNING to disable this warning)"
22 #pragma message ("Eigen2 support is deprecated in Eigen 3.2.x and it will be removed in Eigen 3.3. (Define EIGEN_NO_EIGEN2_DEPRECATED_WARNING to disable this warning)")
25 #endif // EIGEN_NO_EIGEN2_DEPRECATED_WARNING
27 #include "src/Core/util/DisableStupidWarnings.h"
29 /** \ingroup Support_modules
30 * \defgroup Eigen2Support_Module Eigen2 support module
32 * \warning Eigen2 support is deprecated in Eigen 3.2.x and it will be removed in Eigen 3.3.
34 * This module provides a couple of deprecated functions improving the compatibility with Eigen2.
36 * To use it, define EIGEN2_SUPPORT before including any Eigen header
38 * #define EIGEN2_SUPPORT
43 #include "src/Eigen2Support/Macros.h"
44 #include "src/Eigen2Support/Memory.h"
45 #include "src/Eigen2Support/Meta.h"
46 #include "src/Eigen2Support/Lazy.h"
47 #include "src/Eigen2Support/Cwise.h"
48 #include "src/Eigen2Support/CwiseOperators.h"
49 #include "src/Eigen2Support/TriangularSolver.h"
50 #include "src/Eigen2Support/Block.h"
51 #include "src/Eigen2Support/VectorBlock.h"
52 #include "src/Eigen2Support/Minor.h"
53 #include "src/Eigen2Support/MathFunctions.h"
56 #include "src/Core/util/ReenableStupidWarnings.h"
58 // Eigen2 used to include iostream
61 #define EIGEN_USING_MATRIX_TYPEDEFS_FOR_TYPE_AND_SIZE(TypeSuffix, SizeSuffix) \
62 using Eigen::Matrix##SizeSuffix##TypeSuffix; \
63 using Eigen::Vector##SizeSuffix##TypeSuffix; \
64 using Eigen::RowVector##SizeSuffix##TypeSuffix;
66 #define EIGEN_USING_MATRIX_TYPEDEFS_FOR_TYPE(TypeSuffix) \
67 EIGEN_USING_MATRIX_TYPEDEFS_FOR_TYPE_AND_SIZE(TypeSuffix, 2) \
68 EIGEN_USING_MATRIX_TYPEDEFS_FOR_TYPE_AND_SIZE(TypeSuffix, 3) \
69 EIGEN_USING_MATRIX_TYPEDEFS_FOR_TYPE_AND_SIZE(TypeSuffix, 4) \
70 EIGEN_USING_MATRIX_TYPEDEFS_FOR_TYPE_AND_SIZE(TypeSuffix, X) \
72 #define EIGEN_USING_MATRIX_TYPEDEFS \
73 EIGEN_USING_MATRIX_TYPEDEFS_FOR_TYPE(i) \
74 EIGEN_USING_MATRIX_TYPEDEFS_FOR_TYPE(f) \
75 EIGEN_USING_MATRIX_TYPEDEFS_FOR_TYPE(d) \
76 EIGEN_USING_MATRIX_TYPEDEFS_FOR_TYPE(cf) \
77 EIGEN_USING_MATRIX_TYPEDEFS_FOR_TYPE(cd)
79 #define USING_PART_OF_NAMESPACE_EIGEN \
80 EIGEN_USING_MATRIX_TYPEDEFS \
81 using Eigen::Matrix; \
82 using Eigen::MatrixBase; \
83 using Eigen::ei_random; \
84 using Eigen::ei_real; \
85 using Eigen::ei_imag; \
86 using Eigen::ei_conj; \
87 using Eigen::ei_abs; \
88 using Eigen::ei_abs2; \
89 using Eigen::ei_sqrt; \
90 using Eigen::ei_exp; \
91 using Eigen::ei_log; \
92 using Eigen::ei_sin; \
95 #endif // EIGEN2SUPPORT_H