2009-05-06 15:48:28 +00:00
// This file is part of Eigen, a lightweight C++ template library
2009-05-22 20:25:33 +02:00
// for linear algebra.
2009-05-06 15:48:28 +00:00
//
// Copyright (C) 2008 Gael Guennebaud <g.gael@free.fr>
2010-02-18 20:42:38 -05:00
// Copyright (C) 2007-2010 Benoit Jacob <jacob.benoit.1@gmail.com>
2009-05-06 15:48:28 +00:00
//
// Eigen is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 3 of the License, or (at your option) any later version.
//
// Alternatively, 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 2 of
// the License, or (at your option) any later version.
//
// Eigen 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 Lesser General Public License or the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License and a copy of the GNU General Public License along with
// Eigen. If not, see <http://www.gnu.org/licenses/>.
2008-03-26 09:13:11 +00:00
#ifndef EIGEN_CORE_H
#define EIGEN_CORE_H
2008-12-16 15:17:29 +00:00
// first thing Eigen does: prevent MSVC from committing suicide
2008-12-18 20:48:02 +00:00
#include "src/Core/util/DisableMSVCWarnings.h"
2009-01-10 14:10:40 +00:00
2010-03-06 09:05:15 -05:00
// then include this file where all our macros are defined. It's really important to do it first because
// it's where we do all the alignment settings (platform detection and honoring the user's will if he
// defined e.g. EIGEN_DONT_ALIGN) so it needs to be done before we do anything with vectorization.
#include "src/Core/util/Macros.h"
// if alignment is disabled, then disable vectorization. Note: EIGEN_ALIGN is the proper check, it takes into
// account both the user's will (EIGEN_DONT_ALIGN) and our own platform checks
#if !EIGEN_ALIGN
#ifndef EIGEN_DONT_VECTORIZE
#define EIGEN_DONT_VECTORIZE
#endif
#endif
// disable vectorization on LLVM: it's not yet ready for that.
#ifdef __clang__
#ifndef EIGEN_DONT_VECTORIZE
#define EIGEN_DONT_VECTORIZE
#endif
#endif
2008-08-28 15:28:23 +00:00
#ifdef _MSC_VER
2009-01-10 14:10:40 +00:00
#include <malloc.h> // for _aligned_malloc -- need it regardless of whether vectorization is enabled
2008-12-16 15:17:29 +00:00
#if (_MSC_VER >= 1500) // 2008 or later
2009-05-04 12:13:37 +00:00
// Remember that usage of defined() in a #define is undefined by the standard.
// a user reported that in 64-bit mode, MSVC doesn't care to define _M_IX86_FP.
#if (defined(_M_IX86_FP) && (_M_IX86_FP >= 2)) || defined(_M_X64)
#define EIGEN_SSE2_ON_MSVC_2008_OR_LATER
2009-02-06 09:01:50 +00:00
#endif
2008-12-16 15:17:29 +00:00
#endif
2008-08-28 15:28:23 +00:00
#endif
2008-12-16 15:17:29 +00:00
// Remember that usage of defined() in a #define is undefined by the standard
#if (defined __SSE2__) && ( (!defined __GNUC__) || EIGEN_GNUC_AT_LEAST(4,2) )
#define EIGEN_SSE2_BUT_NOT_OLD_GCC
#endif
2008-12-15 21:20:40 +00:00
2008-12-16 15:17:29 +00:00
#ifndef EIGEN_DONT_VECTORIZE
2010-03-06 09:05:15 -05:00
2008-12-16 15:17:29 +00:00
#if defined (EIGEN_SSE2_BUT_NOT_OLD_GCC) || defined(EIGEN_SSE2_ON_MSVC_2008_OR_LATER)
2010-02-24 21:43:30 +01:00
// Defines symbols for compile-time detection of which instructions are
// used.
// EIGEN_VECTORIZE_YY is defined if and only if the instruction set YY is used
2008-08-28 15:28:23 +00:00
#define EIGEN_VECTORIZE
#define EIGEN_VECTORIZE_SSE
2010-02-24 21:43:30 +01:00
#define EIGEN_VECTORIZE_SSE2
// Detect sse3/ssse3/sse4:
// gcc and icc defines __SSE3__, ..,
// there is no way to know about this on msvc. You can define EIGEN_VECTORIZE_SSE* if you
// want to force the use of those instructions with msvc.
#ifdef __SSE3__
#define EIGEN_VECTORIZE_SSE3
#endif
#ifdef __SSSE3__
#define EIGEN_VECTORIZE_SSSE3
#endif
#ifdef __SSE4_1__
#define EIGEN_VECTORIZE_SSE4_1
#endif
#ifdef __SSE4_2__
#define EIGEN_VECTORIZE_SSE4_2
#endif
// include files
2008-08-28 15:28:23 +00:00
#include <emmintrin.h>
#include <xmmintrin.h>
2010-02-24 21:43:30 +01:00
#ifdef EIGEN_VECTORIZE_SSE3
2008-08-28 15:28:23 +00:00
#include <pmmintrin.h>
#endif
2010-02-24 21:43:30 +01:00
#ifdef EIGEN_VECTORIZE_SSSE3
2008-08-28 15:28:23 +00:00
#include <tmmintrin.h>
#endif
2010-02-24 21:43:30 +01:00
#ifdef EIGEN_VECTORIZE_SSE4_1
2009-11-24 15:12:43 -05:00
#include <smmintrin.h>
#endif
2010-02-24 21:43:30 +01:00
#ifdef EIGEN_VECTORIZE_SSE4_2
2009-11-24 15:12:43 -05:00
#include <nmmintrin.h>
#endif
2008-12-16 15:17:29 +00:00
#elif defined __ALTIVEC__
2008-08-28 15:28:23 +00:00
#define EIGEN_VECTORIZE
#define EIGEN_VECTORIZE_ALTIVEC
#include <altivec.h>
2008-12-16 15:17:29 +00:00
// We need to #undef all these ugly tokens defined in <altivec.h>
2008-08-28 15:28:23 +00:00
// => use __vector instead of vector
#undef bool
#undef vector
#undef pixel
2010-03-03 11:25:41 -06:00
#elif defined __ARM_NEON__
#define EIGEN_VECTORIZE
#define EIGEN_VECTORIZE_NEON
2010-03-03 12:15:34 -06:00
#include <arm_neon.h>
2008-08-28 15:28:23 +00:00
#endif
#endif
2010-02-22 11:08:37 +01:00
#ifdef _OPENMP
#define EIGEN_HAS_OPENMP
#endif
#ifdef EIGEN_HAS_OPENMP
#include <omp.h>
#endif
2010-02-28 14:32:57 +01:00
#include <cerrno>
2008-08-28 15:28:23 +00:00
#include <cstdlib>
#include <cmath>
#include <complex>
#include <cassert>
#include <functional>
2010-02-27 19:04:22 -05:00
#include <iosfwd>
2008-08-03 15:44:06 +00:00
#include <cstring>
2008-08-21 13:17:21 +00:00
#include <string>
2009-01-09 00:55:53 +00:00
#include <limits>
2009-07-10 16:10:03 +02:00
// for min/max:
#include <algorithm>
2008-05-03 12:21:23 +00:00
2010-02-27 19:04:22 -05:00
// for outputting debug info
#ifdef EIGEN_DEBUG_ASSIGN
#include<iostream>
#endif
2008-12-16 15:17:29 +00:00
#if (defined(_CPPUNWIND) || defined(__EXCEPTIONS)) && !defined(EIGEN_NO_EXCEPTIONS)
#define EIGEN_EXCEPTIONS
#endif
#ifdef EIGEN_EXCEPTIONS
#include <new>
2008-12-15 15:54:33 +00:00
#endif
2009-01-19 13:23:41 +00:00
// this needs to be done after all possible windows C header includes and before any Eigen source includes
// (system C++ includes are supposed to be able to deal with this already):
// windows.h defines min and max macros which would make Eigen fail to compile.
#if defined(min) || defined(max)
#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.
#endif
2009-09-19 19:14:28 -04:00
// defined in bits/termios.h
#undef B0
2007-12-28 16:20:00 +00:00
namespace Eigen {
2010-02-25 06:43:45 -05:00
inline static const char *SimdInstructionSetsInUse(void) {
2010-02-24 21:52:08 +01:00
#if defined(EIGEN_VECTORIZE_SSE4_2)
2010-02-25 06:43:45 -05:00
return "SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2";
2010-02-25 05:31:22 +01:00
#elif defined(EIGEN_VECTORIZE_SSE4_1)
2010-02-25 06:43:45 -05:00
return "SSE, SSE2, SSE3, SSSE3, SSE4.1";
2010-02-24 21:52:08 +01:00
#elif defined(EIGEN_VECTORIZE_SSSE3)
2010-02-25 06:43:45 -05:00
return "SSE, SSE2, SSE3, SSSE3";
2010-02-24 21:52:08 +01:00
#elif defined(EIGEN_VECTORIZE_SSE3)
2010-02-25 06:43:45 -05:00
return "SSE, SSE2, SSE3";
2010-02-24 21:52:08 +01:00
#elif defined(EIGEN_VECTORIZE_SSE2)
2010-02-25 06:43:45 -05:00
return "SSE, SSE2";
2010-02-24 21:52:08 +01:00
#elif defined(EIGEN_VECTORIZE_ALTIVEC)
2010-02-25 06:43:45 -05:00
return "AltiVec";
2010-03-03 11:25:41 -06:00
#elif defined(EIGEN_VECTORIZE_NEON)
return "ARM NEON";
2010-02-24 21:52:08 +01:00
#else
return "None";
#endif
}
2010-02-12 09:03:16 -05:00
// we use size_t frequently and we'll never remember to prepend it with std:: everytime just to
// ensure QNX/QCC support
using std::size_t;
2008-08-26 19:12:23 +00:00
/** \defgroup Core_Module Core module
2008-08-26 23:07:33 +00:00
* This is the main module of Eigen providing dense matrix and vector support
* (both fixed and dynamic size) with all the features corresponding to a BLAS library
* and much more...
2008-08-26 19:12:23 +00:00
*
* \code
* #include <Eigen/Core>
* \endcode
*/
2009-11-17 16:04:19 +01:00
/** The type used to identify a dense storage. */
struct Dense {};
2008-08-28 15:28:23 +00:00
#include "src/Core/util/Constants.h"
#include "src/Core/util/ForwardDeclarations.h"
#include "src/Core/util/Meta.h"
#include "src/Core/util/XprHelper.h"
#include "src/Core/util/StaticAssert.h"
2008-08-26 19:12:23 +00:00
#include "src/Core/util/Memory.h"
2008-08-28 00:33:58 +00:00
2007-12-28 16:20:00 +00:00
#include "src/Core/NumTraits.h"
#include "src/Core/MathFunctions.h"
2008-08-26 19:12:23 +00:00
#include "src/Core/GenericPacketMath.h"
2008-05-12 08:30:42 +00:00
2008-05-05 17:19:47 +00:00
#if defined EIGEN_VECTORIZE_SSE
2008-12-16 15:17:29 +00:00
#include "src/Core/arch/SSE/PacketMath.h"
2009-03-27 14:41:46 +00:00
#include "src/Core/arch/SSE/MathFunctions.h"
2008-05-05 17:19:47 +00:00
#elif defined EIGEN_VECTORIZE_ALTIVEC
2008-12-16 15:17:29 +00:00
#include "src/Core/arch/AltiVec/PacketMath.h"
2010-03-03 11:25:41 -06:00
#elif defined EIGEN_VECTORIZE_NEON
#include "src/Core/arch/NEON/PacketMath.h"
2008-05-05 17:19:47 +00:00
#endif
2010-03-03 18:47:58 +01:00
#include "src/Core/arch/Default/Settings.h"
2008-05-12 17:34:46 +00:00
2008-04-09 12:31:55 +00:00
#include "src/Core/Functors.h"
2009-12-04 23:17:14 +01:00
#include "src/Core/DenseBase.h"
2007-12-28 16:20:00 +00:00
#include "src/Core/MatrixBase.h"
2010-02-20 15:26:02 +01:00
#include "src/Core/EigenBase.h"
2007-12-28 16:20:00 +00:00
#include "src/Core/Coeffs.h"
2008-12-16 15:17:29 +00:00
2008-06-02 19:29:23 +00:00
#ifndef EIGEN_PARSED_BY_DOXYGEN // work around Doxygen bug triggered by Assign.h r814874
// at least confirmed with Doxygen 1.5.5 and 1.5.6
2008-12-16 15:17:29 +00:00
#include "src/Core/Assign.h"
2008-06-02 19:29:23 +00:00
#endif
2008-12-16 15:17:29 +00:00
2009-08-15 22:19:29 +02:00
#include "src/Core/util/BlasUtil.h"
2008-02-29 10:55:53 +00:00
#include "src/Core/MatrixStorage.h"
2008-05-28 05:14:16 +00:00
#include "src/Core/NestByValue.h"
2009-11-20 16:30:14 +01:00
#include "src/Core/ForceAlignedAccess.h"
2009-03-04 13:00:00 +00:00
#include "src/Core/ReturnByValue.h"
2009-08-15 18:35:51 +02:00
#include "src/Core/NoAlias.h"
2009-12-17 13:37:00 +01:00
#include "src/Core/DenseStorageBase.h"
2007-12-28 16:20:00 +00:00
#include "src/Core/Matrix.h"
2009-11-20 15:39:38 +01:00
#include "src/Core/SelfCwiseBinaryOp.h"
2008-02-29 14:35:14 +00:00
#include "src/Core/CwiseBinaryOp.h"
2008-03-03 10:52:44 +00:00
#include "src/Core/CwiseUnaryOp.h"
2008-04-24 18:35:39 +00:00
#include "src/Core/CwiseNullaryOp.h"
2009-05-20 15:41:23 +02:00
#include "src/Core/CwiseUnaryView.h"
2008-07-09 22:30:18 +00:00
#include "src/Core/Dot.h"
2009-07-17 16:22:39 +02:00
#include "src/Core/StableNorm.h"
2008-08-09 18:41:24 +00:00
#include "src/Core/MapBase.h"
2010-02-18 20:42:38 -05:00
#include "src/Core/Stride.h"
2008-08-09 18:41:24 +00:00
#include "src/Core/Map.h"
2007-12-28 16:20:00 +00:00
#include "src/Core/Block.h"
2009-07-05 11:33:55 +02:00
#include "src/Core/VectorBlock.h"
2007-12-28 16:20:00 +00:00
#include "src/Core/Minor.h"
#include "src/Core/Transpose.h"
#include "src/Core/DiagonalMatrix.h"
2009-05-10 16:24:39 +00:00
#include "src/Core/Diagonal.h"
2009-06-28 21:27:37 +02:00
#include "src/Core/DiagonalProduct.h"
2009-11-15 21:12:15 -05:00
#include "src/Core/PermutationMatrix.h"
2008-03-16 14:36:25 +00:00
#include "src/Core/Redux.h"
#include "src/Core/Visitor.h"
2007-12-28 16:20:00 +00:00
#include "src/Core/Fuzzy.h"
#include "src/Core/IO.h"
2008-01-15 13:55:47 +00:00
#include "src/Core/Swap.h"
2008-03-08 19:02:24 +00:00
#include "src/Core/CommaInitializer.h"
2010-02-04 18:28:09 +01:00
#include "src/Core/Flagged.h"
2009-08-04 16:54:17 +02:00
#include "src/Core/ProductBase.h"
2009-03-05 10:25:22 +00:00
#include "src/Core/Product.h"
2009-07-06 23:43:20 +02:00
#include "src/Core/TriangularMatrix.h"
#include "src/Core/SelfAdjointView.h"
#include "src/Core/SolveTriangular.h"
2010-02-22 11:08:37 +01:00
#include "src/Core/products/Parallelizer.h"
2010-02-09 11:05:39 +01:00
#include "src/Core/products/CoeffBasedProduct.h"
2009-08-06 12:20:02 +02:00
#include "src/Core/products/GeneralBlockPanelKernel.h"
#include "src/Core/products/GeneralMatrixVector.h"
#include "src/Core/products/GeneralMatrixMatrix.h"
#include "src/Core/products/SelfadjointMatrixVector.h"
#include "src/Core/products/SelfadjointMatrixMatrix.h"
2009-07-23 19:01:20 +02:00
#include "src/Core/products/SelfadjointProduct.h"
2009-07-11 21:14:59 +02:00
#include "src/Core/products/SelfadjointRank2Update.h"
2009-07-13 13:17:55 +02:00
#include "src/Core/products/TriangularMatrixVector.h"
2009-07-27 10:27:01 +02:00
#include "src/Core/products/TriangularMatrixMatrix.h"
2009-08-06 12:20:02 +02:00
#include "src/Core/products/TriangularSolverMatrix.h"
2009-07-14 23:27:37 +02:00
#include "src/Core/BandMatrix.h"
2008-05-31 23:21:49 +00:00
2010-01-20 20:51:01 +01:00
#include "src/Array/Functors.h"
#include "src/Array/BooleanRedux.h"
#include "src/Array/Select.h"
#include "src/Array/VectorwiseOp.h"
#include "src/Array/Random.h"
#include "src/Array/Norms.h"
#include "src/Array/Replicate.h"
#include "src/Array/Reverse.h"
#include "src/Array/ArrayBase.h"
#include "src/Array/ArrayWrapper.h"
#include "src/Array/Array.h"
2007-12-28 16:20:00 +00:00
} // namespace Eigen
2008-03-03 10:52:44 +00:00
2010-01-27 23:23:59 +01:00
#include "src/Array/GlobalFunctions.h"
2008-12-18 20:48:02 +00:00
#include "src/Core/util/EnableMSVCWarnings.h"
2010-01-07 21:15:32 +01:00
#ifdef EIGEN2_SUPPORT
#include "Eigen2Support"
#endif
2008-03-26 09:13:11 +00:00
#endif // EIGEN_CORE_H