Core
1#ifndef EIGEN_CORE_H
2#define EIGEN_CORE_H
3
4// first thing Eigen does: prevent MSVC from committing suicide
5#include "src/Core/util/DisableMSVCWarnings.h"
6
7#ifdef _MSC_VER
8 #include <malloc.h> // for _aligned_malloc -- need it regardless of whether vectorization is enabled
9 #if (_MSC_VER >= 1500) // 2008 or later
10 // Remember that usage of defined() in a #define is undefined by the standard.
11 // a user reported that in 64-bit mode, MSVC doesn't care to define _M_IX86_FP.
12 #if (defined(_M_IX86_FP) && (_M_IX86_FP >= 2)) || defined(_M_X64)
13 #define EIGEN_SSE2_ON_MSVC_2008_OR_LATER
14 #endif
15 #endif
16#endif
17
18// FIXME: this check should not be against __QNXNTO__, which is also defined
19// while compiling with GCC for QNX target. Better solution is welcome!
20#if defined(__GNUC__) && !defined(__QNXNTO__)
21 #define EIGEN_GNUC_AT_LEAST(x,y) ((__GNUC__>=x && __GNUC_MINOR__>=y) || __GNUC__>x)
22#else
23 #define EIGEN_GNUC_AT_LEAST(x,y) 0
24#endif
25
26// Remember that usage of defined() in a #define is undefined by the standard
27#if (defined __SSE2__) && ( (!defined __GNUC__) || EIGEN_GNUC_AT_LEAST(4,2) )
28 #define EIGEN_SSE2_BUT_NOT_OLD_GCC
29#endif
30
31#if !defined(EIGEN_DONT_VECTORIZE) && !defined(EIGEN_DONT_ALIGN)
32 #if defined (EIGEN_SSE2_BUT_NOT_OLD_GCC) || defined(EIGEN_SSE2_ON_MSVC_2008_OR_LATER)
33 #define EIGEN_VECTORIZE
34 #define EIGEN_VECTORIZE_SSE
35 #include <emmintrin.h>
36 #include <xmmintrin.h>
37 #ifdef __SSE3__
38 #include <pmmintrin.h>
39 #endif
40 #ifdef __SSSE3__
41 #include <tmmintrin.h>
42 #endif
43 #elif defined __ALTIVEC__
44 #define EIGEN_VECTORIZE
45 #define EIGEN_VECTORIZE_ALTIVEC
46 #include <altivec.h>
47 // We need to #undef all these ugly tokens defined in <altivec.h>
48 // => use __vector instead of vector
49 #undef bool
50 #undef vector
51 #undef pixel
52 #endif
53#endif
54
55#include <cstddef>
56#include <cstdlib>
57#include <cmath>
58#include <complex>
59#include <cassert>
60#include <functional>
61#include <iostream>
62#include <cstring>
63#include <string>
64#include <limits>
65
66#if (defined(_CPPUNWIND) || defined(__EXCEPTIONS)) && !defined(EIGEN_NO_EXCEPTIONS)
67 #define EIGEN_EXCEPTIONS
68#endif
69
70#ifdef EIGEN_EXCEPTIONS
71 #include <new>
72#endif
73
74// this needs to be done after all possible windows C header includes and before any Eigen source includes
75// (system C++ includes are supposed to be able to deal with this already):
76// windows.h defines min and max macros which would make Eigen fail to compile.
77#if defined(min) || defined(max)
78#error The preprocessor symbols 'min' or 'max' are defined. If you are compiling on Windows, do #define NOMINMAX to prevent windows.h from defining these symbols.
79#endif
80
81namespace Eigen {
82
83// we use size_t frequently and we'll never remember to prepend it with std:: everytime just to
84// ensure QNX/QCC support
85using std::size_t;
86
87/** \defgroup Core_Module Core module
88 * This is the main module of Eigen providing dense matrix and vector support
89 * (both fixed and dynamic size) with all the features corresponding to a BLAS library
90 * and much more...
91 *
92 * \code
93 * #include <Eigen/Core>
94 * \endcode
95 */
96
97#include "src/Core/util/Macros.h"
98#include "src/Core/util/Constants.h"
99#include "src/Core/util/ForwardDeclarations.h"
100#include "src/Core/util/Meta.h"
101#include "src/Core/util/XprHelper.h"
102#include "src/Core/util/StaticAssert.h"
103#include "src/Core/util/Memory.h"
104
105#include "src/Core/NumTraits.h"
106#include "src/Core/MathFunctions.h"
107#include "src/Core/GenericPacketMath.h"
108
109#if defined EIGEN_VECTORIZE_SSE
110 #include "src/Core/arch/SSE/PacketMath.h"
111#elif defined EIGEN_VECTORIZE_ALTIVEC
112 #include "src/Core/arch/AltiVec/PacketMath.h"
113#endif
114
115#ifndef EIGEN_CACHEFRIENDLY_PRODUCT_THRESHOLD
116#define EIGEN_CACHEFRIENDLY_PRODUCT_THRESHOLD 16
117#endif
118
119#include "src/Core/Functors.h"
120#include "src/Core/MatrixBase.h"
121#include "src/Core/Coeffs.h"
122
123#ifndef EIGEN_PARSED_BY_DOXYGEN // work around Doxygen bug triggered by Assign.h r814874
124 // at least confirmed with Doxygen 1.5.5 and 1.5.6
125 #include "src/Core/Assign.h"
126#endif
127
128#include "src/Core/MatrixStorage.h"
129#include "src/Core/NestByValue.h"
130#include "src/Core/Flagged.h"
131#include "src/Core/Matrix.h"
132#include "src/Core/Cwise.h"
133#include "src/Core/CwiseBinaryOp.h"
134#include "src/Core/CwiseUnaryOp.h"
135#include "src/Core/CwiseNullaryOp.h"
136#include "src/Core/Dot.h"
137#include "src/Core/Product.h"
138#include "src/Core/DiagonalProduct.h"
139#include "src/Core/SolveTriangular.h"
140#include "src/Core/MapBase.h"
141#include "src/Core/Map.h"
142#include "src/Core/Block.h"
143#include "src/Core/Minor.h"
144#include "src/Core/Transpose.h"
145#include "src/Core/DiagonalMatrix.h"
146#include "src/Core/DiagonalCoeffs.h"
147#include "src/Core/Sum.h"
148#include "src/Core/Redux.h"
149#include "src/Core/Visitor.h"
150#include "src/Core/Fuzzy.h"
151#include "src/Core/IO.h"
152#include "src/Core/Swap.h"
153#include "src/Core/CommaInitializer.h"
154#include "src/Core/Part.h"
155#include "src/Core/CacheFriendlyProduct.h"
156
157} // namespace Eigen
158
159#include "src/Core/util/EnableMSVCWarnings.h"
160
161#endif // EIGEN_CORE_H