diff --git a/.hgignore b/.hgignore
index 9432702ba..3f08ce8d5 100644
--- a/.hgignore
+++ b/.hgignore
@@ -12,7 +12,7 @@ core
core.*
*.bak
*~
-build
+build*
*.moc.*
*.moc
ui_*
@@ -21,4 +21,4 @@ tags
.*.swp
activity.png
*.out
-*.php*
\ No newline at end of file
+*.php*
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3a23479d7..a7d4089c0 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -3,18 +3,18 @@ project(Eigen)
cmake_minimum_required(VERSION 2.6.2)
if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
- message(FATAL_ERROR "In-source builds not allowed. Please make a new directory (called a build directory) and run CMake from there.")
+ message(FATAL_ERROR "In-source builds not allowed. Please make a new directory (called a build directory) and run CMake from there. (you may need to remove CMakeCache.txt ")
endif()
# automatically parse the version number
-file(READ "${CMAKE_SOURCE_DIR}/Eigen/src/Core/util/Macros.h" _eigen2_version_header)
-string(REGEX MATCH "define[ \t]+EIGEN_WORLD_VERSION[ \t]+([0-9]+)" _eigen2_world_version_match "${_eigen2_version_header}")
-set(EIGEN2_WORLD_VERSION "${CMAKE_MATCH_1}")
-string(REGEX MATCH "define[ \t]+EIGEN_MAJOR_VERSION[ \t]+([0-9]+)" _eigen2_major_version_match "${_eigen2_version_header}")
-set(EIGEN2_MAJOR_VERSION "${CMAKE_MATCH_1}")
-string(REGEX MATCH "define[ \t]+EIGEN_MINOR_VERSION[ \t]+([0-9]+)" _eigen2_minor_version_match "${_eigen2_version_header}")
-set(EIGEN2_MINOR_VERSION "${CMAKE_MATCH_1}")
-set(EIGEN_VERSION_NUMBER ${EIGEN2_WORLD_VERSION}.${EIGEN2_MAJOR_VERSION}.${EIGEN2_MINOR_VERSION})
+file(READ "${CMAKE_SOURCE_DIR}/Eigen/src/Core/util/Macros.h" _eigen_version_header)
+string(REGEX MATCH "define[ \t]+EIGEN_WORLD_VERSION[ \t]+([0-9]+)" _eigen_world_version_match "${_eigen_version_header}")
+set(EIGEN_WORLD_VERSION "${CMAKE_MATCH_1}")
+string(REGEX MATCH "define[ \t]+EIGEN_MAJOR_VERSION[ \t]+([0-9]+)" _eigen_major_version_match "${_eigen_version_header}")
+set(EIGEN_MAJOR_VERSION "${CMAKE_MATCH_1}")
+string(REGEX MATCH "define[ \t]+EIGEN_MINOR_VERSION[ \t]+([0-9]+)" _eigen_minor_version_match "${_eigen_version_header}")
+set(EIGEN_MINOR_VERSION "${CMAKE_MATCH_1}")
+set(EIGEN_VERSION_NUMBER ${EIGEN_WORLD_VERSION}.${EIGEN_MAJOR_VERSION}.${EIGEN_MINOR_VERSION})
# if the mercurial program is absent, this will leave the EIGEN_HG_CHANGESET string empty,
# but won't stop CMake.
@@ -63,31 +63,43 @@ if(CMAKE_COMPILER_IS_GNUCXX)
if(NOT EIGEN_TEST_LIB)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic")
- endif(NOT EIGEN_TEST_LIB)
+ endif()
option(EIGEN_TEST_SSE2 "Enable/Disable SSE2 in tests/examples" OFF)
if(EIGEN_TEST_SSE2)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse2")
message("Enabling SSE2 in tests/examples")
- endif(EIGEN_TEST_SSE2)
+ endif()
option(EIGEN_TEST_SSE3 "Enable/Disable SSE3 in tests/examples" OFF)
if(EIGEN_TEST_SSE3)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse3")
message("Enabling SSE3 in tests/examples")
- endif(EIGEN_TEST_SSE3)
+ endif()
option(EIGEN_TEST_SSSE3 "Enable/Disable SSSE3 in tests/examples" OFF)
if(EIGEN_TEST_SSSE3)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mssse3")
message("Enabling SSSE3 in tests/examples")
- endif(EIGEN_TEST_SSSE3)
+ endif()
+
+ option(EIGEN_TEST_SSE4_1 "Enable/Disable SSE4.1 in tests/examples" OFF)
+ if(EIGEN_TEST_SSE4_1)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse4.1")
+ message("Enabling SSE4.1 in tests/examples")
+ endif()
+
+ option(EIGEN_TEST_SSE4_2 "Enable/Disable SSE4.2 in tests/examples" OFF)
+ if(EIGEN_TEST_SSE4_2)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse4.2")
+ message("Enabling SSE4.2 in tests/examples")
+ endif()
option(EIGEN_TEST_ALTIVEC "Enable/Disable altivec in tests/examples" OFF)
if(EIGEN_TEST_ALTIVEC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -maltivec -mabi=altivec")
message("Enabling AltiVec in tests/examples")
- endif(EIGEN_TEST_ALTIVEC)
+ endif()
endif(CMAKE_SYSTEM_NAME MATCHES Linux)
endif(CMAKE_COMPILER_IS_GNUCXX)
@@ -112,19 +124,25 @@ endif(EIGEN_TEST_NO_EXPLICIT_VECTORIZATION)
option(EIGEN_TEST_C++0x "Enables all C++0x features." OFF)
-option(EIGEN_TEST_RVALUE_REF_SUPPORT "Enable rvalue references for unit tests." OFF)
+option(EIGEN_TEST_MAX_WARNING_LEVEL "Sets the warning level to /Wall while building the unit tests." OFF)
+mark_as_advanced(EIGEN_TEST_MAX_WARNING_LEVEL)
include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})
set(INCLUDE_INSTALL_DIR
- "${CMAKE_INSTALL_PREFIX}/include/eigen2"
+ "${CMAKE_INSTALL_PREFIX}/include/eigen3"
CACHE PATH
"The directory where we install the header files"
)
+install(FILES
+ signature_of_eigen3_matrix_library
+ DESTINATION ${INCLUDE_INSTALL_DIR} COMPONENT Devel
+ )
+
if(EIGEN_BUILD_PKGCONFIG)
- configure_file(eigen2.pc.in eigen2.pc)
- install(FILES ${CMAKE_CURRENT_BINARY_DIR}/eigen2.pc
+ configure_file(eigen3.pc.in eigen3.pc)
+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/eigen3.pc
DESTINATION share/pkgconfig
)
endif(EIGEN_BUILD_PKGCONFIG)
@@ -135,6 +153,9 @@ add_subdirectory(doc EXCLUDE_FROM_ALL)
include(CTest)
enable_testing() # must be called from the root CMakeLists, see man page
+include(EigenTesting)
+ei_init_testing()
+
if(EIGEN_LEAVE_TEST_IN_ALL_TARGET)
add_subdirectory(test) # can't do EXCLUDE_FROM_ALL here, breaks CTest
else()
@@ -147,6 +168,7 @@ add_subdirectory(demos EXCLUDE_FROM_ALL)
add_subdirectory(blas EXCLUDE_FROM_ALL)
+# must be after test and unsupported, for configuring buildtests.in
add_subdirectory(scripts EXCLUDE_FROM_ALL)
# TODO: consider also replacing EIGEN_BUILD_BTL by a custom target "make btl"?
diff --git a/COPYING.LGPL b/COPYING.LGPL
index fc8a5de7e..0e4fa8aaf 100644
--- a/COPYING.LGPL
+++ b/COPYING.LGPL
@@ -1,4 +1,4 @@
- GNU LESSER GENERAL PUBLIC LICENSE
+ GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc.
diff --git a/Eigen/Array b/Eigen/Array
index 276fdec2f..b35242f1a 100644
--- a/Eigen/Array
+++ b/Eigen/Array
@@ -45,3 +45,5 @@ namespace Eigen {
#include "src/Core/util/EnableMSVCWarnings.h"
#endif // EIGEN_ARRAY_MODULE_H
+/* vim: set filetype=cpp et sw=2 ts=2 ai: */
+
diff --git a/Eigen/CMakeLists.txt b/Eigen/CMakeLists.txt
index e0eb837a5..af90db2fe 100644
--- a/Eigen/CMakeLists.txt
+++ b/Eigen/CMakeLists.txt
@@ -1,7 +1,12 @@
-set(Eigen_HEADERS Core LU Cholesky QR Geometry Sparse Array SVD LeastSquares QtAlignedMalloc StdVector Householder Jacobi Eigenvalues)
+file(GLOB Eigen_directory_files "*")
+foreach(f ${Eigen_directory_files})
+ if(NOT f MATCHES ".txt" AND NOT f MATCHES "src")
+ list(APPEND Eigen_directory_files_to_install ${f})
+ endif()
+endforeach(f ${Eigen_directory_files})
install(FILES
- ${Eigen_HEADERS}
+ ${Eigen_directory_files_to_install}
DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen COMPONENT Devel
)
diff --git a/Eigen/Cholesky b/Eigen/Cholesky
index d4e80e46b..a0e0d146b 100644
--- a/Eigen/Cholesky
+++ b/Eigen/Cholesky
@@ -63,3 +63,4 @@ namespace Eigen {
#include "src/Core/util/EnableMSVCWarnings.h"
#endif // EIGEN_CHOLESKY_MODULE_H
+/* vim: set filetype=cpp et sw=2 ts=2 ai: */
diff --git a/Eigen/Core b/Eigen/Core
index fe1f1a5bf..d452a6cd9 100644
--- a/Eigen/Core
+++ b/Eigen/Core
@@ -71,6 +71,12 @@
#ifdef __SSSE3__
#include
#endif
+ #ifdef __SSE4_1__
+ #include
+ #endif
+ #ifdef __SSE4_2__
+ #include
+ #endif
#elif defined __ALTIVEC__
#define EIGEN_VECTORIZE
#define EIGEN_VECTORIZE_ALTIVEC
@@ -216,3 +222,4 @@ struct Dense {};
#include "src/Core/util/EnableMSVCWarnings.h"
#endif // EIGEN_CORE_H
+/* vim: set filetype=cpp et sw=2 ts=2 ai: */
diff --git a/Eigen/Eigenvalues b/Eigen/Eigenvalues
index 8c6841549..1ae0cf098 100644
--- a/Eigen/Eigenvalues
+++ b/Eigen/Eigenvalues
@@ -73,3 +73,4 @@ namespace Eigen {
#include "src/Core/util/EnableMSVCWarnings.h"
#endif // EIGEN_EIGENVALUES_MODULE_H
+/* vim: set filetype=cpp et sw=2 ts=2 ai: */
diff --git a/Eigen/Geometry b/Eigen/Geometry
index c931f28fe..4fa715a3a 100644
--- a/Eigen/Geometry
+++ b/Eigen/Geometry
@@ -57,3 +57,5 @@ namespace Eigen {
#include "src/Core/util/EnableMSVCWarnings.h"
#endif // EIGEN_GEOMETRY_MODULE_H
+/* vim: set filetype=cpp et sw=2 ts=2 ai: */
+
diff --git a/Eigen/Householder b/Eigen/Householder
index ef3e61373..dcaeeeae8 100644
--- a/Eigen/Householder
+++ b/Eigen/Householder
@@ -8,7 +8,7 @@
namespace Eigen {
/** \defgroup Householder_Module Householder module
- * This module provides householder transformations.
+ * This module provides Householder transformations.
*
* \code
* #include
@@ -23,3 +23,4 @@ namespace Eigen {
#include "src/Core/util/EnableMSVCWarnings.h"
#endif // EIGEN_HOUSEHOLDER_MODULE_H
+/* vim: set filetype=cpp et sw=2 ts=2 ai: */
diff --git a/Eigen/Jacobi b/Eigen/Jacobi
index da67d2a6a..ce6ac1bff 100644
--- a/Eigen/Jacobi
+++ b/Eigen/Jacobi
@@ -26,3 +26,5 @@ namespace Eigen {
#include "src/Core/util/EnableMSVCWarnings.h"
#endif // EIGEN_JACOBI_MODULE_H
+/* vim: set filetype=cpp et sw=2 ts=2 ai: */
+
diff --git a/Eigen/LU b/Eigen/LU
index e4aa3ecde..9ef9c97ec 100644
--- a/Eigen/LU
+++ b/Eigen/LU
@@ -26,8 +26,13 @@ namespace Eigen {
#include "src/LU/Determinant.h"
#include "src/LU/Inverse.h"
+#if defined EIGEN_VECTORIZE_SSE
+ #include "src/LU/arch/Inverse_SSE.h"
+#endif
+
} // namespace Eigen
#include "src/Core/util/EnableMSVCWarnings.h"
#endif // EIGEN_LU_MODULE_H
+/* vim: set filetype=cpp et sw=2 ts=2 ai: */
diff --git a/Eigen/LeastSquares b/Eigen/LeastSquares
index 75620a349..61b83bbc8 100644
--- a/Eigen/LeastSquares
+++ b/Eigen/LeastSquares
@@ -25,3 +25,4 @@ namespace Eigen {
#include "src/Core/util/EnableMSVCWarnings.h"
#endif // EIGEN_REGRESSION_MODULE_H
+/* vim: set filetype=cpp et sw=2 ts=2 ai: */
diff --git a/Eigen/QR b/Eigen/QR
index de0179865..825cfb149 100644
--- a/Eigen/QR
+++ b/Eigen/QR
@@ -67,3 +67,4 @@ namespace Eigen {
#include "Eigenvalues"
#endif // EIGEN_QR_MODULE_H
+/* vim: set filetype=cpp et sw=2 ts=2 ai: */
diff --git a/Eigen/QtAlignedMalloc b/Eigen/QtAlignedMalloc
index fce7edf9b..698607faa 100644
--- a/Eigen/QtAlignedMalloc
+++ b/Eigen/QtAlignedMalloc
@@ -31,3 +31,4 @@ void *qRealloc(void *ptr, size_t size)
#endif
#endif // EIGEN_QTMALLOC_MODULE_H
+/* vim: set filetype=cpp et sw=2 ts=2 ai: */
diff --git a/Eigen/SVD b/Eigen/SVD
index 44f0f4b31..200aea351 100644
--- a/Eigen/SVD
+++ b/Eigen/SVD
@@ -31,3 +31,4 @@ namespace Eigen {
#include "src/Core/util/EnableMSVCWarnings.h"
#endif // EIGEN_SVD_MODULE_H
+/* vim: set filetype=cpp et sw=2 ts=2 ai: */
diff --git a/Eigen/Sparse b/Eigen/Sparse
index f4dcad07e..f027d3e6c 100644
--- a/Eigen/Sparse
+++ b/Eigen/Sparse
@@ -87,7 +87,6 @@ struct Sparse {};
#include "src/Sparse/SparseUtil.h"
#include "src/Sparse/SparseMatrixBase.h"
-#include "src/Sparse/SparseNestByValue.h"
#include "src/Sparse/CompressedStorage.h"
#include "src/Sparse/AmbiVector.h"
#include "src/Sparse/RandomSetter.h"
@@ -134,3 +133,5 @@ struct Sparse {};
#include "src/Core/util/EnableMSVCWarnings.h"
#endif // EIGEN_SPARSE_MODULE_H
+/* vim: set filetype=cpp et sw=2 ts=2 ai: */
+
diff --git a/Eigen/StdVector b/Eigen/StdVector
index f37de5ff6..b6dbde8a2 100644
--- a/Eigen/StdVector
+++ b/Eigen/StdVector
@@ -166,3 +166,5 @@ class vector >
}
#endif // EIGEN_STDVECTOR_MODULE_H
+/* vim: set filetype=cpp et sw=2 ts=2 ai: */
+
diff --git a/Eigen/src/Array/Functors.h b/Eigen/src/Array/Functors.h
index fd259f7bc..975fd9c7f 100644
--- a/Eigen/src/Array/Functors.h
+++ b/Eigen/src/Array/Functors.h
@@ -56,7 +56,8 @@ struct ei_functor_traits >
*
* \sa class CwiseUnaryOp, Cwise::sqrt()
*/
-template struct ei_scalar_sqrt_op EIGEN_EMPTY_STRUCT {
+template struct ei_scalar_sqrt_op {
+ EIGEN_EMPTY_STRUCT_CTOR(ei_scalar_sqrt_op)
inline const Scalar operator() (const Scalar& a) const { return ei_sqrt(a); }
typedef typename ei_packet_traits::type Packet;
inline Packet packetOp(const Packet& a) const { return ei_psqrt(a); }
@@ -77,7 +78,8 @@ struct ei_functor_traits >
*
* \sa class CwiseUnaryOp, Cwise::cos()
*/
-template struct ei_scalar_cos_op EIGEN_EMPTY_STRUCT {
+template struct ei_scalar_cos_op {
+ EIGEN_EMPTY_STRUCT_CTOR(ei_scalar_cos_op)
inline Scalar operator() (const Scalar& a) const { return ei_cos(a); }
typedef typename ei_packet_traits::type Packet;
inline Packet packetOp(const Packet& a) const { return ei_pcos(a); }
@@ -87,7 +89,7 @@ struct ei_functor_traits >
{
enum {
Cost = 5 * NumTraits::MulCost,
- PacketAccess = ei_packet_traits::HasCos && EIGEN_FAST_MATH
+ PacketAccess = ei_packet_traits::HasCos
};
};
@@ -99,7 +101,8 @@ struct ei_functor_traits >
*
* \sa class CwiseUnaryOp, Cwise::sin()
*/
-template struct ei_scalar_sin_op EIGEN_EMPTY_STRUCT {
+template struct ei_scalar_sin_op {
+ EIGEN_EMPTY_STRUCT_CTOR(ei_scalar_sin_op)
inline const Scalar operator() (const Scalar& a) const { return ei_sin(a); }
typedef typename ei_packet_traits::type Packet;
inline Packet packetOp(const Packet& a) const { return ei_psin(a); }
@@ -109,7 +112,7 @@ struct ei_functor_traits >
{
enum {
Cost = 5 * NumTraits::MulCost,
- PacketAccess = ei_packet_traits::HasSin && EIGEN_FAST_MATH
+ PacketAccess = ei_packet_traits::HasSin
};
};
@@ -143,6 +146,7 @@ struct ei_functor_traits >
*/
template
struct ei_scalar_inverse_op {
+ EIGEN_EMPTY_STRUCT_CTOR(ei_scalar_inverse_op)
inline Scalar operator() (const Scalar& a) const { return Scalar(1)/a; }
template
inline const PacketScalar packetOp(const PacketScalar& a) const
@@ -162,6 +166,7 @@ struct ei_functor_traits >
*/
template
struct ei_scalar_square_op {
+ EIGEN_EMPTY_STRUCT_CTOR(ei_scalar_square_op)
inline Scalar operator() (const Scalar& a) const { return a*a; }
template
inline const PacketScalar packetOp(const PacketScalar& a) const
@@ -181,6 +186,7 @@ struct ei_functor_traits >
*/
template
struct ei_scalar_cube_op {
+ EIGEN_EMPTY_STRUCT_CTOR(ei_scalar_cube_op)
inline Scalar operator() (const Scalar& a) const { return a*a*a; }
template
inline const PacketScalar packetOp(const PacketScalar& a) const
diff --git a/Eigen/src/Array/Random.h b/Eigen/src/Array/Random.h
index 34b835776..97ca0fba3 100644
--- a/Eigen/src/Array/Random.h
+++ b/Eigen/src/Array/Random.h
@@ -25,8 +25,8 @@
#ifndef EIGEN_RANDOM_H
#define EIGEN_RANDOM_H
-template struct ei_scalar_random_op EIGEN_EMPTY_STRUCT {
- inline ei_scalar_random_op(void) {}
+template struct ei_scalar_random_op {
+ EIGEN_EMPTY_STRUCT_CTOR(ei_scalar_random_op)
inline const Scalar operator() (int, int) const { return ei_random(); }
};
template
diff --git a/Eigen/src/Array/Replicate.h b/Eigen/src/Array/Replicate.h
index 5a9b10738..3f87e09fe 100644
--- a/Eigen/src/Array/Replicate.h
+++ b/Eigen/src/Array/Replicate.h
@@ -97,9 +97,6 @@ template class Replicate
const typename MatrixType::Nested m_matrix;
const ei_int_if_dynamic m_rowFactor;
const ei_int_if_dynamic m_colFactor;
-
- private:
- Replicate& operator=(const Replicate&);
};
/** \nonstableyet
diff --git a/Eigen/src/Array/Select.h b/Eigen/src/Array/Select.h
index 1983bd870..b1fab69c9 100644
--- a/Eigen/src/Array/Select.h
+++ b/Eigen/src/Array/Select.h
@@ -134,11 +134,11 @@ DenseBase::select(const DenseBase& thenMatrix,
*/
template
template
-inline const Select >
+inline const Select
DenseBase::select(const DenseBase& thenMatrix,
typename ThenDerived::Scalar elseScalar) const
{
- return Select >(
+ return Select(
derived(), thenMatrix.derived(), ThenDerived::Constant(rows(),cols(),elseScalar));
}
@@ -151,11 +151,11 @@ DenseBase::select(const DenseBase& thenMatrix,
*/
template
template
-inline const Select, ElseDerived >
+inline const Select
DenseBase::select(typename ElseDerived::Scalar thenScalar,
const DenseBase& elseMatrix) const
{
- return Select,ElseDerived>(
+ return Select(
derived(), ElseDerived::Constant(rows(),cols(),thenScalar), elseMatrix.derived());
}
diff --git a/Eigen/src/Array/VectorwiseOp.h b/Eigen/src/Array/VectorwiseOp.h
index f6774a019..05dd69789 100644
--- a/Eigen/src/Array/VectorwiseOp.h
+++ b/Eigen/src/Array/VectorwiseOp.h
@@ -113,7 +113,8 @@ class PartialReduxExpr : ei_no_assignment_operator,
#define EIGEN_MEMBER_FUNCTOR(MEMBER,COST) \
template \
- struct ei_member_##MEMBER EIGEN_EMPTY_STRUCT { \
+ struct ei_member_##MEMBER { \
+ EIGEN_EMPTY_STRUCT_CTOR(ei_member_##MEMBER) \
typedef ResultType result_type; \
template struct Cost \
{ enum { value = COST }; }; \
@@ -124,6 +125,9 @@ class PartialReduxExpr : ei_no_assignment_operator,
EIGEN_MEMBER_FUNCTOR(squaredNorm, Size * NumTraits::MulCost + (Size-1)*NumTraits::AddCost);
EIGEN_MEMBER_FUNCTOR(norm, (Size+5) * NumTraits::MulCost + (Size-1)*NumTraits::AddCost);
+EIGEN_MEMBER_FUNCTOR(stableNorm, (Size+5) * NumTraits::MulCost + (Size-1)*NumTraits::AddCost);
+EIGEN_MEMBER_FUNCTOR(blueNorm, (Size+5) * NumTraits::MulCost + (Size-1)*NumTraits::AddCost);
+EIGEN_MEMBER_FUNCTOR(hypotNorm, (Size-1) * ei_functor_traits >::Cost );
EIGEN_MEMBER_FUNCTOR(sum, (Size-1)*NumTraits::AddCost);
EIGEN_MEMBER_FUNCTOR(mean, (Size-1)*NumTraits::AddCost + NumTraits::MulCost);
EIGEN_MEMBER_FUNCTOR(minCoeff, (Size-1)*NumTraits::AddCost);
@@ -291,6 +295,33 @@ template class VectorwiseOp
const typename ReturnType::Type norm() const
{ return _expression(); }
+
+ /** \returns a row (or column) vector expression of the norm
+ * of each column (or row) of the referenced expression, using
+ * blue's algorithm.
+ *
+ * \sa MatrixBase::blueNorm() */
+ const typename ReturnType::Type blueNorm() const
+ { return _expression(); }
+
+
+ /** \returns a row (or column) vector expression of the norm
+ * of each column (or row) of the referenced expression, avoiding
+ * underflow and overflow.
+ *
+ * \sa MatrixBase::stableNorm() */
+ const typename ReturnType::Type stableNorm() const
+ { return _expression(); }
+
+
+ /** \returns a row (or column) vector expression of the norm
+ * of each column (or row) of the referenced expression, avoiding
+ * underflow and overflow using a concatenation of hypot() calls.
+ *
+ * \sa MatrixBase::hypotNorm() */
+ const typename ReturnType::Type hypotNorm() const
+ { return _expression(); }
+
/** \returns a row (or column) vector expression of the sum
* of each column (or row) of the referenced expression.
*
@@ -409,22 +440,22 @@ template class VectorwiseOp
template
CwiseBinaryOp,
ExpressionType,
- NestByValue::Type> >
+ typename ExtendedType::Type>
operator+(const MatrixBase& other) const
{
EIGEN_STATIC_ASSERT_VECTOR_ONLY(OtherDerived);
- return m_matrix + extendedTo(other).nestByValue();
+ return m_matrix + extendedTo(other);
}
/** Returns the expression of the difference between each subvector of \c *this and the vector \a other */
template
CwiseBinaryOp,
ExpressionType,
- NestByValue::Type> >
+ typename ExtendedType::Type>
operator-(const MatrixBase& other) const
{
EIGEN_STATIC_ASSERT_VECTOR_ONLY(OtherDerived);
- return m_matrix - extendedTo(other).nestByValue();
+ return m_matrix - extendedTo(other);
}
/////////// Geometry module ///////////
@@ -451,19 +482,16 @@ template class VectorwiseOp
Direction==Horizontal ? 1 : int(ei_traits::ColsAtCompileTime)>
HNormalized_Factors;
typedef CwiseBinaryOp::Scalar>,
- NestByValue,
- NestByValue,
+ HNormalized_Block,
+ Replicate > >
+ Direction==Horizontal ? HNormalized_SizeMinusOne : 1> >
HNormalizedReturnType;
const HNormalizedReturnType hnormalized() const;
protected:
ExpressionTypeNested m_matrix;
-
- private:
- VectorwiseOp& operator=(const VectorwiseOp&);
};
/** \array_module
diff --git a/Eigen/src/Cholesky/LLT.h b/Eigen/src/Cholesky/LLT.h
index a1706e53e..ad737aaeb 100644
--- a/Eigen/src/Cholesky/LLT.h
+++ b/Eigen/src/Cholesky/LLT.h
@@ -224,18 +224,18 @@ template<> struct ei_llt_inplace
template struct LLT_Traits
{
typedef TriangularView MatrixL;
- typedef TriangularView, UpperTriangular> MatrixU;
+ typedef TriangularView MatrixU;
inline static MatrixL getL(const MatrixType& m) { return m; }
- inline static MatrixU getU(const MatrixType& m) { return m.adjoint().nestByValue(); }
+ inline static MatrixU getU(const MatrixType& m) { return m.adjoint(); }
static bool inplace_decomposition(MatrixType& m)
{ return ei_llt_inplace::blocked(m); }
};
template struct LLT_Traits
{
- typedef TriangularView, LowerTriangular> MatrixL;
+ typedef TriangularView MatrixL;
typedef TriangularView MatrixU;
- inline static MatrixL getL(const MatrixType& m) { return m.adjoint().nestByValue(); }
+ inline static MatrixL getL(const MatrixType& m) { return m.adjoint(); }
inline static MatrixU getU(const MatrixType& m) { return m; }
static bool inplace_decomposition(MatrixType& m)
{ return ei_llt_inplace::blocked(m); }
diff --git a/Eigen/src/Core/AnyMatrixBase.h b/Eigen/src/Core/AnyMatrixBase.h
index 0522c1d5e..d1c16923b 100644
--- a/Eigen/src/Core/AnyMatrixBase.h
+++ b/Eigen/src/Core/AnyMatrixBase.h
@@ -57,7 +57,7 @@ template struct AnyMatrixBase
{ derived().evalTo(dst); }
/** \internal Don't use it, but do the equivalent: \code dst += *this; \endcode */
- template inline void addToDense(Dest& dst) const
+ template inline void addTo(Dest& dst) const
{
// This is the default implementation,
// derived class can reimplement it in a more optimized way.
@@ -67,7 +67,7 @@ template struct AnyMatrixBase
}
/** \internal Don't use it, but do the equivalent: \code dst -= *this; \endcode */
- template inline void subToDense(Dest& dst) const
+ template inline void subTo(Dest& dst) const
{
// This is the default implementation,
// derived class can reimplement it in a more optimized way.
@@ -114,7 +114,7 @@ template
template
Derived& DenseBase::operator+=(const AnyMatrixBase &other)
{
- other.derived().addToDense(derived());
+ other.derived().addTo(derived());
return derived();
}
@@ -122,7 +122,7 @@ template
template
Derived& DenseBase::operator-=(const AnyMatrixBase &other)
{
- other.derived().subToDense(derived());
+ other.derived().subTo(derived());
return derived();
}
diff --git a/Eigen/src/Core/Assign.h b/Eigen/src/Core/Assign.h
index 466205208..d6bf37c6e 100644
--- a/Eigen/src/Core/Assign.h
+++ b/Eigen/src/Core/Assign.h
@@ -28,7 +28,7 @@
#define EIGEN_ASSIGN_H
/***************************************************************************
-* Part 1 : the logic deciding a strategy for vectorization and unrolling
+* Part 1 : the logic deciding a strategy for traversal and unrolling *
***************************************************************************/
template
@@ -53,44 +53,53 @@ private:
};
enum {
- MightVectorize = (int(Derived::Flags) & int(OtherDerived::Flags) & ActualPacketAccessBit)
- && ((int(Derived::Flags)&RowMajorBit)==(int(OtherDerived::Flags)&RowMajorBit)),
+ StorageOrdersAgree = (int(Derived::Flags)&RowMajorBit)==(int(OtherDerived::Flags)&RowMajorBit),
+ MightVectorize = StorageOrdersAgree
+ && (int(Derived::Flags) & int(OtherDerived::Flags) & ActualPacketAccessBit),
MayInnerVectorize = MightVectorize && int(InnerSize)!=Dynamic && int(InnerSize)%int(PacketSize)==0
&& int(DstIsAligned) && int(SrcIsAligned),
- MayLinearVectorize = MightVectorize && (int(Derived::Flags) & int(OtherDerived::Flags) & LinearAccessBit)
- && (DstIsAligned || InnerMaxSize == Dynamic),/* If the destination isn't aligned,
- we have to do runtime checks and we don't unroll, so it's only good for large enough sizes. See remark below
- about InnerMaxSize. */
- MaySliceVectorize = MightVectorize && int(InnerMaxSize)>=3*PacketSize /* slice vectorization can be slow, so we only
- want it if the slices are big, which is indicated by InnerMaxSize rather than InnerSize, think of the case
- of a dynamic block in a fixed-size matrix */
+ MayLinearize = StorageOrdersAgree && (int(Derived::Flags) & int(OtherDerived::Flags) & LinearAccessBit),
+ MayLinearVectorize = MightVectorize && MayLinearize
+ && (DstIsAligned || InnerMaxSize == Dynamic),
+ /* If the destination isn't aligned, we have to do runtime checks and we don't unroll,
+ so it's only good for large enough sizes. See remark below about InnerMaxSize. */
+ MaySliceVectorize = MightVectorize && int(InnerMaxSize)>=3*PacketSize
+ /* slice vectorization can be slow, so we only want it if the slices are big, which is
+ indicated by InnerMaxSize rather than InnerSize, think of the case of a dynamic block
+ in a fixed-size matrix */
};
public:
enum {
- Vectorization = int(MayInnerVectorize) ? int(InnerVectorization)
- : int(MayLinearVectorize) ? int(LinearVectorization)
- : int(MaySliceVectorize) ? int(SliceVectorization)
- : int(NoVectorization)
+ Traversal = int(MayInnerVectorize) ? int(InnerVectorizedTraversal)
+ : int(MayLinearVectorize) ? int(LinearVectorizedTraversal)
+ : int(MaySliceVectorize) ? int(SliceVectorizedTraversal)
+ : int(MayLinearize) ? int(LinearTraversal)
+ : int(DefaultTraversal),
+ Vectorized = int(Traversal) == InnerVectorizedTraversal
+ || int(Traversal) == LinearVectorizedTraversal
+ || int(Traversal) == SliceVectorizedTraversal
};
private:
enum {
- UnrollingLimit = EIGEN_UNROLLING_LIMIT * (int(Vectorization) == int(NoVectorization) ? 1 : int(PacketSize)),
+ UnrollingLimit = EIGEN_UNROLLING_LIMIT * (Vectorized ? int(PacketSize) : 1),
MayUnrollCompletely = int(Derived::SizeAtCompileTime) * int(OtherDerived::CoeffReadCost) <= int(UnrollingLimit),
- MayUnrollInner = int(InnerSize * OtherDerived::CoeffReadCost) <= int(UnrollingLimit)
+ MayUnrollInner = int(InnerSize) * int(OtherDerived::CoeffReadCost) <= int(UnrollingLimit)
};
public:
enum {
- Unrolling = (int(Vectorization) == int(InnerVectorization) || int(Vectorization) == int(NoVectorization))
- ? (
- int(MayUnrollCompletely) ? int(CompleteUnrolling)
- : int(MayUnrollInner) ? int(InnerUnrolling)
- : int(NoUnrolling)
- )
- : int(Vectorization) == int(LinearVectorization)
- ? ( int(MayUnrollCompletely) && int(DstIsAligned) ? int(CompleteUnrolling) : int(NoUnrolling) )
+ Unrolling = (int(Traversal) == int(InnerVectorizedTraversal) || int(Traversal) == int(DefaultTraversal))
+ ? (
+ int(MayUnrollCompletely) ? int(CompleteUnrolling)
+ : int(MayUnrollInner) ? int(InnerUnrolling)
+ : int(NoUnrolling)
+ )
+ : int(Traversal) == int(LinearVectorizedTraversal)
+ ? ( int(MayUnrollCompletely) && int(DstIsAligned) ? int(CompleteUnrolling) : int(NoUnrolling) )
+ : int(Traversal) == int(LinearTraversal)
+ ? ( int(MayUnrollCompletely) ? int(CompleteUnrolling) : int(NoUnrolling) )
: int(NoUnrolling)
};
@@ -102,11 +111,12 @@ public:
EIGEN_DEBUG_VAR(InnerSize)
EIGEN_DEBUG_VAR(InnerMaxSize)
EIGEN_DEBUG_VAR(PacketSize)
+ EIGEN_DEBUG_VAR(StorageOrdersAgree)
EIGEN_DEBUG_VAR(MightVectorize)
EIGEN_DEBUG_VAR(MayInnerVectorize)
EIGEN_DEBUG_VAR(MayLinearVectorize)
EIGEN_DEBUG_VAR(MaySliceVectorize)
- EIGEN_DEBUG_VAR(Vectorization)
+ EIGEN_DEBUG_VAR(Traversal)
EIGEN_DEBUG_VAR(UnrollingLimit)
EIGEN_DEBUG_VAR(MayUnrollCompletely)
EIGEN_DEBUG_VAR(MayUnrollInner)
@@ -118,12 +128,12 @@ public:
* Part 2 : meta-unrollers
***************************************************************************/
-/***********************
-*** No vectorization ***
-***********************/
+/************************
+*** Default traversal ***
+************************/
template
-struct ei_assign_novec_CompleteUnrolling
+struct ei_assign_DefaultTraversal_CompleteUnrolling
{
enum {
row = int(Derived1::Flags)&RowMajorBit
@@ -137,18 +147,18 @@ struct ei_assign_novec_CompleteUnrolling
EIGEN_STRONG_INLINE static void run(Derived1 &dst, const Derived2 &src)
{
dst.copyCoeff(row, col, src);
- ei_assign_novec_CompleteUnrolling::run(dst, src);
+ ei_assign_DefaultTraversal_CompleteUnrolling::run(dst, src);
}
};
template
-struct ei_assign_novec_CompleteUnrolling
+struct ei_assign_DefaultTraversal_CompleteUnrolling
{
EIGEN_STRONG_INLINE static void run(Derived1 &, const Derived2 &) {}
};
template
-struct ei_assign_novec_InnerUnrolling
+struct ei_assign_DefaultTraversal_InnerUnrolling
{
EIGEN_STRONG_INLINE static void run(Derived1 &dst, const Derived2 &src, int row_or_col)
{
@@ -156,16 +166,36 @@ struct ei_assign_novec_InnerUnrolling
const int row = rowMajor ? row_or_col : Index;
const int col = rowMajor ? Index : row_or_col;
dst.copyCoeff(row, col, src);
- ei_assign_novec_InnerUnrolling::run(dst, src, row_or_col);
+ ei_assign_DefaultTraversal_InnerUnrolling::run(dst, src, row_or_col);
}
};
template
-struct ei_assign_novec_InnerUnrolling
+struct ei_assign_DefaultTraversal_InnerUnrolling
{
EIGEN_STRONG_INLINE static void run(Derived1 &, const Derived2 &, int) {}
};
+/***********************
+*** Linear traversal ***
+***********************/
+
+template
+struct ei_assign_LinearTraversal_CompleteUnrolling
+{
+ EIGEN_STRONG_INLINE static void run(Derived1 &dst, const Derived2 &src)
+ {
+ dst.copyCoeff(Index, src);
+ ei_assign_LinearTraversal_CompleteUnrolling::run(dst, src);
+ }
+};
+
+template
+struct ei_assign_LinearTraversal_CompleteUnrolling
+{
+ EIGEN_STRONG_INLINE static void run(Derived1 &, const Derived2 &) {}
+};
+
/**************************
*** Inner vectorization ***
**************************/
@@ -221,16 +251,16 @@ struct ei_assign_innervec_InnerUnrolling
***************************************************************************/
template::Vectorization,
+ int Traversal = ei_assign_traits::Traversal,
int Unrolling = ei_assign_traits::Unrolling>
struct ei_assign_impl;
-/***********************
-*** No vectorization ***
-***********************/
+/************************
+*** Default traversal ***
+************************/
template
-struct ei_assign_impl
+struct ei_assign_impl
{
inline static void run(Derived1 &dst, const Derived2 &src)
{
@@ -248,17 +278,17 @@ struct ei_assign_impl
};
template
-struct ei_assign_impl
+struct ei_assign_impl
{
EIGEN_STRONG_INLINE static void run(Derived1 &dst, const Derived2 &src)
{
- ei_assign_novec_CompleteUnrolling
+ ei_assign_DefaultTraversal_CompleteUnrolling
::run(dst, src);
}
};
template
-struct ei_assign_impl
+struct ei_assign_impl
{
EIGEN_STRONG_INLINE static void run(Derived1 &dst, const Derived2 &src)
{
@@ -266,17 +296,42 @@ struct ei_assign_impl
const int innerSize = rowMajor ? Derived1::ColsAtCompileTime : Derived1::RowsAtCompileTime;
const int outerSize = dst.outerSize();
for(int j = 0; j < outerSize; ++j)
- ei_assign_novec_InnerUnrolling
+ ei_assign_DefaultTraversal_InnerUnrolling
::run(dst, src, j);
}
};
+/***********************
+*** Linear traversal ***
+***********************/
+
+template
+struct ei_assign_impl
+{
+ inline static void run(Derived1 &dst, const Derived2 &src)
+ {
+ const int size = dst.size();
+ for(int i = 0; i < size; ++i)
+ dst.copyCoeff(i, src);
+ }
+};
+
+template
+struct ei_assign_impl
+{
+ EIGEN_STRONG_INLINE static void run(Derived1 &dst, const Derived2 &src)
+ {
+ ei_assign_LinearTraversal_CompleteUnrolling
+ ::run(dst, src);
+ }
+};
+
/**************************
*** Inner vectorization ***
**************************/
template
-struct ei_assign_impl
+struct ei_assign_impl
{
inline static void run(Derived1 &dst, const Derived2 &src)
{
@@ -295,7 +350,7 @@ struct ei_assign_impl
};
template
-struct ei_assign_impl
+struct ei_assign_impl
{
EIGEN_STRONG_INLINE static void run(Derived1 &dst, const Derived2 &src)
{
@@ -305,7 +360,7 @@ struct ei_assign_impl
};
template
-struct ei_assign_impl
+struct ei_assign_impl
{
EIGEN_STRONG_INLINE static void run(Derived1 &dst, const Derived2 &src)
{
@@ -323,7 +378,7 @@ struct ei_assign_impl
***************************/
template
-struct ei_assign_impl
+struct ei_assign_impl
{
inline static void run(Derived1 &dst, const Derived2 &src)
{
@@ -347,7 +402,7 @@ struct ei_assign_impl
};
template
-struct ei_assign_impl
+struct ei_assign_impl
{
EIGEN_STRONG_INLINE static void run(Derived1 &dst, const Derived2 &src)
{
@@ -356,7 +411,7 @@ struct ei_assign_impl::run(dst, src);
- ei_assign_novec_CompleteUnrolling::run(dst, src);
+ ei_assign_DefaultTraversal_CompleteUnrolling::run(dst, src);
}
};
@@ -365,7 +420,7 @@ struct ei_assign_impl
-struct ei_assign_impl
+struct ei_assign_impl
{
inline static void run(Derived1 &dst, const Derived2 &src)
{
@@ -429,6 +484,9 @@ EIGEN_STRONG_INLINE Derived& DenseBase
ei_assign_impl::run(derived(),other.derived());
#ifdef EIGEN_DEBUG_ASSIGN
ei_assign_traits::debug();
+#endif
+#ifndef EIGEN_NO_DEBUG
+ checkTransposeAliasing(other.derived());
#endif
return derived();
}
diff --git a/Eigen/src/Core/BandMatrix.h b/Eigen/src/Core/BandMatrix.h
index 841d1786a..7943e6280 100644
--- a/Eigen/src/Core/BandMatrix.h
+++ b/Eigen/src/Core/BandMatrix.h
@@ -70,7 +70,7 @@ class BandMatrix : public AnyMatrixBase::MaxColsAtCompileTime
};
typedef typename ei_traits::Scalar Scalar;
- typedef Matrix PlainMatrixType;
+ typedef Matrix DenseMatrixType;
protected:
enum {
@@ -87,7 +87,7 @@ class BandMatrix : public AnyMatrixBase BuildType;
typedef typename ei_meta_if,NestByValue >,
+ CwiseUnaryOp,BuildType >,
BuildType>::ret Type;
};
@@ -171,9 +171,9 @@ class BandMatrix : public AnyMatrixBase(m_data, supers()-i, std::max(0,i), 1, diagonalLength(i));
}
- PlainMatrixType toDense() const
+ DenseMatrixType toDenseMatrix() const
{
- PlainMatrixType res(rows(),cols());
+ DenseMatrixType res(rows(),cols());
res.setZero();
res.diagonal() = diagonal();
for (int i=1; i<=supers();++i)
diff --git a/Eigen/src/Core/Coeffs.h b/Eigen/src/Core/Coeffs.h
index c8bc9db85..b8af2531e 100644
--- a/Eigen/src/Core/Coeffs.h
+++ b/Eigen/src/Core/Coeffs.h
@@ -379,6 +379,38 @@ EIGEN_STRONG_INLINE void DenseBase::copyPacket(int index, const DenseBa
other.derived().template packet(index));
}
+
+template
+struct ei_alignmentOffset_impl
+{
+ inline static Integer run(const DenseBase&, Integer)
+ { return 0; }
+};
+
+template
+struct ei_alignmentOffset_impl
+{
+ inline static Integer run(const DenseBase& m, Integer maxOffset)
+ {
+ return ei_alignmentOffset(&m.const_cast_derived().coeffRef(0,0), maxOffset);
+ }
+};
+
+/** \internal \returns the number of elements which have to be skipped, starting
+ * from the address of coeffRef(0,0), to find the first 16-byte aligned element.
+ *
+ * \note If the expression doesn't have the DirectAccessBit, this function returns 0.
+ *
+ * There is also the variant ei_alignmentOffset(const Scalar*, Integer) defined in Memory.h.
+ */
+template
+inline static Integer ei_alignmentOffset(const DenseBase& m, Integer maxOffset)
+{
+ return ei_alignmentOffset_impl
+ ::run(m, maxOffset);
+}
+
#endif
#endif // EIGEN_COEFFS_H
diff --git a/Eigen/src/Core/CommaInitializer.h b/Eigen/src/Core/CommaInitializer.h
index 428e4d82d..a312b40f5 100644
--- a/Eigen/src/Core/CommaInitializer.h
+++ b/Eigen/src/Core/CommaInitializer.h
@@ -116,9 +116,6 @@ struct CommaInitializer
int m_row; // current row id
int m_col; // current col id
int m_currentBlockRows; // current block height
-
-private:
- CommaInitializer& operator=(const CommaInitializer&);
};
/** \anchor MatrixBaseCommaInitRef
diff --git a/Eigen/src/Core/CwiseBinaryOp.h b/Eigen/src/Core/CwiseBinaryOp.h
index 954ea9275..4d7ab6598 100644
--- a/Eigen/src/Core/CwiseBinaryOp.h
+++ b/Eigen/src/Core/CwiseBinaryOp.h
@@ -65,11 +65,16 @@ struct ei_traits > : ei_traits
RhsCoeffReadCost = _RhsNested::CoeffReadCost,
LhsFlags = _LhsNested::Flags,
RhsFlags = _RhsNested::Flags,
+ StorageOrdersAgree = (int(Lhs::Flags)&RowMajorBit)==(int(Rhs::Flags)&RowMajorBit),
Flags = (int(LhsFlags) | int(RhsFlags)) & (
HereditaryBits
- | (int(LhsFlags) & int(RhsFlags) & (LinearAccessBit | AlignedBit))
- | (ei_functor_traits::PacketAccess && ((int(LhsFlags) & RowMajorBit)==(int(RhsFlags) & RowMajorBit))
- ? (int(LhsFlags) & int(RhsFlags) & PacketAccessBit) : 0)),
+ | (int(LhsFlags) & int(RhsFlags) &
+ ( AlignedBit
+ | (StorageOrdersAgree ? LinearAccessBit : 0)
+ | (ei_functor_traits::PacketAccess && StorageOrdersAgree ? PacketAccessBit : 0)
+ )
+ )
+ ),
CoeffReadCost = LhsCoeffReadCost + RhsCoeffReadCost + ei_functor_traits::Cost
};
};
diff --git a/Eigen/src/Core/DenseBase.h b/Eigen/src/Core/DenseBase.h
index ea6383998..a7e74b81d 100644
--- a/Eigen/src/Core/DenseBase.h
+++ b/Eigen/src/Core/DenseBase.h
@@ -274,21 +274,12 @@ template class DenseBase
Eigen::Transpose transpose();
const Eigen::Transpose transpose() const;
void transposeInPlace();
- #ifndef EIGEN_NO_DEBUG
+#ifndef EIGEN_NO_DEBUG
+ protected:
template
- Derived& lazyAssign(const Transpose& other);
- template
- Derived& lazyAssign(const CwiseBinaryOp,Transpose,DerivedB>& other);
- template
- Derived& lazyAssign(const CwiseBinaryOp,DerivedA,Transpose >& other);
-
- template
- Derived& lazyAssign(const CwiseUnaryOp, NestByValue > >& other);
- template
- Derived& lazyAssign(const CwiseBinaryOp,CwiseUnaryOp, NestByValue > >,DerivedB>& other);
- template
- Derived& lazyAssign(const CwiseBinaryOp,DerivedA,CwiseUnaryOp, NestByValue > > >& other);
- #endif
+ void checkTransposeAliasing(const OtherDerived& other) const;
+ public:
+#endif
RowXpr row(int i);
const RowXpr row(int i) const;
@@ -382,18 +373,19 @@ template class DenseBase
template
bool isApprox(const DenseBase& other,
- RealScalar prec = precision()) const;
+ RealScalar prec = dummy_precision()) const;
bool isMuchSmallerThan(const RealScalar& other,
- RealScalar prec = precision()) const;
+ RealScalar prec = dummy_precision()) const;
template
bool isMuchSmallerThan(const DenseBase& other,
- RealScalar prec = precision()) const;
+ RealScalar prec = dummy_precision()) const;
- bool isApproxToConstant(const Scalar& value, RealScalar prec = precision()) const;
- bool isConstant(const Scalar& value, RealScalar prec = precision()) const;
- bool isZero(RealScalar prec = precision()) const;
- bool isOnes(RealScalar prec = precision