aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Benoit Steiner <benoit.steiner.goog@gmail.com>2017-02-10 13:11:40 -0800
committerGravatar Benoit Steiner <benoit.steiner.goog@gmail.com>2017-02-10 13:11:40 -0800
commit769208a17ff15b94b6d8a20a6c00e2fdd7149edd (patch)
tree3b4bb3de0f8a5469a7722abfeabf572c9a4dcaf3
parent0ee97b60c256b31a98838324ce1909247a0133d2 (diff)
parent8b3cc54c42d6f2cc7db6f2a56da0e6510782b747 (diff)
Pulled latest updates from upstream
-rw-r--r--Eigen/StdDeque2
-rw-r--r--Eigen/StdList2
-rw-r--r--Eigen/StdVector2
-rw-r--r--Eigen/src/Core/AssignEvaluator.h4
-rw-r--r--Eigen/src/Core/products/Parallelizer.h7
-rw-r--r--Eigen/src/Core/util/Macros.h12
-rw-r--r--Eigen/src/Eigenvalues/ComplexEigenSolver.h6
-rw-r--r--Eigen/src/Eigenvalues/RealSchur.h12
-rw-r--r--Eigen/src/SVD/JacobiSVD.h6
-rw-r--r--Eigen/src/SparseCore/AmbiVector.h8
-rw-r--r--Eigen/src/plugins/BlockMethods.h56
-rw-r--r--Eigen/src/plugins/IndexedViewMethods.h5
-rw-r--r--test/eigensolver_complex.cpp9
-rw-r--r--test/eigensolver_generic.cpp9
-rw-r--r--test/eigensolver_selfadjoint.cpp9
-rw-r--r--test/indexed_view.cpp4
-rw-r--r--unsupported/Eigen/CXX11/src/Tensor/TensorContraction.h13
17 files changed, 107 insertions, 59 deletions
diff --git a/Eigen/StdDeque b/Eigen/StdDeque
index be3a7f82b..bc68397be 100644
--- a/Eigen/StdDeque
+++ b/Eigen/StdDeque
@@ -14,7 +14,7 @@
#include "Core"
#include <deque>
-#if EIGEN_COMP_MSVC && EIGEN_OS_WIN64 /* MSVC auto aligns in 64 bit builds */
+#if EIGEN_COMP_MSVC && EIGEN_OS_WIN64 && (EIGEN_MAX_STATIC_ALIGN_BYTES<=16) /* MSVC auto aligns up to 16 bytes in 64 bit builds */
#define EIGEN_DEFINE_STL_DEQUE_SPECIALIZATION(...)
diff --git a/Eigen/StdList b/Eigen/StdList
index 07ba1297b..4c6262c08 100644
--- a/Eigen/StdList
+++ b/Eigen/StdList
@@ -13,7 +13,7 @@
#include "Core"
#include <list>
-#if EIGEN_COMP_MSVC && EIGEN_OS_WIN64 /* MSVC auto aligns in 64 bit builds */
+#if EIGEN_COMP_MSVC && EIGEN_OS_WIN64 && (EIGEN_MAX_STATIC_ALIGN_BYTES<=16) /* MSVC auto aligns up to 16 bytes in 64 bit builds */
#define EIGEN_DEFINE_STL_LIST_SPECIALIZATION(...)
diff --git a/Eigen/StdVector b/Eigen/StdVector
index fdfc37766..0c4697ad5 100644
--- a/Eigen/StdVector
+++ b/Eigen/StdVector
@@ -14,7 +14,7 @@
#include "Core"
#include <vector>
-#if EIGEN_COMP_MSVC && EIGEN_OS_WIN64 /* MSVC auto aligns in 64 bit builds */
+#if EIGEN_COMP_MSVC && EIGEN_OS_WIN64 && (EIGEN_MAX_STATIC_ALIGN_BYTES<=16) /* MSVC auto aligns up to 16 bytes in 64 bit builds */
#define EIGEN_DEFINE_STL_VECTOR_SPECIALIZATION(...)
diff --git a/Eigen/src/Core/AssignEvaluator.h b/Eigen/src/Core/AssignEvaluator.h
index 489935b83..b0ec7b7ca 100644
--- a/Eigen/src/Core/AssignEvaluator.h
+++ b/Eigen/src/Core/AssignEvaluator.h
@@ -515,7 +515,7 @@ struct dense_assignment_loop<Kernel, LinearTraversal, CompleteUnrolling>
template<typename Kernel>
struct dense_assignment_loop<Kernel, SliceVectorizedTraversal, NoUnrolling>
{
- EIGEN_DEVICE_FUNC static inline void run(Kernel &kernel)
+ EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE void run(Kernel &kernel)
{
typedef typename Kernel::Scalar Scalar;
typedef typename Kernel::PacketType PacketType;
@@ -563,7 +563,7 @@ struct dense_assignment_loop<Kernel, SliceVectorizedTraversal, NoUnrolling>
template<typename Kernel>
struct dense_assignment_loop<Kernel, SliceVectorizedTraversal, InnerUnrolling>
{
- EIGEN_DEVICE_FUNC static inline void run(Kernel &kernel)
+ EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE void run(Kernel &kernel)
{
typedef typename Kernel::DstEvaluatorType::XprType DstXprType;
typedef typename Kernel::PacketType PacketType;
diff --git a/Eigen/src/Core/products/Parallelizer.h b/Eigen/src/Core/products/Parallelizer.h
index 3477d7182..c2f084c82 100644
--- a/Eigen/src/Core/products/Parallelizer.h
+++ b/Eigen/src/Core/products/Parallelizer.h
@@ -104,13 +104,14 @@ void parallelize_gemm(const Functor& func, Index rows, Index cols, Index depth,
// - the sizes are large enough
// compute the maximal number of threads from the size of the product:
- // FIXME this has to be fine tuned
+ // This first heuristic takes into account that the product kernel is fully optimized when working with nr columns at once.
Index size = transpose ? rows : cols;
- Index pb_max_threads = std::max<Index>(1,size / 32);
+ Index pb_max_threads = std::max<Index>(1,size / Functor::Traits::nr);
+
// compute the maximal number of threads from the total amount of work:
double work = static_cast<double>(rows) * static_cast<double>(cols) *
static_cast<double>(depth);
- double kMinTaskSize = 50000; // Heuristic.
+ double kMinTaskSize = 50000; // FIXME improve this heuristic.
pb_max_threads = std::max<Index>(1, std::min<Index>(pb_max_threads, work / kMinTaskSize));
// compute the number of threads we are going to use
diff --git a/Eigen/src/Core/util/Macros.h b/Eigen/src/Core/util/Macros.h
index ab0550895..0e2863306 100644
--- a/Eigen/src/Core/util/Macros.h
+++ b/Eigen/src/Core/util/Macros.h
@@ -23,7 +23,7 @@
/// \internal EIGEN_COMP_GNUC set to 1 for all compilers compatible with GCC
#ifdef __GNUC__
- #define EIGEN_COMP_GNUC 1
+ #define EIGEN_COMP_GNUC (__GNUC__*10+__GNUC_MINOR__)
#else
#define EIGEN_COMP_GNUC 0
#endif
@@ -80,8 +80,8 @@
// 2015 14 1900
// "15" 15 1900
-/// \internal EIGEN_COMP_MSVC_STRICT set to 1 if the compiler is really Microsoft Visual C++ and not ,e.g., ICC
-#if EIGEN_COMP_MSVC && !(EIGEN_COMP_ICC)
+/// \internal EIGEN_COMP_MSVC_STRICT set to 1 if the compiler is really Microsoft Visual C++ and not ,e.g., ICC or clang-cl
+#if EIGEN_COMP_MSVC && !(EIGEN_COMP_ICC || EIGEN_COMP_LLVM || EIGEN_COMP_CLANG)
#define EIGEN_COMP_MSVC_STRICT _MSC_VER
#else
#define EIGEN_COMP_MSVC_STRICT 0
@@ -349,6 +349,12 @@
# define __has_feature(x) 0
#endif
+#if !( EIGEN_COMP_CLANG && ((EIGEN_COMP_CLANG<309) || defined(__apple_build_version__)) || EIGEN_COMP_GNUC_STRICT && EIGEN_COMP_GNUC<49)
+#define EIGEN_HAS_INDEXED_VIEW 1
+#else
+#define EIGEN_HAS_INDEXED_VIEW 0
+#endif
+
// Upperbound on the C++ version to use.
// Expected values are 03, 11, 14, 17, etc.
// By default, let's use an arbitrarily large C++ version.
diff --git a/Eigen/src/Eigenvalues/ComplexEigenSolver.h b/Eigen/src/Eigenvalues/ComplexEigenSolver.h
index ec3b1633e..dc5fae06a 100644
--- a/Eigen/src/Eigenvalues/ComplexEigenSolver.h
+++ b/Eigen/src/Eigenvalues/ComplexEigenSolver.h
@@ -250,7 +250,7 @@ template<typename _MatrixType> class ComplexEigenSolver
EigenvectorType m_matX;
private:
- void doComputeEigenvectors(const RealScalar& matrixnorm);
+ void doComputeEigenvectors(RealScalar matrixnorm);
void sortEigenvalues(bool computeEigenvectors);
};
@@ -284,10 +284,12 @@ ComplexEigenSolver<MatrixType>::compute(const EigenBase<InputType>& matrix, bool
template<typename MatrixType>
-void ComplexEigenSolver<MatrixType>::doComputeEigenvectors(const RealScalar& matrixnorm)
+void ComplexEigenSolver<MatrixType>::doComputeEigenvectors(RealScalar matrixnorm)
{
const Index n = m_eivalues.size();
+ matrixnorm = numext::maxi(matrixnorm,(std::numeric_limits<RealScalar>::min)());
+
// Compute X such that T = X D X^(-1), where D is the diagonal of T.
// The matrix X is unit triangular.
m_matX = EigenvectorType::Zero(n, n);
diff --git a/Eigen/src/Eigenvalues/RealSchur.h b/Eigen/src/Eigenvalues/RealSchur.h
index d6a339f07..f5c86041d 100644
--- a/Eigen/src/Eigenvalues/RealSchur.h
+++ b/Eigen/src/Eigenvalues/RealSchur.h
@@ -248,12 +248,24 @@ template<typename MatrixType>
template<typename InputType>
RealSchur<MatrixType>& RealSchur<MatrixType>::compute(const EigenBase<InputType>& matrix, bool computeU)
{
+ const Scalar considerAsZero = (std::numeric_limits<Scalar>::min)();
+
eigen_assert(matrix.cols() == matrix.rows());
Index maxIters = m_maxIters;
if (maxIters == -1)
maxIters = m_maxIterationsPerRow * matrix.rows();
Scalar scale = matrix.derived().cwiseAbs().maxCoeff();
+ if(scale<considerAsZero)
+ {
+ m_matT.setZero(matrix.rows(),matrix.cols());
+ if(computeU)
+ m_matU.setIdentity(matrix.rows(),matrix.cols());
+ m_info = Success;
+ m_isInitialized = true;
+ m_matUisUptodate = computeU;
+ return *this;
+ }
// Step 1. Reduce to Hessenberg form
m_hess.compute(matrix.derived()/scale);
diff --git a/Eigen/src/SVD/JacobiSVD.h b/Eigen/src/SVD/JacobiSVD.h
index e0cfb6283..1337ae987 100644
--- a/Eigen/src/SVD/JacobiSVD.h
+++ b/Eigen/src/SVD/JacobiSVD.h
@@ -200,10 +200,12 @@ public:
ColsAtCompileTime = MatrixType::ColsAtCompileTime,
MaxRowsAtCompileTime = MatrixType::MaxRowsAtCompileTime,
MaxColsAtCompileTime = MatrixType::MaxColsAtCompileTime,
- Options = MatrixType::Options
+ TrOptions = RowsAtCompileTime==1 ? (MatrixType::Options & ~(RowMajor))
+ : ColsAtCompileTime==1 ? (MatrixType::Options | RowMajor)
+ : MatrixType::Options
};
- typedef Matrix<Scalar, ColsAtCompileTime, RowsAtCompileTime, Options, MaxColsAtCompileTime, MaxRowsAtCompileTime>
+ typedef Matrix<Scalar, ColsAtCompileTime, RowsAtCompileTime, TrOptions, MaxColsAtCompileTime, MaxRowsAtCompileTime>
TransposeTypeWithSameStorageOrder;
void allocate(const JacobiSVD<MatrixType, ColPivHouseholderQRPreconditioner>& svd)
diff --git a/Eigen/src/SparseCore/AmbiVector.h b/Eigen/src/SparseCore/AmbiVector.h
index 1233e164e..8a5cc91f2 100644
--- a/Eigen/src/SparseCore/AmbiVector.h
+++ b/Eigen/src/SparseCore/AmbiVector.h
@@ -336,7 +336,7 @@ class AmbiVector<_Scalar,_StorageIndex>::Iterator
{
do {
++m_cachedIndex;
- } while (m_cachedIndex<m_vector.m_end && abs(m_vector.m_buffer[m_cachedIndex])<m_epsilon);
+ } while (m_cachedIndex<m_vector.m_end && abs(m_vector.m_buffer[m_cachedIndex])<=m_epsilon);
if (m_cachedIndex<m_vector.m_end)
m_cachedValue = m_vector.m_buffer[m_cachedIndex];
else
@@ -347,7 +347,7 @@ class AmbiVector<_Scalar,_StorageIndex>::Iterator
ListEl* EIGEN_RESTRICT llElements = reinterpret_cast<ListEl*>(m_vector.m_buffer);
do {
m_currentEl = llElements[m_currentEl].next;
- } while (m_currentEl>=0 && abs(llElements[m_currentEl].value)<m_epsilon);
+ } while (m_currentEl>=0 && abs(llElements[m_currentEl].value)<=m_epsilon);
if (m_currentEl<0)
{
m_cachedIndex = -1;
@@ -363,9 +363,9 @@ class AmbiVector<_Scalar,_StorageIndex>::Iterator
protected:
const AmbiVector& m_vector; // the target vector
- StorageIndex m_currentEl; // the current element in sparse/linked-list mode
+ StorageIndex m_currentEl; // the current element in sparse/linked-list mode
RealScalar m_epsilon; // epsilon used to prune zero coefficients
- StorageIndex m_cachedIndex; // current coordinate
+ StorageIndex m_cachedIndex; // current coordinate
Scalar m_cachedValue; // current value
bool m_isDense; // mode of the vector
};
diff --git a/Eigen/src/plugins/BlockMethods.h b/Eigen/src/plugins/BlockMethods.h
index 2d5a4e507..5caf14469 100644
--- a/Eigen/src/plugins/BlockMethods.h
+++ b/Eigen/src/plugins/BlockMethods.h
@@ -78,8 +78,8 @@ EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
///
/// \sa class Block, fix, fix<N>(int)
///
-EIGEN_DEVICE_FUNC
template<typename NRowsType, typename NColsType>
+EIGEN_DEVICE_FUNC
#ifndef EIGEN_PARSED_BY_DOXYGEN
inline typename FixedBlockXpr<internal::get_fixed_value<NRowsType>::value,internal::get_fixed_value<NColsType>::value>::Type
#else
@@ -92,8 +92,8 @@ block(Index startRow, Index startCol, NRowsType blockRows, NColsType blockCols)
}
/// This is the const version of block(Index,Index,NRowsType,NColsType)
-EIGEN_DEVICE_FUNC
template<typename NRowsType, typename NColsType>
+EIGEN_DEVICE_FUNC
#ifndef EIGEN_PARSED_BY_DOXYGEN
inline const typename ConstFixedBlockXpr<internal::get_fixed_value<NRowsType>::value,internal::get_fixed_value<NColsType>::value>::Type
#else
@@ -124,8 +124,8 @@ EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
///
/// \sa block(Index,Index,NRowsType,NColsType), class Block
///
-EIGEN_DEVICE_FUNC
template<typename NRowsType, typename NColsType>
+EIGEN_DEVICE_FUNC
#ifndef EIGEN_PARSED_BY_DOXYGEN
inline typename FixedBlockXpr<internal::get_fixed_value<NRowsType>::value,internal::get_fixed_value<NColsType>::value>::Type
#else
@@ -138,8 +138,8 @@ topRightCorner(NRowsType cRows, NColsType cCols)
}
/// This is the const version of topRightCorner(NRowsType, NColsType).
-EIGEN_DEVICE_FUNC
template<typename NRowsType, typename NColsType>
+EIGEN_DEVICE_FUNC
#ifndef EIGEN_PARSED_BY_DOXYGEN
inline const typename ConstFixedBlockXpr<internal::get_fixed_value<NRowsType>::value,internal::get_fixed_value<NColsType>::value>::Type
#else
@@ -229,8 +229,8 @@ EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
///
/// \sa block(Index,Index,NRowsType,NColsType), class Block
///
-EIGEN_DEVICE_FUNC
template<typename NRowsType, typename NColsType>
+EIGEN_DEVICE_FUNC
#ifndef EIGEN_PARSED_BY_DOXYGEN
inline typename FixedBlockXpr<internal::get_fixed_value<NRowsType>::value,internal::get_fixed_value<NColsType>::value>::Type
#else
@@ -243,8 +243,8 @@ topLeftCorner(NRowsType cRows, NColsType cCols)
}
/// This is the const version of topLeftCorner(Index, Index).
-EIGEN_DEVICE_FUNC
template<typename NRowsType, typename NColsType>
+EIGEN_DEVICE_FUNC
#ifndef EIGEN_PARSED_BY_DOXYGEN
inline const typename ConstFixedBlockXpr<internal::get_fixed_value<NRowsType>::value,internal::get_fixed_value<NColsType>::value>::Type
#else
@@ -333,8 +333,8 @@ EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
///
/// \sa block(Index,Index,NRowsType,NColsType), class Block
///
-EIGEN_DEVICE_FUNC
template<typename NRowsType, typename NColsType>
+EIGEN_DEVICE_FUNC
#ifndef EIGEN_PARSED_BY_DOXYGEN
inline typename FixedBlockXpr<internal::get_fixed_value<NRowsType>::value,internal::get_fixed_value<NColsType>::value>::Type
#else
@@ -348,8 +348,8 @@ bottomRightCorner(NRowsType cRows, NColsType cCols)
}
/// This is the const version of bottomRightCorner(NRowsType, NColsType).
-EIGEN_DEVICE_FUNC
template<typename NRowsType, typename NColsType>
+EIGEN_DEVICE_FUNC
#ifndef EIGEN_PARSED_BY_DOXYGEN
inline const typename ConstFixedBlockXpr<internal::get_fixed_value<NRowsType>::value,internal::get_fixed_value<NColsType>::value>::Type
#else
@@ -439,8 +439,8 @@ EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
///
/// \sa block(Index,Index,NRowsType,NColsType), class Block
///
-EIGEN_DEVICE_FUNC
template<typename NRowsType, typename NColsType>
+EIGEN_DEVICE_FUNC
#ifndef EIGEN_PARSED_BY_DOXYGEN
inline typename FixedBlockXpr<internal::get_fixed_value<NRowsType>::value,internal::get_fixed_value<NColsType>::value>::Type
#else
@@ -454,8 +454,8 @@ bottomLeftCorner(NRowsType cRows, NColsType cCols)
}
/// This is the const version of bottomLeftCorner(NRowsType, NColsType).
-EIGEN_DEVICE_FUNC
template<typename NRowsType, typename NColsType>
+EIGEN_DEVICE_FUNC
#ifndef EIGEN_PARSED_BY_DOXYGEN
inline typename ConstFixedBlockXpr<internal::get_fixed_value<NRowsType>::value,internal::get_fixed_value<NColsType>::value>::Type
#else
@@ -544,8 +544,8 @@ EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(row-major)
///
/// \sa block(Index,Index,NRowsType,NColsType), class Block
///
-EIGEN_DEVICE_FUNC
template<typename NRowsType>
+EIGEN_DEVICE_FUNC
#ifndef EIGEN_PARSED_BY_DOXYGEN
inline typename NRowsBlockXpr<internal::get_fixed_value<NRowsType>::value>::Type
#else
@@ -558,8 +558,8 @@ topRows(NRowsType n)
}
/// This is the const version of topRows(NRowsType).
-EIGEN_DEVICE_FUNC
template<typename NRowsType>
+EIGEN_DEVICE_FUNC
#ifndef EIGEN_PARSED_BY_DOXYGEN
inline const typename ConstNRowsBlockXpr<internal::get_fixed_value<NRowsType>::value>::Type
#else
@@ -619,8 +619,8 @@ EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(row-major)
///
/// \sa block(Index,Index,NRowsType,NColsType), class Block
///
-EIGEN_DEVICE_FUNC
template<typename NRowsType>
+EIGEN_DEVICE_FUNC
#ifndef EIGEN_PARSED_BY_DOXYGEN
inline typename NRowsBlockXpr<internal::get_fixed_value<NRowsType>::value>::Type
#else
@@ -633,8 +633,8 @@ bottomRows(NRowsType n)
}
/// This is the const version of bottomRows(NRowsType).
-EIGEN_DEVICE_FUNC
template<typename NRowsType>
+EIGEN_DEVICE_FUNC
#ifndef EIGEN_PARSED_BY_DOXYGEN
inline const typename ConstNRowsBlockXpr<internal::get_fixed_value<NRowsType>::value>::Type
#else
@@ -695,8 +695,8 @@ EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(row-major)
///
/// \sa block(Index,Index,NRowsType,NColsType), class Block
///
-EIGEN_DEVICE_FUNC
template<typename NRowsType>
+EIGEN_DEVICE_FUNC
#ifndef EIGEN_PARSED_BY_DOXYGEN
inline typename NRowsBlockXpr<internal::get_fixed_value<NRowsType>::value>::Type
#else
@@ -709,8 +709,8 @@ middleRows(Index startRow, NRowsType n)
}
/// This is the const version of middleRows(Index,NRowsType).
-EIGEN_DEVICE_FUNC
template<typename NRowsType>
+EIGEN_DEVICE_FUNC
#ifndef EIGEN_PARSED_BY_DOXYGEN
inline const typename ConstNRowsBlockXpr<internal::get_fixed_value<NRowsType>::value>::Type
#else
@@ -771,8 +771,8 @@ EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(column-major)
///
/// \sa block(Index,Index,NRowsType,NColsType), class Block
///
-EIGEN_DEVICE_FUNC
template<typename NColsType>
+EIGEN_DEVICE_FUNC
#ifndef EIGEN_PARSED_BY_DOXYGEN
inline typename NColsBlockXpr<internal::get_fixed_value<NColsType>::value>::Type
#else
@@ -785,8 +785,8 @@ leftCols(NColsType n)
}
/// This is the const version of leftCols(NColsType).
-EIGEN_DEVICE_FUNC
template<typename NColsType>
+EIGEN_DEVICE_FUNC
#ifndef EIGEN_PARSED_BY_DOXYGEN
inline const typename ConstNColsBlockXpr<internal::get_fixed_value<NColsType>::value>::Type
#else
@@ -846,8 +846,8 @@ EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(column-major)
///
/// \sa block(Index,Index,NRowsType,NColsType), class Block
///
-EIGEN_DEVICE_FUNC
template<typename NColsType>
+EIGEN_DEVICE_FUNC
#ifndef EIGEN_PARSED_BY_DOXYGEN
inline typename NColsBlockXpr<internal::get_fixed_value<NColsType>::value>::Type
#else
@@ -860,8 +860,8 @@ rightCols(NColsType n)
}
/// This is the const version of rightCols(NColsType).
-EIGEN_DEVICE_FUNC
template<typename NColsType>
+EIGEN_DEVICE_FUNC
#ifndef EIGEN_PARSED_BY_DOXYGEN
inline const typename ConstNColsBlockXpr<internal::get_fixed_value<NColsType>::value>::Type
#else
@@ -922,8 +922,8 @@ EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(column-major)
///
/// \sa block(Index,Index,NRowsType,NColsType), class Block
///
-EIGEN_DEVICE_FUNC
template<typename NColsType>
+EIGEN_DEVICE_FUNC
#ifndef EIGEN_PARSED_BY_DOXYGEN
inline typename NColsBlockXpr<internal::get_fixed_value<NColsType>::value>::Type
#else
@@ -936,8 +936,8 @@ middleCols(Index startCol, NColsType numCols)
}
/// This is the const version of middleCols(Index,NColsType).
-EIGEN_DEVICE_FUNC
template<typename NColsType>
+EIGEN_DEVICE_FUNC
#ifndef EIGEN_PARSED_BY_DOXYGEN
inline const typename ConstNColsBlockXpr<internal::get_fixed_value<NColsType>::value>::Type
#else
@@ -1130,8 +1130,8 @@ inline ConstRowXpr row(Index i) const
///
/// \sa block(Index,Index,NRowsType,NColsType), fix<N>, fix<N>(int), class Block
///
-EIGEN_DEVICE_FUNC
template<typename NType>
+EIGEN_DEVICE_FUNC
#ifndef EIGEN_PARSED_BY_DOXYGEN
inline typename FixedSegmentReturnType<internal::get_fixed_value<NType>::value>::Type
#else
@@ -1146,8 +1146,8 @@ segment(Index start, NType n)
/// This is the const version of segment(Index,NType).
-EIGEN_DEVICE_FUNC
template<typename NType>
+EIGEN_DEVICE_FUNC
#ifndef EIGEN_PARSED_BY_DOXYGEN
inline const typename ConstFixedSegmentReturnType<internal::get_fixed_value<NType>::value>::Type
#else
@@ -1180,8 +1180,8 @@ segment(Index start, NType n) const
///
/// \sa class Block, block(Index,Index)
///
-EIGEN_DEVICE_FUNC
template<typename NType>
+EIGEN_DEVICE_FUNC
#ifndef EIGEN_PARSED_BY_DOXYGEN
inline typename FixedSegmentReturnType<internal::get_fixed_value<NType>::value>::Type
#else
@@ -1195,8 +1195,8 @@ head(NType n)
}
/// This is the const version of head(NType).
-EIGEN_DEVICE_FUNC
template<typename NType>
+EIGEN_DEVICE_FUNC
#ifndef EIGEN_PARSED_BY_DOXYGEN
inline const typename ConstFixedSegmentReturnType<internal::get_fixed_value<NType>::value>::Type
#else
@@ -1229,8 +1229,8 @@ head(NType n) const
///
/// \sa class Block, block(Index,Index)
///
-EIGEN_DEVICE_FUNC
template<typename NType>
+EIGEN_DEVICE_FUNC
#ifndef EIGEN_PARSED_BY_DOXYGEN
inline typename FixedSegmentReturnType<internal::get_fixed_value<NType>::value>::Type
#else
@@ -1244,8 +1244,8 @@ tail(NType n)
}
/// This is the const version of tail(Index).
-EIGEN_DEVICE_FUNC
template<typename NType>
+EIGEN_DEVICE_FUNC
#ifndef EIGEN_PARSED_BY_DOXYGEN
inline const typename ConstFixedSegmentReturnType<internal::get_fixed_value<NType>::value>::Type
#else
diff --git a/Eigen/src/plugins/IndexedViewMethods.h b/Eigen/src/plugins/IndexedViewMethods.h
index b2cc2944a..5e28ec71c 100644
--- a/Eigen/src/plugins/IndexedViewMethods.h
+++ b/Eigen/src/plugins/IndexedViewMethods.h
@@ -7,7 +7,7 @@
// Public License v. 2.0. If a copy of the MPL was not distributed
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#ifndef EIGEN_PARSED_BY_DOXYGEN
+#if !defined(EIGEN_PARSED_BY_DOXYGEN) && EIGEN_HAS_INDEXED_VIEW
// This file is automatically included twice to generate const and non-const versions
@@ -256,5 +256,4 @@ template<typename Indices>
IndexedView_or_VectorBlock
operator()(const Indices& indices);
-#endif // EIGEN_PARSED_BY_DOXYGEN
-
+#endif // EIGEN_PARSED_BY_DOXYGEN && EIGEN_HAS_INDEXED_VIEW
diff --git a/test/eigensolver_complex.cpp b/test/eigensolver_complex.cpp
index 8e2bb9ef0..293b1b265 100644
--- a/test/eigensolver_complex.cpp
+++ b/test/eigensolver_complex.cpp
@@ -131,6 +131,15 @@ template<typename MatrixType> void eigensolver(const MatrixType& m)
ComplexEigenSolver<MatrixType> eig(a.adjoint() * a);
eig.compute(a.adjoint() * a);
}
+
+ // regression test for bug 478
+ {
+ a.setZero();
+ ComplexEigenSolver<MatrixType> ei3(a);
+ VERIFY_IS_EQUAL(ei3.info(), Success);
+ VERIFY_IS_MUCH_SMALLER_THAN(ei3.eigenvalues().norm(),RealScalar(1));
+ VERIFY((ei3.eigenvectors().transpose()*ei3.eigenvectors().transpose()).eval().isIdentity());
+ }
}
template<typename MatrixType> void eigensolver_verify_assert(const MatrixType& m)
diff --git a/test/eigensolver_generic.cpp b/test/eigensolver_generic.cpp
index e18fbf687..d0e644d4b 100644
--- a/test/eigensolver_generic.cpp
+++ b/test/eigensolver_generic.cpp
@@ -76,6 +76,15 @@ template<typename MatrixType> void eigensolver(const MatrixType& m)
EigenSolver<MatrixType> eig(a.adjoint() * a);
eig.compute(a.adjoint() * a);
}
+
+ // regression test for bug 478
+ {
+ a.setZero();
+ EigenSolver<MatrixType> ei3(a);
+ VERIFY_IS_EQUAL(ei3.info(), Success);
+ VERIFY_IS_MUCH_SMALLER_THAN(ei3.eigenvalues().norm(),RealScalar(1));
+ VERIFY((ei3.eigenvectors().transpose()*ei3.eigenvectors().transpose()).eval().isIdentity());
+ }
}
template<typename MatrixType> void eigensolver_verify_assert(const MatrixType& m)
diff --git a/test/eigensolver_selfadjoint.cpp b/test/eigensolver_selfadjoint.cpp
index 4ed126116..39ad4130e 100644
--- a/test/eigensolver_selfadjoint.cpp
+++ b/test/eigensolver_selfadjoint.cpp
@@ -180,6 +180,15 @@ template<typename MatrixType> void selfadjointeigensolver(const MatrixType& m)
SelfAdjointEigenSolver<MatrixType> eig(a.adjoint() * a);
eig.compute(a.adjoint() * a);
}
+
+ // regression test for bug 478
+ {
+ a.setZero();
+ SelfAdjointEigenSolver<MatrixType> ei3(a);
+ VERIFY_IS_EQUAL(ei3.info(), Success);
+ VERIFY_IS_MUCH_SMALLER_THAN(ei3.eigenvalues().norm(),RealScalar(1));
+ VERIFY((ei3.eigenvectors().transpose()*ei3.eigenvectors().transpose()).eval().isIdentity());
+ }
}
template<int>
diff --git a/test/indexed_view.cpp b/test/indexed_view.cpp
index 909d2351d..4cbc00639 100644
--- a/test/indexed_view.cpp
+++ b/test/indexed_view.cpp
@@ -79,6 +79,7 @@ is_same_seq_type(const T1& a, const T2& b)
void check_indexed_view()
{
+#if EIGEN_HAS_INDEXED_VIEW
using Eigen::placeholders::all;
using Eigen::placeholders::last;
using Eigen::placeholders::end;
@@ -297,7 +298,6 @@ void check_indexed_view()
VERIFY_IS_APPROX( (A(std::array<int,3>{{1,3,5}}, std::array<int,4>{{9,6,3,0}})), A(seqN(1,3,2), seqN(9,4,-3)) );
-#if (!EIGEN_COMP_CLANG) || (EIGEN_COMP_CLANG>=308 && !defined(__apple_build_version__))
VERIFY_IS_APPROX( A({3, 1, 6, 5}, all), A(std::array<int,4>{{3, 1, 6, 5}}, all) );
VERIFY_IS_APPROX( A(all,{3, 1, 6, 5}), A(all,std::array<int,4>{{3, 1, 6, 5}}) );
VERIFY_IS_APPROX( A({1,3,5},{3, 1, 6, 5}), A(std::array<int,3>{{1,3,5}},std::array<int,4>{{3, 1, 6, 5}}) );
@@ -310,7 +310,6 @@ void check_indexed_view()
VERIFY_IS_APPROX( b({3, 1, 6, 5}), b(std::array<int,4>{{3, 1, 6, 5}}) );
VERIFY_IS_EQUAL( b({1,3,5}).SizeAtCompileTime, 3 );
-#endif
#endif
@@ -366,6 +365,7 @@ void check_indexed_view()
VERIFY( is_same_eq( cA.middleRows<3>(1), cA.middleRows(1,fix<3>)) );
}
+#endif // EIGEN_HAS_INDEXED_VIEW
}
void test_indexed_view()
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorContraction.h b/unsupported/Eigen/CXX11/src/Tensor/TensorContraction.h
index 71f086426..bf4a476d9 100644
--- a/unsupported/Eigen/CXX11/src/Tensor/TensorContraction.h
+++ b/unsupported/Eigen/CXX11/src/Tensor/TensorContraction.h
@@ -64,9 +64,9 @@ void pack_simple(Scalar * dst, const Scalar * src, Index cols, Index rows, Index
template<typename LhsScalar, typename RhsScalar, typename Scalar>
struct libxsmm_wrapper {
libxsmm_wrapper() {}
- libxsmm_wrapper(int flags, int m, int n, int k, int lda, int ldb, int ldc, float alpha, float beta, int prefetch) {}
- void operator()(const LhsScalar* a, const RhsScalar* b, Scalar* c) {}
- void operator()(const LhsScalar* a, const RhsScalar* b, Scalar* c, const LhsScalar* ap, const RhsScalar* bp, const Scalar* cp) {}
+ libxsmm_wrapper(int, int, int, int, int, int, int, float, float, int) {}
+ void operator()(const LhsScalar*, const RhsScalar*, Scalar*) {}
+ void operator()(const LhsScalar*, const RhsScalar*, Scalar*, const LhsScalar*, const RhsScalar*, const Scalar*) {}
};
template<>
@@ -682,10 +682,9 @@ protected:
}
m_can_use_xsmm = true;
- #else
- // silence the compiler warning
- (void) eval_op_indices;
- #endif
+#else
+ EIGEN_UNUSED_VARIABLE(eval_op_indices);
+#endif
}
#if defined(EIGEN_VECTORIZE_AVX) && defined(EIGEN_USE_LIBXSMM)