Update Eigen to: https://gitlab.com/libeigen/eigen/-/commit/7792b1e909a98703181aecb8810b4b654004c25d

PiperOrigin-RevId: 395810025
Change-Id: I1c70f15d739180a1d9f4db22a9f3a2c61e4ad1f6
diff --git a/Eigen/Core b/Eigen/Core
index 5921e15..3c03519 100644
--- a/Eigen/Core
+++ b/Eigen/Core
@@ -109,7 +109,8 @@
 #endif
 
 // required for __cpuid, needs to be included after cmath
-#if EIGEN_COMP_MSVC && EIGEN_ARCH_i386_OR_x86_64 && !EIGEN_OS_WINCE
+// also required for _BitScanReverse on Windows on ARM
+#if EIGEN_COMP_MSVC && (EIGEN_ARCH_i386_OR_x86_64 || EIGEN_ARCH_ARM64) && !EIGEN_OS_WINCE
   #include <intrin.h>
 #endif
 
diff --git a/Eigen/src/Cholesky/LDLT.h b/Eigen/src/Cholesky/LDLT.h
index 1013ca0..1dffbb6 100644
--- a/Eigen/src/Cholesky/LDLT.h
+++ b/Eigen/src/Cholesky/LDLT.h
@@ -16,8 +16,8 @@
 namespace Eigen {
 
 namespace internal {
-  template<typename _MatrixType, int _UpLo> struct traits<LDLT<_MatrixType, _UpLo> >
-   : traits<_MatrixType>
+  template<typename MatrixType_, int UpLo_> struct traits<LDLT<MatrixType_, UpLo_> >
+   : traits<MatrixType_>
   {
     typedef MatrixXpr XprKind;
     typedef SolverStorage StorageKind;
@@ -37,8 +37,8 @@
   *
   * \brief Robust Cholesky decomposition of a matrix with pivoting
   *
-  * \tparam _MatrixType the type of the matrix of which to compute the LDL^T Cholesky decomposition
-  * \tparam _UpLo the triangular part that will be used for the decompositon: Lower (default) or Upper.
+  * \tparam MatrixType_ the type of the matrix of which to compute the LDL^T Cholesky decomposition
+  * \tparam UpLo_ the triangular part that will be used for the decomposition: Lower (default) or Upper.
   *             The other triangular part won't be read.
   *
   * Perform a robust Cholesky decomposition of a positive semidefinite or negative semidefinite
@@ -56,11 +56,11 @@
   *
   * \sa MatrixBase::ldlt(), SelfAdjointView::ldlt(), class LLT
   */
-template<typename _MatrixType, int _UpLo> class LDLT
-        : public SolverBase<LDLT<_MatrixType, _UpLo> >
+template<typename MatrixType_, int UpLo_> class LDLT
+        : public SolverBase<LDLT<MatrixType_, UpLo_> >
 {
   public:
-    typedef _MatrixType MatrixType;
+    typedef MatrixType_ MatrixType;
     typedef SolverBase<LDLT> Base;
     friend class SolverBase<LDLT>;
 
@@ -68,7 +68,7 @@
     enum {
       MaxRowsAtCompileTime = MatrixType::MaxRowsAtCompileTime,
       MaxColsAtCompileTime = MatrixType::MaxColsAtCompileTime,
-      UpLo = _UpLo
+      UpLo = UpLo_
     };
     typedef Matrix<Scalar, RowsAtCompileTime, 1, 0, MaxRowsAtCompileTime, 1> TmpMatrixType;
 
@@ -494,9 +494,9 @@
 
 /** Compute / recompute the LDLT decomposition A = L D L^* = U^* D U of \a matrix
   */
-template<typename MatrixType, int _UpLo>
+template<typename MatrixType, int UpLo_>
 template<typename InputType>
-LDLT<MatrixType,_UpLo>& LDLT<MatrixType,_UpLo>::compute(const EigenBase<InputType>& a)
+LDLT<MatrixType,UpLo_>& LDLT<MatrixType,UpLo_>::compute(const EigenBase<InputType>& a)
 {
   check_template_parameters();
 
@@ -510,7 +510,7 @@
   // TODO move this code to SelfAdjointView
   for (Index col = 0; col < size; ++col) {
     RealScalar abs_col_sum;
-    if (_UpLo == Lower)
+    if (UpLo_ == Lower)
       abs_col_sum = m_matrix.col(col).tail(size - col).template lpNorm<1>() + m_matrix.row(col).head(col).template lpNorm<1>();
     else
       abs_col_sum = m_matrix.col(col).head(col).template lpNorm<1>() + m_matrix.row(col).tail(size - col).template lpNorm<1>();
@@ -534,9 +534,9 @@
  * \param sigma a scalar, +1 for updates and -1 for "downdates," which correspond to removing previously-added column vectors. Optional; default value is +1.
  * \sa setZero()
   */
-template<typename MatrixType, int _UpLo>
+template<typename MatrixType, int UpLo_>
 template<typename Derived>
-LDLT<MatrixType,_UpLo>& LDLT<MatrixType,_UpLo>::rankUpdate(const MatrixBase<Derived>& w, const typename LDLT<MatrixType,_UpLo>::RealScalar& sigma)
+LDLT<MatrixType,UpLo_>& LDLT<MatrixType,UpLo_>::rankUpdate(const MatrixBase<Derived>& w, const typename LDLT<MatrixType,UpLo_>::RealScalar& sigma)
 {
   typedef typename TranspositionType::StorageIndex IndexType;
   const Index size = w.rows();
@@ -562,16 +562,16 @@
 }
 
 #ifndef EIGEN_PARSED_BY_DOXYGEN
-template<typename _MatrixType, int _UpLo>
+template<typename MatrixType_, int UpLo_>
 template<typename RhsType, typename DstType>
-void LDLT<_MatrixType,_UpLo>::_solve_impl(const RhsType &rhs, DstType &dst) const
+void LDLT<MatrixType_,UpLo_>::_solve_impl(const RhsType &rhs, DstType &dst) const
 {
   _solve_impl_transposed<true>(rhs, dst);
 }
 
-template<typename _MatrixType,int _UpLo>
+template<typename MatrixType_,int UpLo_>
 template<bool Conjugate, typename RhsType, typename DstType>
-void LDLT<_MatrixType,_UpLo>::_solve_impl_transposed(const RhsType &rhs, DstType &dst) const
+void LDLT<MatrixType_,UpLo_>::_solve_impl_transposed(const RhsType &rhs, DstType &dst) const
 {
   // dst = P b
   dst = m_transpositions * rhs;
@@ -624,9 +624,9 @@
   *
   * \sa LDLT::solve(), MatrixBase::ldlt()
   */
-template<typename MatrixType,int _UpLo>
+template<typename MatrixType,int UpLo_>
 template<typename Derived>
-bool LDLT<MatrixType,_UpLo>::solveInPlace(MatrixBase<Derived> &bAndX) const
+bool LDLT<MatrixType,UpLo_>::solveInPlace(MatrixBase<Derived> &bAndX) const
 {
   eigen_assert(m_isInitialized && "LDLT is not initialized.");
   eigen_assert(m_matrix.rows() == bAndX.rows());
@@ -639,8 +639,8 @@
 /** \returns the matrix represented by the decomposition,
  * i.e., it returns the product: P^T L D L^* P.
  * This function is provided for debug purpose. */
-template<typename MatrixType, int _UpLo>
-MatrixType LDLT<MatrixType,_UpLo>::reconstructedMatrix() const
+template<typename MatrixType, int UpLo_>
+MatrixType LDLT<MatrixType,UpLo_>::reconstructedMatrix() const
 {
   eigen_assert(m_isInitialized && "LDLT is not initialized.");
   const Index size = m_matrix.rows();
diff --git a/Eigen/src/Cholesky/LLT.h b/Eigen/src/Cholesky/LLT.h
index 8c9b2b3..3b7aa4d 100644
--- a/Eigen/src/Cholesky/LLT.h
+++ b/Eigen/src/Cholesky/LLT.h
@@ -14,8 +14,8 @@
 
 namespace internal{
 
-template<typename _MatrixType, int _UpLo> struct traits<LLT<_MatrixType, _UpLo> >
- : traits<_MatrixType>
+template<typename MatrixType_, int UpLo_> struct traits<LLT<MatrixType_, UpLo_> >
+ : traits<MatrixType_>
 {
   typedef MatrixXpr XprKind;
   typedef SolverStorage StorageKind;
@@ -32,8 +32,8 @@
   *
   * \brief Standard Cholesky decomposition (LL^T) of a matrix and associated features
   *
-  * \tparam _MatrixType the type of the matrix of which we are computing the LL^T Cholesky decomposition
-  * \tparam _UpLo the triangular part that will be used for the decompositon: Lower (default) or Upper.
+  * \tparam MatrixType_ the type of the matrix of which we are computing the LL^T Cholesky decomposition
+  * \tparam UpLo_ the triangular part that will be used for the decomposition: Lower (default) or Upper.
   *               The other triangular part won't be read.
   *
   * This class performs a LL^T Cholesky decomposition of a symmetric, positive definite
@@ -58,16 +58,16 @@
   *
   * This class supports the \link InplaceDecomposition inplace decomposition \endlink mechanism.
   *
-  * Note that during the decomposition, only the lower (or upper, as defined by _UpLo) triangular part of A is considered.
+  * Note that during the decomposition, only the lower (or upper, as defined by UpLo_) triangular part of A is considered.
   * Therefore, the strict lower part does not have to store correct values.
   *
   * \sa MatrixBase::llt(), SelfAdjointView::llt(), class LDLT
   */
-template<typename _MatrixType, int _UpLo> class LLT
-        : public SolverBase<LLT<_MatrixType, _UpLo> >
+template<typename MatrixType_, int UpLo_> class LLT
+        : public SolverBase<LLT<MatrixType_, UpLo_> >
 {
   public:
-    typedef _MatrixType MatrixType;
+    typedef MatrixType_ MatrixType;
     typedef SolverBase<LLT> Base;
     friend class SolverBase<LLT>;
 
@@ -79,7 +79,7 @@
     enum {
       PacketSize = internal::packet_traits<Scalar>::size,
       AlignmentMask = int(PacketSize)-1,
-      UpLo = _UpLo
+      UpLo = UpLo_
     };
 
     typedef internal::LLT_Traits<MatrixType,UpLo> Traits;
@@ -427,9 +427,9 @@
   * Example: \include TutorialLinAlgComputeTwice.cpp
   * Output: \verbinclude TutorialLinAlgComputeTwice.out
   */
-template<typename MatrixType, int _UpLo>
+template<typename MatrixType, int UpLo_>
 template<typename InputType>
-LLT<MatrixType,_UpLo>& LLT<MatrixType,_UpLo>::compute(const EigenBase<InputType>& a)
+LLT<MatrixType,UpLo_>& LLT<MatrixType,UpLo_>::compute(const EigenBase<InputType>& a)
 {
   check_template_parameters();
 
@@ -444,7 +444,7 @@
   // TODO move this code to SelfAdjointView
   for (Index col = 0; col < size; ++col) {
     RealScalar abs_col_sum;
-    if (_UpLo == Lower)
+    if (UpLo_ == Lower)
       abs_col_sum = m_matrix.col(col).tail(size - col).template lpNorm<1>() + m_matrix.row(col).head(col).template lpNorm<1>();
     else
       abs_col_sum = m_matrix.col(col).head(col).template lpNorm<1>() + m_matrix.row(col).tail(size - col).template lpNorm<1>();
@@ -464,9 +464,9 @@
   * then after it we have LL^* = A + sigma * v v^* where \a v must be a vector
   * of same dimension.
   */
-template<typename _MatrixType, int _UpLo>
+template<typename MatrixType_, int UpLo_>
 template<typename VectorType>
-LLT<_MatrixType,_UpLo> & LLT<_MatrixType,_UpLo>::rankUpdate(const VectorType& v, const RealScalar& sigma)
+LLT<MatrixType_,UpLo_> & LLT<MatrixType_,UpLo_>::rankUpdate(const VectorType& v, const RealScalar& sigma)
 {
   EIGEN_STATIC_ASSERT_VECTOR_ONLY(VectorType);
   eigen_assert(v.size()==m_matrix.cols());
@@ -480,16 +480,16 @@
 }
 
 #ifndef EIGEN_PARSED_BY_DOXYGEN
-template<typename _MatrixType,int _UpLo>
+template<typename MatrixType_,int UpLo_>
 template<typename RhsType, typename DstType>
-void LLT<_MatrixType,_UpLo>::_solve_impl(const RhsType &rhs, DstType &dst) const
+void LLT<MatrixType_,UpLo_>::_solve_impl(const RhsType &rhs, DstType &dst) const
 {
   _solve_impl_transposed<true>(rhs, dst);
 }
 
-template<typename _MatrixType,int _UpLo>
+template<typename MatrixType_,int UpLo_>
 template<bool Conjugate, typename RhsType, typename DstType>
-void LLT<_MatrixType,_UpLo>::_solve_impl_transposed(const RhsType &rhs, DstType &dst) const
+void LLT<MatrixType_,UpLo_>::_solve_impl_transposed(const RhsType &rhs, DstType &dst) const
 {
     dst = rhs;
 
@@ -511,9 +511,9 @@
   *
   * \sa LLT::solve(), MatrixBase::llt()
   */
-template<typename MatrixType, int _UpLo>
+template<typename MatrixType, int UpLo_>
 template<typename Derived>
-void LLT<MatrixType,_UpLo>::solveInPlace(const MatrixBase<Derived> &bAndX) const
+void LLT<MatrixType,UpLo_>::solveInPlace(const MatrixBase<Derived> &bAndX) const
 {
   eigen_assert(m_isInitialized && "LLT is not initialized.");
   eigen_assert(m_matrix.rows()==bAndX.rows());
@@ -524,8 +524,8 @@
 /** \returns the matrix represented by the decomposition,
  * i.e., it returns the product: L L^*.
  * This function is provided for debug purpose. */
-template<typename MatrixType, int _UpLo>
-MatrixType LLT<MatrixType,_UpLo>::reconstructedMatrix() const
+template<typename MatrixType, int UpLo_>
+MatrixType LLT<MatrixType,UpLo_>::reconstructedMatrix() const
 {
   eigen_assert(m_isInitialized && "LLT is not initialized.");
   return matrixL() * matrixL().adjoint().toDenseMatrix();
diff --git a/Eigen/src/CholmodSupport/CholmodSupport.h b/Eigen/src/CholmodSupport/CholmodSupport.h
index adaf528..817e769 100644
--- a/Eigen/src/CholmodSupport/CholmodSupport.h
+++ b/Eigen/src/CholmodSupport/CholmodSupport.h
@@ -54,8 +54,8 @@
 /** Wraps the Eigen sparse matrix \a mat into a Cholmod sparse matrix object.
   * Note that the data are shared.
   */
-template<typename _Scalar, int _Options, typename _StorageIndex>
-cholmod_sparse viewAsCholmod(Ref<SparseMatrix<_Scalar,_Options,_StorageIndex> > mat)
+template<typename Scalar_, int Options_, typename StorageIndex_>
+cholmod_sparse viewAsCholmod(Ref<SparseMatrix<Scalar_,Options_,StorageIndex_> > mat)
 {
   cholmod_sparse res;
   res.nzmax   = mat.nonZeros();
@@ -80,11 +80,11 @@
   res.dtype   = 0;
   res.stype   = -1;
 
-  if (internal::is_same<_StorageIndex,int>::value)
+  if (internal::is_same<StorageIndex_,int>::value)
   {
     res.itype = CHOLMOD_INT;
   }
-  else if (internal::is_same<_StorageIndex,SuiteSparse_long>::value)
+  else if (internal::is_same<StorageIndex_,SuiteSparse_long>::value)
   {
     res.itype = CHOLMOD_LONG;
   }
@@ -94,39 +94,39 @@
   }
 
   // setup res.xtype
-  internal::cholmod_configure_matrix<_Scalar>::run(res);
+  internal::cholmod_configure_matrix<Scalar_>::run(res);
 
   res.stype = 0;
 
   return res;
 }
 
-template<typename _Scalar, int _Options, typename _Index>
-const cholmod_sparse viewAsCholmod(const SparseMatrix<_Scalar,_Options,_Index>& mat)
+template<typename Scalar_, int Options_, typename Index_>
+const cholmod_sparse viewAsCholmod(const SparseMatrix<Scalar_,Options_,Index_>& mat)
 {
-  cholmod_sparse res = viewAsCholmod(Ref<SparseMatrix<_Scalar,_Options,_Index> >(mat.const_cast_derived()));
+  cholmod_sparse res = viewAsCholmod(Ref<SparseMatrix<Scalar_,Options_,Index_> >(mat.const_cast_derived()));
   return res;
 }
 
-template<typename _Scalar, int _Options, typename _Index>
-const cholmod_sparse viewAsCholmod(const SparseVector<_Scalar,_Options,_Index>& mat)
+template<typename Scalar_, int Options_, typename Index_>
+const cholmod_sparse viewAsCholmod(const SparseVector<Scalar_,Options_,Index_>& mat)
 {
-  cholmod_sparse res = viewAsCholmod(Ref<SparseMatrix<_Scalar,_Options,_Index> >(mat.const_cast_derived()));
+  cholmod_sparse res = viewAsCholmod(Ref<SparseMatrix<Scalar_,Options_,Index_> >(mat.const_cast_derived()));
   return res;
 }
 
 /** Returns a view of the Eigen sparse matrix \a mat as Cholmod sparse matrix.
   * The data are not copied but shared. */
-template<typename _Scalar, int _Options, typename _Index, unsigned int UpLo>
-cholmod_sparse viewAsCholmod(const SparseSelfAdjointView<const SparseMatrix<_Scalar,_Options,_Index>, UpLo>& mat)
+template<typename Scalar_, int Options_, typename Index_, unsigned int UpLo>
+cholmod_sparse viewAsCholmod(const SparseSelfAdjointView<const SparseMatrix<Scalar_,Options_,Index_>, UpLo>& mat)
 {
-  cholmod_sparse res = viewAsCholmod(Ref<SparseMatrix<_Scalar,_Options,_Index> >(mat.matrix().const_cast_derived()));
+  cholmod_sparse res = viewAsCholmod(Ref<SparseMatrix<Scalar_,Options_,Index_> >(mat.matrix().const_cast_derived()));
 
   if(UpLo==Upper) res.stype =  1;
   if(UpLo==Lower) res.stype = -1;
   // swap stype for rowmajor matrices (only works for real matrices)
-  EIGEN_STATIC_ASSERT((_Options & RowMajorBit) == 0 || NumTraits<_Scalar>::IsComplex == 0, THIS_METHOD_IS_ONLY_FOR_COLUMN_MAJOR_MATRICES);
-  if(_Options & RowMajorBit) res.stype *=-1;
+  EIGEN_STATIC_ASSERT((Options_ & RowMajorBit) == 0 || NumTraits<Scalar_>::IsComplex == 0, THIS_METHOD_IS_ONLY_FOR_COLUMN_MAJOR_MATRICES);
+  if(Options_ & RowMajorBit) res.stype *=-1;
 
   return res;
 }
@@ -167,11 +167,11 @@
 // template specializations for int and long that call the correct cholmod method
 
 #define EIGEN_CHOLMOD_SPECIALIZE0(ret, name) \
-    template<typename _StorageIndex> inline ret cm_ ## name       (cholmod_common &Common) { return cholmod_ ## name   (&Common); } \
+    template<typename StorageIndex_> inline ret cm_ ## name       (cholmod_common &Common) { return cholmod_ ## name   (&Common); } \
     template<>                       inline ret cm_ ## name<SuiteSparse_long> (cholmod_common &Common) { return cholmod_l_ ## name (&Common); }
 
 #define EIGEN_CHOLMOD_SPECIALIZE1(ret, name, t1, a1) \
-    template<typename _StorageIndex> inline ret cm_ ## name       (t1& a1, cholmod_common &Common) { return cholmod_ ## name   (&a1, &Common); } \
+    template<typename StorageIndex_> inline ret cm_ ## name       (t1& a1, cholmod_common &Common) { return cholmod_ ## name   (&a1, &Common); } \
     template<>                       inline ret cm_ ## name<SuiteSparse_long> (t1& a1, cholmod_common &Common) { return cholmod_l_ ## name (&a1, &Common); }
 
 EIGEN_CHOLMOD_SPECIALIZE0(int, start)
@@ -183,14 +183,14 @@
 
 EIGEN_CHOLMOD_SPECIALIZE1(cholmod_factor*, analyze, cholmod_sparse, A)
 
-template<typename _StorageIndex> inline cholmod_dense*  cm_solve         (int sys, cholmod_factor& L, cholmod_dense&  B, cholmod_common &Common) { return cholmod_solve     (sys, &L, &B, &Common); }
+template<typename StorageIndex_> inline cholmod_dense*  cm_solve         (int sys, cholmod_factor& L, cholmod_dense&  B, cholmod_common &Common) { return cholmod_solve     (sys, &L, &B, &Common); }
 template<>                       inline cholmod_dense*  cm_solve<SuiteSparse_long>   (int sys, cholmod_factor& L, cholmod_dense&  B, cholmod_common &Common) { return cholmod_l_solve   (sys, &L, &B, &Common); }
 
-template<typename _StorageIndex> inline cholmod_sparse* cm_spsolve       (int sys, cholmod_factor& L, cholmod_sparse& B, cholmod_common &Common) { return cholmod_spsolve   (sys, &L, &B, &Common); }
+template<typename StorageIndex_> inline cholmod_sparse* cm_spsolve       (int sys, cholmod_factor& L, cholmod_sparse& B, cholmod_common &Common) { return cholmod_spsolve   (sys, &L, &B, &Common); }
 template<>                       inline cholmod_sparse* cm_spsolve<SuiteSparse_long> (int sys, cholmod_factor& L, cholmod_sparse& B, cholmod_common &Common) { return cholmod_l_spsolve (sys, &L, &B, &Common); }
 
-template<typename _StorageIndex>
-inline int  cm_factorize_p       (cholmod_sparse*  A, double beta[2], _StorageIndex* fset, std::size_t fsize, cholmod_factor* L, cholmod_common &Common) { return cholmod_factorize_p   (A, beta, fset, fsize, L, &Common); }
+template<typename StorageIndex_>
+inline int  cm_factorize_p       (cholmod_sparse*  A, double beta[2], StorageIndex_* fset, std::size_t fsize, cholmod_factor* L, cholmod_common &Common) { return cholmod_factorize_p   (A, beta, fset, fsize, L, &Common); }
 template<>
 inline int  cm_factorize_p<SuiteSparse_long> (cholmod_sparse*  A, double beta[2], SuiteSparse_long* fset,          std::size_t fsize, cholmod_factor* L, cholmod_common &Common) { return cholmod_l_factorize_p (A, beta, fset, fsize, L, &Common); }
 
@@ -210,7 +210,7 @@
   * \brief The base class for the direct Cholesky factorization of Cholmod
   * \sa class CholmodSupernodalLLT, class CholmodSimplicialLDLT, class CholmodSimplicialLLT
   */
-template<typename _MatrixType, int _UpLo, typename Derived>
+template<typename MatrixType_, int UpLo_, typename Derived>
 class CholmodBase : public SparseSolverBase<Derived>
 {
   protected:
@@ -218,8 +218,8 @@
     using Base::derived;
     using Base::m_isInitialized;
   public:
-    typedef _MatrixType MatrixType;
-    enum { UpLo = _UpLo };
+    typedef MatrixType_ MatrixType;
+    enum { UpLo = UpLo_ };
     typedef typename MatrixType::Scalar Scalar;
     typedef typename MatrixType::RealScalar RealScalar;
     typedef MatrixType CholMatrixType;
@@ -461,8 +461,8 @@
   * The sparse matrix A must be selfadjoint and positive definite. The vectors or matrices
   * X and B can be either dense or sparse.
   *
-  * \tparam _MatrixType the type of the sparse matrix A, it must be a SparseMatrix<>
-  * \tparam _UpLo the triangular part that will be used for the computations. It can be Lower
+  * \tparam MatrixType_ the type of the sparse matrix A, it must be a SparseMatrix<>
+  * \tparam UpLo_ the triangular part that will be used for the computations. It can be Lower
   *               or Upper. Default is Lower.
   *
   * \implsparsesolverconcept
@@ -473,15 +473,15 @@
   *
   * \sa \ref TutorialSparseSolverConcept, class CholmodSupernodalLLT, class SimplicialLLT
   */
-template<typename _MatrixType, int _UpLo = Lower>
-class CholmodSimplicialLLT : public CholmodBase<_MatrixType, _UpLo, CholmodSimplicialLLT<_MatrixType, _UpLo> >
+template<typename MatrixType_, int UpLo_ = Lower>
+class CholmodSimplicialLLT : public CholmodBase<MatrixType_, UpLo_, CholmodSimplicialLLT<MatrixType_, UpLo_> >
 {
-    typedef CholmodBase<_MatrixType, _UpLo, CholmodSimplicialLLT> Base;
+    typedef CholmodBase<MatrixType_, UpLo_, CholmodSimplicialLLT> Base;
     using Base::m_cholmod;
 
   public:
 
-    typedef _MatrixType MatrixType;
+    typedef MatrixType_ MatrixType;
 
     CholmodSimplicialLLT() : Base() { init(); }
 
@@ -512,8 +512,8 @@
   * The sparse matrix A must be selfadjoint and positive definite. The vectors or matrices
   * X and B can be either dense or sparse.
   *
-  * \tparam _MatrixType the type of the sparse matrix A, it must be a SparseMatrix<>
-  * \tparam _UpLo the triangular part that will be used for the computations. It can be Lower
+  * \tparam MatrixType_ the type of the sparse matrix A, it must be a SparseMatrix<>
+  * \tparam UpLo_ the triangular part that will be used for the computations. It can be Lower
   *               or Upper. Default is Lower.
   *
   * \implsparsesolverconcept
@@ -524,15 +524,15 @@
   *
   * \sa \ref TutorialSparseSolverConcept, class CholmodSupernodalLLT, class SimplicialLDLT
   */
-template<typename _MatrixType, int _UpLo = Lower>
-class CholmodSimplicialLDLT : public CholmodBase<_MatrixType, _UpLo, CholmodSimplicialLDLT<_MatrixType, _UpLo> >
+template<typename MatrixType_, int UpLo_ = Lower>
+class CholmodSimplicialLDLT : public CholmodBase<MatrixType_, UpLo_, CholmodSimplicialLDLT<MatrixType_, UpLo_> >
 {
-    typedef CholmodBase<_MatrixType, _UpLo, CholmodSimplicialLDLT> Base;
+    typedef CholmodBase<MatrixType_, UpLo_, CholmodSimplicialLDLT> Base;
     using Base::m_cholmod;
 
   public:
 
-    typedef _MatrixType MatrixType;
+    typedef MatrixType_ MatrixType;
 
     CholmodSimplicialLDLT() : Base() { init(); }
 
@@ -561,8 +561,8 @@
   * The sparse matrix A must be selfadjoint and positive definite. The vectors or matrices
   * X and B can be either dense or sparse.
   *
-  * \tparam _MatrixType the type of the sparse matrix A, it must be a SparseMatrix<>
-  * \tparam _UpLo the triangular part that will be used for the computations. It can be Lower
+  * \tparam MatrixType_ the type of the sparse matrix A, it must be a SparseMatrix<>
+  * \tparam UpLo_ the triangular part that will be used for the computations. It can be Lower
   *               or Upper. Default is Lower.
   *
   * \implsparsesolverconcept
@@ -573,15 +573,15 @@
   *
   * \sa \ref TutorialSparseSolverConcept
   */
-template<typename _MatrixType, int _UpLo = Lower>
-class CholmodSupernodalLLT : public CholmodBase<_MatrixType, _UpLo, CholmodSupernodalLLT<_MatrixType, _UpLo> >
+template<typename MatrixType_, int UpLo_ = Lower>
+class CholmodSupernodalLLT : public CholmodBase<MatrixType_, UpLo_, CholmodSupernodalLLT<MatrixType_, UpLo_> >
 {
-    typedef CholmodBase<_MatrixType, _UpLo, CholmodSupernodalLLT> Base;
+    typedef CholmodBase<MatrixType_, UpLo_, CholmodSupernodalLLT> Base;
     using Base::m_cholmod;
 
   public:
 
-    typedef _MatrixType MatrixType;
+    typedef MatrixType_ MatrixType;
 
     CholmodSupernodalLLT() : Base() { init(); }
 
@@ -612,8 +612,8 @@
   * On the other hand, it does not provide access to the result of the factorization.
   * The default is to let Cholmod automatically choose between a simplicial and supernodal factorization.
   *
-  * \tparam _MatrixType the type of the sparse matrix A, it must be a SparseMatrix<>
-  * \tparam _UpLo the triangular part that will be used for the computations. It can be Lower
+  * \tparam MatrixType_ the type of the sparse matrix A, it must be a SparseMatrix<>
+  * \tparam UpLo_ the triangular part that will be used for the computations. It can be Lower
   *               or Upper. Default is Lower.
   *
   * \implsparsesolverconcept
@@ -624,15 +624,15 @@
   *
   * \sa \ref TutorialSparseSolverConcept
   */
-template<typename _MatrixType, int _UpLo = Lower>
-class CholmodDecomposition : public CholmodBase<_MatrixType, _UpLo, CholmodDecomposition<_MatrixType, _UpLo> >
+template<typename MatrixType_, int UpLo_ = Lower>
+class CholmodDecomposition : public CholmodBase<MatrixType_, UpLo_, CholmodDecomposition<MatrixType_, UpLo_> >
 {
-    typedef CholmodBase<_MatrixType, _UpLo, CholmodDecomposition> Base;
+    typedef CholmodBase<MatrixType_, UpLo_, CholmodDecomposition> Base;
     using Base::m_cholmod;
 
   public:
 
-    typedef _MatrixType MatrixType;
+    typedef MatrixType_ MatrixType;
 
     CholmodDecomposition() : Base() { init(); }
 
diff --git a/Eigen/src/Core/Array.h b/Eigen/src/Core/Array.h
index 20c789b..85676ae 100644
--- a/Eigen/src/Core/Array.h
+++ b/Eigen/src/Core/Array.h
@@ -13,11 +13,11 @@
 namespace Eigen {
 
 namespace internal {
-template<typename _Scalar, int _Rows, int _Cols, int _Options, int _MaxRows, int _MaxCols>
-struct traits<Array<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols> > : traits<Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols> >
+template<typename Scalar_, int Rows_, int Cols_, int Options_, int MaxRows_, int MaxCols_>
+struct traits<Array<Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_> > : traits<Matrix<Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_> >
 {
   typedef ArrayXpr XprKind;
-  typedef ArrayBase<Array<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols> > XprBase;
+  typedef ArrayBase<Array<Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_> > XprBase;
 };
 }
 
@@ -41,16 +41,16 @@
   *
   * \sa \blank \ref TutorialArrayClass, \ref TopicClassHierarchy
   */
-template<typename _Scalar, int _Rows, int _Cols, int _Options, int _MaxRows, int _MaxCols>
+template<typename Scalar_, int Rows_, int Cols_, int Options_, int MaxRows_, int MaxCols_>
 class Array
-  : public PlainObjectBase<Array<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols> >
+  : public PlainObjectBase<Array<Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_> >
 {
   public:
 
     typedef PlainObjectBase<Array> Base;
     EIGEN_DENSE_PUBLIC_INTERFACE(Array)
 
-    enum { Options = _Options };
+    enum { Options = Options_ };
     typedef typename Base::PlainObject PlainObject;
 
   protected:
diff --git a/Eigen/src/Core/BandMatrix.h b/Eigen/src/Core/BandMatrix.h
index 878c024..590573b 100644
--- a/Eigen/src/Core/BandMatrix.h
+++ b/Eigen/src/Core/BandMatrix.h
@@ -161,12 +161,12 @@
   *
   * \brief Represents a rectangular matrix with a banded storage
   *
-  * \tparam _Scalar Numeric type, i.e. float, double, int
-  * \tparam _Rows Number of rows, or \b Dynamic
-  * \tparam _Cols Number of columns, or \b Dynamic
-  * \tparam _Supers Number of super diagonal
-  * \tparam _Subs Number of sub diagonal
-  * \tparam _Options A combination of either \b #RowMajor or \b #ColMajor, and of \b #SelfAdjoint
+  * \tparam Scalar_ Numeric type, i.e. float, double, int
+  * \tparam Rows_ Number of rows, or \b Dynamic
+  * \tparam Cols_ Number of columns, or \b Dynamic
+  * \tparam Supers_ Number of super diagonal
+  * \tparam Subs_ Number of sub diagonal
+  * \tparam Options_ A combination of either \b #RowMajor or \b #ColMajor, and of \b #SelfAdjoint
   *                  The former controls \ref TopicStorageOrders "storage order", and defaults to
   *                  column-major. The latter controls whether the matrix represents a selfadjoint
   *                  matrix in which case either Supers of Subs have to be null.
@@ -174,29 +174,29 @@
   * \sa class TridiagonalMatrix
   */
 
-template<typename _Scalar, int _Rows, int _Cols, int _Supers, int _Subs, int _Options>
-struct traits<BandMatrix<_Scalar,_Rows,_Cols,_Supers,_Subs,_Options> >
+template<typename Scalar_, int Rows_, int Cols_, int Supers_, int Subs_, int Options_>
+struct traits<BandMatrix<Scalar_,Rows_,Cols_,Supers_,Subs_,Options_> >
 {
-  typedef _Scalar Scalar;
+  typedef Scalar_ Scalar;
   typedef Dense StorageKind;
   typedef Eigen::Index StorageIndex;
   enum {
     CoeffReadCost = NumTraits<Scalar>::ReadCost,
-    RowsAtCompileTime = _Rows,
-    ColsAtCompileTime = _Cols,
-    MaxRowsAtCompileTime = _Rows,
-    MaxColsAtCompileTime = _Cols,
+    RowsAtCompileTime = Rows_,
+    ColsAtCompileTime = Cols_,
+    MaxRowsAtCompileTime = Rows_,
+    MaxColsAtCompileTime = Cols_,
     Flags = LvalueBit,
-    Supers = _Supers,
-    Subs = _Subs,
-    Options = _Options,
+    Supers = Supers_,
+    Subs = Subs_,
+    Options = Options_,
     DataRowsAtCompileTime = ((Supers!=Dynamic) && (Subs!=Dynamic)) ? 1 + Supers + Subs : Dynamic
   };
   typedef Matrix<Scalar, DataRowsAtCompileTime, ColsAtCompileTime, int(Options) & int(RowMajor) ? RowMajor : ColMajor> CoefficientsType;
 };
 
-template<typename _Scalar, int Rows, int Cols, int Supers, int Subs, int Options>
-class BandMatrix : public BandMatrixBase<BandMatrix<_Scalar,Rows,Cols,Supers,Subs,Options> >
+template<typename Scalar_, int Rows, int Cols, int Supers, int Subs, int Options>
+class BandMatrix : public BandMatrixBase<BandMatrix<Scalar_,Rows,Cols,Supers,Subs,Options> >
 {
   public:
 
@@ -233,32 +233,32 @@
     internal::variable_if_dynamic<Index, Subs>   m_subs;
 };
 
-template<typename _CoefficientsType,int _Rows, int _Cols, int _Supers, int _Subs,int _Options>
+template<typename _CoefficientsType,int Rows_, int Cols_, int Supers_, int Subs_,int Options_>
 class BandMatrixWrapper;
 
-template<typename _CoefficientsType,int _Rows, int _Cols, int _Supers, int _Subs,int _Options>
-struct traits<BandMatrixWrapper<_CoefficientsType,_Rows,_Cols,_Supers,_Subs,_Options> >
+template<typename _CoefficientsType,int Rows_, int Cols_, int Supers_, int Subs_,int Options_>
+struct traits<BandMatrixWrapper<_CoefficientsType,Rows_,Cols_,Supers_,Subs_,Options_> >
 {
   typedef typename _CoefficientsType::Scalar Scalar;
   typedef typename _CoefficientsType::StorageKind StorageKind;
   typedef typename _CoefficientsType::StorageIndex StorageIndex;
   enum {
     CoeffReadCost = internal::traits<_CoefficientsType>::CoeffReadCost,
-    RowsAtCompileTime = _Rows,
-    ColsAtCompileTime = _Cols,
-    MaxRowsAtCompileTime = _Rows,
-    MaxColsAtCompileTime = _Cols,
+    RowsAtCompileTime = Rows_,
+    ColsAtCompileTime = Cols_,
+    MaxRowsAtCompileTime = Rows_,
+    MaxColsAtCompileTime = Cols_,
     Flags = LvalueBit,
-    Supers = _Supers,
-    Subs = _Subs,
-    Options = _Options,
+    Supers = Supers_,
+    Subs = Subs_,
+    Options = Options_,
     DataRowsAtCompileTime = ((Supers!=Dynamic) && (Subs!=Dynamic)) ? 1 + Supers + Subs : Dynamic
   };
   typedef _CoefficientsType CoefficientsType;
 };
 
-template<typename _CoefficientsType,int _Rows, int _Cols, int _Supers, int _Subs,int _Options>
-class BandMatrixWrapper : public BandMatrixBase<BandMatrixWrapper<_CoefficientsType,_Rows,_Cols,_Supers,_Subs,_Options> >
+template<typename _CoefficientsType,int Rows_, int Cols_, int Supers_, int Subs_,int Options_>
+class BandMatrixWrapper : public BandMatrixBase<BandMatrixWrapper<_CoefficientsType,Rows_,Cols_,Supers_,Subs_,Options_> >
 {
   public:
 
@@ -266,7 +266,7 @@
     typedef typename internal::traits<BandMatrixWrapper>::CoefficientsType CoefficientsType;
     typedef typename internal::traits<BandMatrixWrapper>::StorageIndex StorageIndex;
 
-    explicit inline BandMatrixWrapper(const CoefficientsType& coeffs, Index rows=_Rows, Index cols=_Cols, Index supers=_Supers, Index subs=_Subs)
+    explicit inline BandMatrixWrapper(const CoefficientsType& coeffs, Index rows=Rows_, Index cols=Cols_, Index supers=Supers_, Index subs=Subs_)
       : m_coeffs(coeffs),
         m_rows(rows), m_supers(supers), m_subs(subs)
     {
@@ -291,9 +291,9 @@
   protected:
 
     const CoefficientsType& m_coeffs;
-    internal::variable_if_dynamic<Index, _Rows>   m_rows;
-    internal::variable_if_dynamic<Index, _Supers> m_supers;
-    internal::variable_if_dynamic<Index, _Subs>   m_subs;
+    internal::variable_if_dynamic<Index, Rows_>   m_rows;
+    internal::variable_if_dynamic<Index, Supers_> m_supers;
+    internal::variable_if_dynamic<Index, Subs_>   m_subs;
 };
 
 /**
@@ -330,16 +330,16 @@
 
 struct BandShape {};
 
-template<typename _Scalar, int _Rows, int _Cols, int _Supers, int _Subs, int _Options>
-struct evaluator_traits<BandMatrix<_Scalar,_Rows,_Cols,_Supers,_Subs,_Options> >
-  : public evaluator_traits_base<BandMatrix<_Scalar,_Rows,_Cols,_Supers,_Subs,_Options> >
+template<typename Scalar_, int Rows_, int Cols_, int Supers_, int Subs_, int Options_>
+struct evaluator_traits<BandMatrix<Scalar_,Rows_,Cols_,Supers_,Subs_,Options_> >
+  : public evaluator_traits_base<BandMatrix<Scalar_,Rows_,Cols_,Supers_,Subs_,Options_> >
 {
   typedef BandShape Shape;
 };
 
-template<typename _CoefficientsType,int _Rows, int _Cols, int _Supers, int _Subs,int _Options>
-struct evaluator_traits<BandMatrixWrapper<_CoefficientsType,_Rows,_Cols,_Supers,_Subs,_Options> >
-  : public evaluator_traits_base<BandMatrixWrapper<_CoefficientsType,_Rows,_Cols,_Supers,_Subs,_Options> >
+template<typename _CoefficientsType,int Rows_, int Cols_, int Supers_, int Subs_,int Options_>
+struct evaluator_traits<BandMatrixWrapper<_CoefficientsType,Rows_,Cols_,Supers_,Subs_,Options_> >
+  : public evaluator_traits_base<BandMatrixWrapper<_CoefficientsType,Rows_,Cols_,Supers_,Subs_,Options_> >
 {
   typedef BandShape Shape;
 };
diff --git a/Eigen/src/Core/Block.h b/Eigen/src/Core/Block.h
index 3206d66..d0b95d5 100644
--- a/Eigen/src/Core/Block.h
+++ b/Eigen/src/Core/Block.h
@@ -260,19 +260,19 @@
     }
 
     template<int LoadMode>
-    inline PacketScalar packet(Index rowId, Index colId) const
+    EIGEN_DEVICE_FUNC inline PacketScalar packet(Index rowId, Index colId) const
     {
       return m_xpr.template packet<Unaligned>(rowId + m_startRow.value(), colId + m_startCol.value());
     }
 
     template<int LoadMode>
-    inline void writePacket(Index rowId, Index colId, const PacketScalar& val)
+    EIGEN_DEVICE_FUNC inline void writePacket(Index rowId, Index colId, const PacketScalar& val)
     {
       m_xpr.template writePacket<Unaligned>(rowId + m_startRow.value(), colId + m_startCol.value(), val);
     }
 
     template<int LoadMode>
-    inline PacketScalar packet(Index index) const
+    EIGEN_DEVICE_FUNC inline PacketScalar packet(Index index) const
     {
       return m_xpr.template packet<Unaligned>
               (m_startRow.value() + (RowsAtCompileTime == 1 ? 0 : index),
@@ -280,7 +280,7 @@
     }
 
     template<int LoadMode>
-    inline void writePacket(Index index, const PacketScalar& val)
+    EIGEN_DEVICE_FUNC inline void writePacket(Index index, const PacketScalar& val)
     {
       m_xpr.template writePacket<Unaligned>
          (m_startRow.value() + (RowsAtCompileTime == 1 ? 0 : index),
diff --git a/Eigen/src/Core/DenseStorage.h b/Eigen/src/Core/DenseStorage.h
index 08ef6c5..3805084 100644
--- a/Eigen/src/Core/DenseStorage.h
+++ b/Eigen/src/Core/DenseStorage.h
@@ -201,12 +201,12 @@
   *
   * \sa Matrix
   */
-template<typename T, int Size, int _Rows, int _Cols, int _Options> class DenseStorage;
+template<typename T, int Size, int Rows_, int Cols_, int Options_> class DenseStorage;
 
 // purely fixed-size matrix
-template<typename T, int Size, int _Rows, int _Cols, int _Options> class DenseStorage
+template<typename T, int Size, int Rows_, int Cols_, int Options_> class DenseStorage
 {
-    internal::plain_array<T,Size,_Options> m_data;
+    internal::plain_array<T,Size,Options_> m_data;
   public:
     EIGEN_DEVICE_FUNC DenseStorage() {
       EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN(Index size = Size)
@@ -251,7 +251,7 @@
 #endif
     EIGEN_DEVICE_FUNC DenseStorage(Index size, Index rows, Index cols) {
       EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN({})
-      eigen_internal_assert(size==rows*cols && rows==_Rows && cols==_Cols);
+      eigen_internal_assert(size==rows*cols && rows==Rows_ && cols==Cols_);
       EIGEN_UNUSED_VARIABLE(size);
       EIGEN_UNUSED_VARIABLE(rows);
       EIGEN_UNUSED_VARIABLE(cols);
@@ -259,8 +259,8 @@
     EIGEN_DEVICE_FUNC void swap(DenseStorage& other) {
       numext::swap(m_data, other.m_data);
     }
-    EIGEN_DEVICE_FUNC static EIGEN_CONSTEXPR Index rows(void) EIGEN_NOEXCEPT {return _Rows;}
-    EIGEN_DEVICE_FUNC static EIGEN_CONSTEXPR Index cols(void) EIGEN_NOEXCEPT {return _Cols;}
+    EIGEN_DEVICE_FUNC static EIGEN_CONSTEXPR Index rows(void) EIGEN_NOEXCEPT {return Rows_;}
+    EIGEN_DEVICE_FUNC static EIGEN_CONSTEXPR Index cols(void) EIGEN_NOEXCEPT {return Cols_;}
     EIGEN_DEVICE_FUNC void conservativeResize(Index,Index,Index) {}
     EIGEN_DEVICE_FUNC void resize(Index,Index,Index) {}
     EIGEN_DEVICE_FUNC const T *data() const { return m_data.array; }
@@ -268,7 +268,7 @@
 };
 
 // null matrix
-template<typename T, int _Rows, int _Cols, int _Options> class DenseStorage<T, 0, _Rows, _Cols, _Options>
+template<typename T, int Rows_, int Cols_, int Options_> class DenseStorage<T, 0, Rows_, Cols_, Options_>
 {
   public:
     EIGEN_DEVICE_FUNC DenseStorage() {}
@@ -277,8 +277,8 @@
     EIGEN_DEVICE_FUNC DenseStorage& operator=(const DenseStorage&) { return *this; }
     EIGEN_DEVICE_FUNC DenseStorage(Index,Index,Index) {}
     EIGEN_DEVICE_FUNC void swap(DenseStorage& ) {}
-    EIGEN_DEVICE_FUNC static EIGEN_CONSTEXPR Index rows(void) EIGEN_NOEXCEPT {return _Rows;}
-    EIGEN_DEVICE_FUNC static EIGEN_CONSTEXPR Index cols(void) EIGEN_NOEXCEPT {return _Cols;}
+    EIGEN_DEVICE_FUNC static EIGEN_CONSTEXPR Index rows(void) EIGEN_NOEXCEPT {return Rows_;}
+    EIGEN_DEVICE_FUNC static EIGEN_CONSTEXPR Index cols(void) EIGEN_NOEXCEPT {return Cols_;}
     EIGEN_DEVICE_FUNC void conservativeResize(Index,Index,Index) {}
     EIGEN_DEVICE_FUNC void resize(Index,Index,Index) {}
     EIGEN_DEVICE_FUNC const T *data() const { return 0; }
@@ -286,19 +286,19 @@
 };
 
 // more specializations for null matrices; these are necessary to resolve ambiguities
-template<typename T, int _Options> class DenseStorage<T, 0, Dynamic, Dynamic, _Options>
-: public DenseStorage<T, 0, 0, 0, _Options> { };
+template<typename T, int Options_> class DenseStorage<T, 0, Dynamic, Dynamic, Options_>
+: public DenseStorage<T, 0, 0, 0, Options_> { };
 
-template<typename T, int _Rows, int _Options> class DenseStorage<T, 0, _Rows, Dynamic, _Options>
-: public DenseStorage<T, 0, 0, 0, _Options> { };
+template<typename T, int Rows_, int Options_> class DenseStorage<T, 0, Rows_, Dynamic, Options_>
+: public DenseStorage<T, 0, 0, 0, Options_> { };
 
-template<typename T, int _Cols, int _Options> class DenseStorage<T, 0, Dynamic, _Cols, _Options>
-: public DenseStorage<T, 0, 0, 0, _Options> { };
+template<typename T, int Cols_, int Options_> class DenseStorage<T, 0, Dynamic, Cols_, Options_>
+: public DenseStorage<T, 0, 0, 0, Options_> { };
 
 // dynamic-size matrix with fixed-size storage
-template<typename T, int Size, int _Options> class DenseStorage<T, Size, Dynamic, Dynamic, _Options>
+template<typename T, int Size, int Options_> class DenseStorage<T, Size, Dynamic, Dynamic, Options_>
 {
-    internal::plain_array<T,Size,_Options> m_data;
+    internal::plain_array<T,Size,Options_> m_data;
     Index m_rows;
     Index m_cols;
   public:
@@ -336,9 +336,9 @@
 };
 
 // dynamic-size matrix with fixed-size storage and fixed width
-template<typename T, int Size, int _Cols, int _Options> class DenseStorage<T, Size, Dynamic, _Cols, _Options>
+template<typename T, int Size, int Cols_, int Options_> class DenseStorage<T, Size, Dynamic, Cols_, Options_>
 {
-    internal::plain_array<T,Size,_Options> m_data;
+    internal::plain_array<T,Size,Options_> m_data;
     Index m_rows;
   public:
     EIGEN_DEVICE_FUNC DenseStorage() : m_rows(0) {}
@@ -347,7 +347,7 @@
     EIGEN_DEVICE_FUNC DenseStorage(const DenseStorage& other)
       : m_data(internal::constructor_without_unaligned_array_assert()), m_rows(other.m_rows)
     {
-      internal::plain_array_helper::copy(other.m_data, m_rows * _Cols, m_data);
+      internal::plain_array_helper::copy(other.m_data, m_rows * Cols_, m_data);
     }
     
     EIGEN_DEVICE_FUNC DenseStorage& operator=(const DenseStorage& other)
@@ -355,18 +355,18 @@
       if (this != &other)
       {
         m_rows = other.m_rows;
-        internal::plain_array_helper::copy(other.m_data, m_rows * _Cols, m_data);
+        internal::plain_array_helper::copy(other.m_data, m_rows * Cols_, m_data);
       }
       return *this;
     }
     EIGEN_DEVICE_FUNC DenseStorage(Index, Index rows, Index) : m_rows(rows) {}
     EIGEN_DEVICE_FUNC void swap(DenseStorage& other)
     { 
-      internal::plain_array_helper::swap(m_data, m_rows * _Cols, other.m_data, other.m_rows * _Cols);
+      internal::plain_array_helper::swap(m_data, m_rows * Cols_, other.m_data, other.m_rows * Cols_);
       numext::swap(m_rows, other.m_rows);
     }
     EIGEN_DEVICE_FUNC Index rows(void) const EIGEN_NOEXCEPT {return m_rows;}
-    EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index cols(void) const EIGEN_NOEXCEPT {return _Cols;}
+    EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index cols(void) const EIGEN_NOEXCEPT {return Cols_;}
     EIGEN_DEVICE_FUNC void conservativeResize(Index, Index rows, Index) { m_rows = rows; }
     EIGEN_DEVICE_FUNC void resize(Index, Index rows, Index) { m_rows = rows; }
     EIGEN_DEVICE_FUNC const T *data() const { return m_data.array; }
@@ -374,9 +374,9 @@
 };
 
 // dynamic-size matrix with fixed-size storage and fixed height
-template<typename T, int Size, int _Rows, int _Options> class DenseStorage<T, Size, _Rows, Dynamic, _Options>
+template<typename T, int Size, int Rows_, int Options_> class DenseStorage<T, Size, Rows_, Dynamic, Options_>
 {
-    internal::plain_array<T,Size,_Options> m_data;
+    internal::plain_array<T,Size,Options_> m_data;
     Index m_cols;
   public:
     EIGEN_DEVICE_FUNC DenseStorage() : m_cols(0) {}
@@ -385,23 +385,23 @@
     EIGEN_DEVICE_FUNC DenseStorage(const DenseStorage& other) 
       : m_data(internal::constructor_without_unaligned_array_assert()), m_cols(other.m_cols)
     {
-      internal::plain_array_helper::copy(other.m_data, _Rows * m_cols, m_data);
+      internal::plain_array_helper::copy(other.m_data, Rows_ * m_cols, m_data);
     }
     EIGEN_DEVICE_FUNC DenseStorage& operator=(const DenseStorage& other)
     {
       if (this != &other)
       {
         m_cols = other.m_cols;
-        internal::plain_array_helper::copy(other.m_data, _Rows * m_cols, m_data);
+        internal::plain_array_helper::copy(other.m_data, Rows_ * m_cols, m_data);
       }
       return *this;
     }
     EIGEN_DEVICE_FUNC DenseStorage(Index, Index, Index cols) : m_cols(cols) {}
     EIGEN_DEVICE_FUNC void swap(DenseStorage& other) {
-      internal::plain_array_helper::swap(m_data, _Rows * m_cols, other.m_data, _Rows * other.m_cols);
+      internal::plain_array_helper::swap(m_data, Rows_ * m_cols, other.m_data, Rows_ * other.m_cols);
       numext::swap(m_cols, other.m_cols);
     }
-    EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index rows(void) const EIGEN_NOEXCEPT {return _Rows;}
+    EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index rows(void) const EIGEN_NOEXCEPT {return Rows_;}
     EIGEN_DEVICE_FUNC Index cols(void) const EIGEN_NOEXCEPT {return m_cols;}
     EIGEN_DEVICE_FUNC void conservativeResize(Index, Index, Index cols) { m_cols = cols; }
     EIGEN_DEVICE_FUNC void resize(Index, Index, Index cols) { m_cols = cols; }
@@ -410,7 +410,7 @@
 };
 
 // purely dynamic matrix.
-template<typename T, int _Options> class DenseStorage<T, Dynamic, Dynamic, Dynamic, _Options>
+template<typename T, int Options_> class DenseStorage<T, Dynamic, Dynamic, Dynamic, Options_>
 {
     T *m_data;
     Index m_rows;
@@ -420,13 +420,13 @@
     EIGEN_DEVICE_FUNC explicit DenseStorage(internal::constructor_without_unaligned_array_assert)
        : m_data(0), m_rows(0), m_cols(0) {}
     EIGEN_DEVICE_FUNC DenseStorage(Index size, Index rows, Index cols)
-      : m_data(internal::conditional_aligned_new_auto<T,(_Options&DontAlign)==0>(size)), m_rows(rows), m_cols(cols)
+      : m_data(internal::conditional_aligned_new_auto<T,(Options_&DontAlign)==0>(size)), m_rows(rows), m_cols(cols)
     {
       EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN({})
       eigen_internal_assert(size==rows*cols && rows>=0 && cols >=0);
     }
     EIGEN_DEVICE_FUNC DenseStorage(const DenseStorage& other)
-      : m_data(internal::conditional_aligned_new_auto<T,(_Options&DontAlign)==0>(other.m_rows*other.m_cols))
+      : m_data(internal::conditional_aligned_new_auto<T,(Options_&DontAlign)==0>(other.m_rows*other.m_cols))
       , m_rows(other.m_rows)
       , m_cols(other.m_cols)
     {
@@ -462,7 +462,7 @@
       return *this;
     }
 #endif
-    EIGEN_DEVICE_FUNC ~DenseStorage() { internal::conditional_aligned_delete_auto<T,(_Options&DontAlign)==0>(m_data, m_rows*m_cols); }
+    EIGEN_DEVICE_FUNC ~DenseStorage() { internal::conditional_aligned_delete_auto<T,(Options_&DontAlign)==0>(m_data, m_rows*m_cols); }
     EIGEN_DEVICE_FUNC void swap(DenseStorage& other)
     {
       numext::swap(m_data,other.m_data);
@@ -473,7 +473,7 @@
     EIGEN_DEVICE_FUNC Index cols(void) const EIGEN_NOEXCEPT {return m_cols;}
     void conservativeResize(Index size, Index rows, Index cols)
     {
-      m_data = internal::conditional_aligned_realloc_new_auto<T,(_Options&DontAlign)==0>(m_data, size, m_rows*m_cols);
+      m_data = internal::conditional_aligned_realloc_new_auto<T,(Options_&DontAlign)==0>(m_data, size, m_rows*m_cols);
       m_rows = rows;
       m_cols = cols;
     }
@@ -481,9 +481,9 @@
     {
       if(size != m_rows*m_cols)
       {
-        internal::conditional_aligned_delete_auto<T,(_Options&DontAlign)==0>(m_data, m_rows*m_cols);
+        internal::conditional_aligned_delete_auto<T,(Options_&DontAlign)==0>(m_data, m_rows*m_cols);
         if (size>0) // >0 and not simply !=0 to let the compiler knows that size cannot be negative
-          m_data = internal::conditional_aligned_new_auto<T,(_Options&DontAlign)==0>(size);
+          m_data = internal::conditional_aligned_new_auto<T,(Options_&DontAlign)==0>(size);
         else
           m_data = 0;
         EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN({})
@@ -496,25 +496,25 @@
 };
 
 // matrix with dynamic width and fixed height (so that matrix has dynamic size).
-template<typename T, int _Rows, int _Options> class DenseStorage<T, Dynamic, _Rows, Dynamic, _Options>
+template<typename T, int Rows_, int Options_> class DenseStorage<T, Dynamic, Rows_, Dynamic, Options_>
 {
     T *m_data;
     Index m_cols;
   public:
     EIGEN_DEVICE_FUNC DenseStorage() : m_data(0), m_cols(0) {}
     explicit DenseStorage(internal::constructor_without_unaligned_array_assert) : m_data(0), m_cols(0) {}
-    EIGEN_DEVICE_FUNC DenseStorage(Index size, Index rows, Index cols) : m_data(internal::conditional_aligned_new_auto<T,(_Options&DontAlign)==0>(size)), m_cols(cols)
+    EIGEN_DEVICE_FUNC DenseStorage(Index size, Index rows, Index cols) : m_data(internal::conditional_aligned_new_auto<T,(Options_&DontAlign)==0>(size)), m_cols(cols)
     {
       EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN({})
-      eigen_internal_assert(size==rows*cols && rows==_Rows && cols >=0);
+      eigen_internal_assert(size==rows*cols && rows==Rows_ && cols >=0);
       EIGEN_UNUSED_VARIABLE(rows);
     }
     EIGEN_DEVICE_FUNC DenseStorage(const DenseStorage& other)
-      : m_data(internal::conditional_aligned_new_auto<T,(_Options&DontAlign)==0>(_Rows*other.m_cols))
+      : m_data(internal::conditional_aligned_new_auto<T,(Options_&DontAlign)==0>(Rows_*other.m_cols))
       , m_cols(other.m_cols)
     {
-      EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN(Index size = m_cols*_Rows)
-      internal::smart_copy(other.m_data, other.m_data+_Rows*m_cols, m_data);
+      EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN(Index size = m_cols*Rows_)
+      internal::smart_copy(other.m_data, other.m_data+Rows_*m_cols, m_data);
     }
     EIGEN_DEVICE_FUNC DenseStorage& operator=(const DenseStorage& other)
     {
@@ -542,25 +542,25 @@
       return *this;
     }
 #endif
-    EIGEN_DEVICE_FUNC ~DenseStorage() { internal::conditional_aligned_delete_auto<T,(_Options&DontAlign)==0>(m_data, _Rows*m_cols); }
+    EIGEN_DEVICE_FUNC ~DenseStorage() { internal::conditional_aligned_delete_auto<T,(Options_&DontAlign)==0>(m_data, Rows_*m_cols); }
     EIGEN_DEVICE_FUNC void swap(DenseStorage& other) {
       numext::swap(m_data,other.m_data);
       numext::swap(m_cols,other.m_cols);
     }
-    EIGEN_DEVICE_FUNC static EIGEN_CONSTEXPR Index rows(void) EIGEN_NOEXCEPT {return _Rows;}
+    EIGEN_DEVICE_FUNC static EIGEN_CONSTEXPR Index rows(void) EIGEN_NOEXCEPT {return Rows_;}
     EIGEN_DEVICE_FUNC Index cols(void) const EIGEN_NOEXCEPT {return m_cols;}
     EIGEN_DEVICE_FUNC void conservativeResize(Index size, Index, Index cols)
     {
-      m_data = internal::conditional_aligned_realloc_new_auto<T,(_Options&DontAlign)==0>(m_data, size, _Rows*m_cols);
+      m_data = internal::conditional_aligned_realloc_new_auto<T,(Options_&DontAlign)==0>(m_data, size, Rows_*m_cols);
       m_cols = cols;
     }
     EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void resize(Index size, Index, Index cols)
     {
-      if(size != _Rows*m_cols)
+      if(size != Rows_*m_cols)
       {
-        internal::conditional_aligned_delete_auto<T,(_Options&DontAlign)==0>(m_data, _Rows*m_cols);
+        internal::conditional_aligned_delete_auto<T,(Options_&DontAlign)==0>(m_data, Rows_*m_cols);
         if (size>0) // >0 and not simply !=0 to let the compiler knows that size cannot be negative
-          m_data = internal::conditional_aligned_new_auto<T,(_Options&DontAlign)==0>(size);
+          m_data = internal::conditional_aligned_new_auto<T,(Options_&DontAlign)==0>(size);
         else
           m_data = 0;
         EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN({})
@@ -572,25 +572,25 @@
 };
 
 // matrix with dynamic height and fixed width (so that matrix has dynamic size).
-template<typename T, int _Cols, int _Options> class DenseStorage<T, Dynamic, Dynamic, _Cols, _Options>
+template<typename T, int Cols_, int Options_> class DenseStorage<T, Dynamic, Dynamic, Cols_, Options_>
 {
     T *m_data;
     Index m_rows;
   public:
     EIGEN_DEVICE_FUNC DenseStorage() : m_data(0), m_rows(0) {}
     explicit DenseStorage(internal::constructor_without_unaligned_array_assert) : m_data(0), m_rows(0) {}
-    EIGEN_DEVICE_FUNC DenseStorage(Index size, Index rows, Index cols) : m_data(internal::conditional_aligned_new_auto<T,(_Options&DontAlign)==0>(size)), m_rows(rows)
+    EIGEN_DEVICE_FUNC DenseStorage(Index size, Index rows, Index cols) : m_data(internal::conditional_aligned_new_auto<T,(Options_&DontAlign)==0>(size)), m_rows(rows)
     {
       EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN({})
-      eigen_internal_assert(size==rows*cols && rows>=0 && cols == _Cols);
+      eigen_internal_assert(size==rows*cols && rows>=0 && cols == Cols_);
       EIGEN_UNUSED_VARIABLE(cols);
     }
     EIGEN_DEVICE_FUNC DenseStorage(const DenseStorage& other)
-      : m_data(internal::conditional_aligned_new_auto<T,(_Options&DontAlign)==0>(other.m_rows*_Cols))
+      : m_data(internal::conditional_aligned_new_auto<T,(Options_&DontAlign)==0>(other.m_rows*Cols_))
       , m_rows(other.m_rows)
     {
-      EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN(Index size = m_rows*_Cols)
-      internal::smart_copy(other.m_data, other.m_data+other.m_rows*_Cols, m_data);
+      EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN(Index size = m_rows*Cols_)
+      internal::smart_copy(other.m_data, other.m_data+other.m_rows*Cols_, m_data);
     }
     EIGEN_DEVICE_FUNC DenseStorage& operator=(const DenseStorage& other)
     {
@@ -618,25 +618,25 @@
       return *this;
     }
 #endif
-    EIGEN_DEVICE_FUNC ~DenseStorage() { internal::conditional_aligned_delete_auto<T,(_Options&DontAlign)==0>(m_data, _Cols*m_rows); }
+    EIGEN_DEVICE_FUNC ~DenseStorage() { internal::conditional_aligned_delete_auto<T,(Options_&DontAlign)==0>(m_data, Cols_*m_rows); }
     EIGEN_DEVICE_FUNC void swap(DenseStorage& other) {
       numext::swap(m_data,other.m_data);
       numext::swap(m_rows,other.m_rows);
     }
     EIGEN_DEVICE_FUNC Index rows(void) const EIGEN_NOEXCEPT {return m_rows;}
-    EIGEN_DEVICE_FUNC static EIGEN_CONSTEXPR Index cols(void) {return _Cols;}
+    EIGEN_DEVICE_FUNC static EIGEN_CONSTEXPR Index cols(void) {return Cols_;}
     void conservativeResize(Index size, Index rows, Index)
     {
-      m_data = internal::conditional_aligned_realloc_new_auto<T,(_Options&DontAlign)==0>(m_data, size, m_rows*_Cols);
+      m_data = internal::conditional_aligned_realloc_new_auto<T,(Options_&DontAlign)==0>(m_data, size, m_rows*Cols_);
       m_rows = rows;
     }
     EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void resize(Index size, Index rows, Index)
     {
-      if(size != m_rows*_Cols)
+      if(size != m_rows*Cols_)
       {
-        internal::conditional_aligned_delete_auto<T,(_Options&DontAlign)==0>(m_data, _Cols*m_rows);
+        internal::conditional_aligned_delete_auto<T,(Options_&DontAlign)==0>(m_data, Cols_*m_rows);
         if (size>0) // >0 and not simply !=0 to let the compiler knows that size cannot be negative
-          m_data = internal::conditional_aligned_new_auto<T,(_Options&DontAlign)==0>(size);
+          m_data = internal::conditional_aligned_new_auto<T,(Options_&DontAlign)==0>(size);
         else
           m_data = 0;
         EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN({})
diff --git a/Eigen/src/Core/Diagonal.h b/Eigen/src/Core/Diagonal.h
index 3112d2c..d15f0af 100644
--- a/Eigen/src/Core/Diagonal.h
+++ b/Eigen/src/Core/Diagonal.h
@@ -60,12 +60,12 @@
 };
 }
 
-template<typename MatrixType, int _DiagIndex> class Diagonal
-   : public internal::dense_xpr_base< Diagonal<MatrixType,_DiagIndex> >::type
+template<typename MatrixType, int DiagIndex_> class Diagonal
+   : public internal::dense_xpr_base< Diagonal<MatrixType,DiagIndex_> >::type
 {
   public:
 
-    enum { DiagIndex = _DiagIndex };
+    enum { DiagIndex = DiagIndex_ };
     typedef typename internal::dense_xpr_base<Diagonal>::type Base;
     EIGEN_DENSE_PUBLIC_INTERFACE(Diagonal)
 
diff --git a/Eigen/src/Core/DiagonalMatrix.h b/Eigen/src/Core/DiagonalMatrix.h
index 542685c..474dcfa 100644
--- a/Eigen/src/Core/DiagonalMatrix.h
+++ b/Eigen/src/Core/DiagonalMatrix.h
@@ -116,7 +116,7 @@
   *
   * \brief Represents a diagonal matrix with its storage
   *
-  * \param _Scalar the type of coefficients
+  * \param Scalar_ the type of coefficients
   * \param SizeAtCompileTime the dimension of the matrix, or Dynamic
   * \param MaxSizeAtCompileTime the dimension of the matrix, or Dynamic. This parameter is optional and defaults
   *        to SizeAtCompileTime. Most of the time, you do not need to specify it.
@@ -125,26 +125,26 @@
   */
 
 namespace internal {
-template<typename _Scalar, int SizeAtCompileTime, int MaxSizeAtCompileTime>
-struct traits<DiagonalMatrix<_Scalar,SizeAtCompileTime,MaxSizeAtCompileTime> >
- : traits<Matrix<_Scalar,SizeAtCompileTime,SizeAtCompileTime,0,MaxSizeAtCompileTime,MaxSizeAtCompileTime> >
+template<typename Scalar_, int SizeAtCompileTime, int MaxSizeAtCompileTime>
+struct traits<DiagonalMatrix<Scalar_,SizeAtCompileTime,MaxSizeAtCompileTime> >
+ : traits<Matrix<Scalar_,SizeAtCompileTime,SizeAtCompileTime,0,MaxSizeAtCompileTime,MaxSizeAtCompileTime> >
 {
-  typedef Matrix<_Scalar,SizeAtCompileTime,1,0,MaxSizeAtCompileTime,1> DiagonalVectorType;
+  typedef Matrix<Scalar_,SizeAtCompileTime,1,0,MaxSizeAtCompileTime,1> DiagonalVectorType;
   typedef DiagonalShape StorageKind;
   enum {
     Flags = LvalueBit | NoPreferredStorageOrderBit
   };
 };
 }
-template<typename _Scalar, int SizeAtCompileTime, int MaxSizeAtCompileTime>
+template<typename Scalar_, int SizeAtCompileTime, int MaxSizeAtCompileTime>
 class DiagonalMatrix
-  : public DiagonalBase<DiagonalMatrix<_Scalar,SizeAtCompileTime,MaxSizeAtCompileTime> >
+  : public DiagonalBase<DiagonalMatrix<Scalar_,SizeAtCompileTime,MaxSizeAtCompileTime> >
 {
   public:
     #ifndef EIGEN_PARSED_BY_DOXYGEN
     typedef typename internal::traits<DiagonalMatrix>::DiagonalVectorType DiagonalVectorType;
     typedef const DiagonalMatrix& Nested;
-    typedef _Scalar Scalar;
+    typedef Scalar_ Scalar;
     typedef typename internal::traits<DiagonalMatrix>::StorageKind StorageKind;
     typedef typename internal::traits<DiagonalMatrix>::StorageIndex StorageIndex;
     #endif
@@ -261,7 +261,7 @@
   *
   * \brief Expression of a diagonal matrix
   *
-  * \param _DiagonalVectorType the type of the vector of diagonal coefficients
+  * \param DiagonalVectorType_ the type of the vector of diagonal coefficients
   *
   * This class is an expression of a diagonal matrix, but not storing its own vector of diagonal coefficients,
   * instead wrapping an existing vector expression. It is the return type of MatrixBase::asDiagonal()
@@ -271,10 +271,10 @@
   */
 
 namespace internal {
-template<typename _DiagonalVectorType>
-struct traits<DiagonalWrapper<_DiagonalVectorType> >
+template<typename DiagonalVectorType_>
+struct traits<DiagonalWrapper<DiagonalVectorType_> >
 {
-  typedef _DiagonalVectorType DiagonalVectorType;
+  typedef DiagonalVectorType_ DiagonalVectorType;
   typedef typename DiagonalVectorType::Scalar Scalar;
   typedef typename DiagonalVectorType::StorageIndex StorageIndex;
   typedef DiagonalShape StorageKind;
@@ -289,13 +289,13 @@
 };
 }
 
-template<typename _DiagonalVectorType>
+template<typename DiagonalVectorType_>
 class DiagonalWrapper
-  : public DiagonalBase<DiagonalWrapper<_DiagonalVectorType> >, internal::no_assignment_operator
+  : public DiagonalBase<DiagonalWrapper<DiagonalVectorType_> >, internal::no_assignment_operator
 {
   public:
     #ifndef EIGEN_PARSED_BY_DOXYGEN
-    typedef _DiagonalVectorType DiagonalVectorType;
+    typedef DiagonalVectorType_ DiagonalVectorType;
     typedef DiagonalWrapper Nested;
     #endif
 
diff --git a/Eigen/src/Core/Dot.h b/Eigen/src/Core/Dot.h
index 41a8cb4..5c3441b 100644
--- a/Eigen/src/Core/Dot.h
+++ b/Eigen/src/Core/Dot.h
@@ -86,7 +86,7 @@
 
 //---------- implementation of L2 norm and related functions ----------
 
-/** \returns, for vectors, the squared \em l2 norm of \c *this, and for matrices the Frobenius norm.
+/** \returns, for vectors, the squared \em l2 norm of \c *this, and for matrices the squared Frobenius norm.
   * In both cases, it consists in the sum of the square of all the matrix entries.
   * For vectors, this is also equals to the dot product of \c *this with itself.
   *
diff --git a/Eigen/src/Core/Map.h b/Eigen/src/Core/Map.h
index 93d2ae9..218cc15 100644
--- a/Eigen/src/Core/Map.h
+++ b/Eigen/src/Core/Map.h
@@ -47,7 +47,7 @@
   * \brief A matrix or vector expression mapping an existing array of data.
   *
   * \tparam PlainObjectType the equivalent matrix type of the mapped data
-  * \tparam MapOptions specifies the pointer alignment in bytes. It can be: \c #Aligned128, , \c #Aligned64, \c #Aligned32, \c #Aligned16, \c #Aligned8 or \c #Unaligned.
+  * \tparam MapOptions specifies the pointer alignment in bytes. It can be: \c #Aligned128, \c #Aligned64, \c #Aligned32, \c #Aligned16, \c #Aligned8 or \c #Unaligned.
   *                The default is \c #Unaligned.
   * \tparam StrideType optionally specifies strides. By default, Map assumes the memory layout
   *                   of an ordinary, contiguous array. This can be overridden by specifying strides.
diff --git a/Eigen/src/Core/MathFunctions.h b/Eigen/src/Core/MathFunctions.h
index d7ac4d6..61b78f4 100644
--- a/Eigen/src/Core/MathFunctions.h
+++ b/Eigen/src/Core/MathFunctions.h
@@ -572,7 +572,9 @@
 * Implementation of arg                                                     *
 ****************************************************************************/
 
-#if EIGEN_HAS_CXX11_MATH
+// Visual Studio 2017 has a bug where arg(float) returns 0 for negative inputs.
+// This seems to be fixed in VS 2019.
+#if EIGEN_HAS_CXX11_MATH && (!EIGEN_COMP_MSVC || EIGEN_COMP_MSVC >= 1920)
 // std::arg is only defined for types of std::complex, or integer types or float/double/long double
 template<typename Scalar,
           bool HasStdImpl = NumTraits<Scalar>::IsComplex || is_integral<Scalar>::value
diff --git a/Eigen/src/Core/Matrix.h b/Eigen/src/Core/Matrix.h
index f0e59a9..de54824 100644
--- a/Eigen/src/Core/Matrix.h
+++ b/Eigen/src/Core/Matrix.h
@@ -14,34 +14,34 @@
 namespace Eigen {
 
 namespace internal {
-template<typename _Scalar, int _Rows, int _Cols, int _Options, int _MaxRows, int _MaxCols>
-struct traits<Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols> >
+template<typename Scalar_, int Rows_, int Cols_, int Options_, int MaxRows_, int MaxCols_>
+struct traits<Matrix<Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_> >
 {
 private:
-  enum { size = internal::size_at_compile_time<_Rows,_Cols>::ret };
-  typedef typename find_best_packet<_Scalar,size>::type PacketScalar;
+  enum { size = internal::size_at_compile_time<Rows_,Cols_>::ret };
+  typedef typename find_best_packet<Scalar_,size>::type PacketScalar;
   enum {
-      row_major_bit = _Options&RowMajor ? RowMajorBit : 0,
-      is_dynamic_size_storage = _MaxRows==Dynamic || _MaxCols==Dynamic,
-      max_size = is_dynamic_size_storage ? Dynamic : _MaxRows*_MaxCols,
-      default_alignment = compute_default_alignment<_Scalar,max_size>::value,
-      actual_alignment = ((_Options&DontAlign)==0) ? default_alignment : 0,
+      row_major_bit = Options_&RowMajor ? RowMajorBit : 0,
+      is_dynamic_size_storage = MaxRows_==Dynamic || MaxCols_==Dynamic,
+      max_size = is_dynamic_size_storage ? Dynamic : MaxRows_*MaxCols_,
+      default_alignment = compute_default_alignment<Scalar_,max_size>::value,
+      actual_alignment = ((Options_&DontAlign)==0) ? default_alignment : 0,
       required_alignment = unpacket_traits<PacketScalar>::alignment,
-      packet_access_bit = (packet_traits<_Scalar>::Vectorizable && (EIGEN_UNALIGNED_VECTORIZE || (actual_alignment>=required_alignment))) ? PacketAccessBit : 0
+      packet_access_bit = (packet_traits<Scalar_>::Vectorizable && (EIGEN_UNALIGNED_VECTORIZE || (actual_alignment>=required_alignment))) ? PacketAccessBit : 0
     };
 
 public:
-  typedef _Scalar Scalar;
+  typedef Scalar_ Scalar;
   typedef Dense StorageKind;
   typedef Eigen::Index StorageIndex;
   typedef MatrixXpr XprKind;
   enum {
-    RowsAtCompileTime = _Rows,
-    ColsAtCompileTime = _Cols,
-    MaxRowsAtCompileTime = _MaxRows,
-    MaxColsAtCompileTime = _MaxCols,
-    Flags = compute_matrix_flags<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols>::ret,
-    Options = _Options,
+    RowsAtCompileTime = Rows_,
+    ColsAtCompileTime = Cols_,
+    MaxRowsAtCompileTime = MaxRows_,
+    MaxColsAtCompileTime = MaxCols_,
+    Flags = compute_matrix_flags<Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_>::ret,
+    Options = Options_,
     InnerStrideAtCompileTime = 1,
     OuterStrideAtCompileTime = (Options&RowMajor) ? ColsAtCompileTime : RowsAtCompileTime,
 
@@ -63,18 +63,18 @@
   * The %Matrix class encompasses \em both fixed-size and dynamic-size objects (\ref fixedsize "note").
   *
   * The first three template parameters are required:
-  * \tparam _Scalar Numeric type, e.g. float, double, int or std::complex<float>.
+  * \tparam Scalar_ Numeric type, e.g. float, double, int or std::complex<float>.
   *                 User defined scalar types are supported as well (see \ref user_defined_scalars "here").
-  * \tparam _Rows Number of rows, or \b Dynamic
-  * \tparam _Cols Number of columns, or \b Dynamic
+  * \tparam Rows_ Number of rows, or \b Dynamic
+  * \tparam Cols_ Number of columns, or \b Dynamic
   *
   * The remaining template parameters are optional -- in most cases you don't have to worry about them.
-  * \tparam _Options A combination of either \b #RowMajor or \b #ColMajor, and of either
+  * \tparam Options_ A combination of either \b #RowMajor or \b #ColMajor, and of either
   *                 \b #AutoAlign or \b #DontAlign.
   *                 The former controls \ref TopicStorageOrders "storage order", and defaults to column-major. The latter controls alignment, which is required
   *                 for vectorization. It defaults to aligning matrices except for fixed sizes that aren't a multiple of the packet size.
-  * \tparam _MaxRows Maximum number of rows. Defaults to \a _Rows (\ref maxrows "note").
-  * \tparam _MaxCols Maximum number of columns. Defaults to \a _Cols (\ref maxrows "note").
+  * \tparam MaxRows_ Maximum number of rows. Defaults to \a Rows_ (\ref maxrows "note").
+  * \tparam MaxCols_ Maximum number of columns. Defaults to \a Cols_ (\ref maxrows "note").
   *
   * Eigen provides a number of typedefs covering the usual cases. Here are some examples:
   *
@@ -128,12 +128,12 @@
   * Note that \em dense matrices, be they Fixed-size or Dynamic-size, <em>do not</em> expand dynamically in the sense of a std::map.
   * If you want this behavior, see the Sparse module.</dd>
   *
-  * <dt><b>\anchor maxrows _MaxRows and _MaxCols:</b></dt>
+  * <dt><b>\anchor maxrows MaxRows_ and MaxCols_:</b></dt>
   * <dd>In most cases, one just leaves these parameters to the default values.
   * These parameters mean the maximum size of rows and columns that the matrix may have. They are useful in cases
   * when the exact numbers of rows and columns are not known are compile-time, but it is known at compile-time that they cannot
-  * exceed a certain value. This happens when taking dynamic-size blocks inside fixed-size matrices: in this case _MaxRows and _MaxCols
-  * are the dimensions of the original matrix, while _Rows and _Cols are Dynamic.</dd>
+  * exceed a certain value. This happens when taking dynamic-size blocks inside fixed-size matrices: in this case MaxRows_ and MaxCols_
+  * are the dimensions of the original matrix, while Rows_ and Cols_ are Dynamic.</dd>
   * </dl>
   *
   * <i><b>ABI and storage layout</b></i>
@@ -174,9 +174,9 @@
   * \ref TopicStorageOrders
   */
 
-template<typename _Scalar, int _Rows, int _Cols, int _Options, int _MaxRows, int _MaxCols>
+template<typename Scalar_, int Rows_, int Cols_, int Options_, int MaxRows_, int MaxCols_>
 class Matrix
-  : public PlainObjectBase<Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols> >
+  : public PlainObjectBase<Matrix<Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_> >
 {
   public:
 
@@ -185,7 +185,7 @@
       */
     typedef PlainObjectBase<Matrix> Base;
 
-    enum { Options = _Options };
+    enum { Options = Options_ };
 
     EIGEN_DENSE_PUBLIC_INTERFACE(Matrix)
 
diff --git a/Eigen/src/Core/NumTraits.h b/Eigen/src/Core/NumTraits.h
index 72eac5a..608a4e7 100644
--- a/Eigen/src/Core/NumTraits.h
+++ b/Eigen/src/Core/NumTraits.h
@@ -252,15 +252,15 @@
   static inline long double dummy_precision() { return 1e-15l; }
 };
 
-template<typename _Real> struct NumTraits<std::complex<_Real> >
-  : GenericNumTraits<std::complex<_Real> >
+template<typename Real_> struct NumTraits<std::complex<Real_> >
+  : GenericNumTraits<std::complex<Real_> >
 {
-  typedef _Real Real;
-  typedef typename NumTraits<_Real>::Literal Literal;
+  typedef Real_ Real;
+  typedef typename NumTraits<Real_>::Literal Literal;
   enum {
     IsComplex = 1,
-    RequireInitialization = NumTraits<_Real>::RequireInitialization,
-    ReadCost = 2 * NumTraits<_Real>::ReadCost,
+    RequireInitialization = NumTraits<Real_>::RequireInitialization,
+    ReadCost = 2 * NumTraits<Real_>::ReadCost,
     AddCost = 2 * NumTraits<Real>::AddCost,
     MulCost = 4 * NumTraits<Real>::MulCost + 2 * NumTraits<Real>::AddCost
   };
diff --git a/Eigen/src/Core/PermutationMatrix.h b/Eigen/src/Core/PermutationMatrix.h
index 69401bf..24fe660 100644
--- a/Eigen/src/Core/PermutationMatrix.h
+++ b/Eigen/src/Core/PermutationMatrix.h
@@ -269,13 +269,13 @@
 };
 
 namespace internal {
-template<int SizeAtCompileTime, int MaxSizeAtCompileTime, typename _StorageIndex>
-struct traits<PermutationMatrix<SizeAtCompileTime, MaxSizeAtCompileTime, _StorageIndex> >
- : traits<Matrix<_StorageIndex,SizeAtCompileTime,SizeAtCompileTime,0,MaxSizeAtCompileTime,MaxSizeAtCompileTime> >
+template<int SizeAtCompileTime, int MaxSizeAtCompileTime, typename StorageIndex_>
+struct traits<PermutationMatrix<SizeAtCompileTime, MaxSizeAtCompileTime, StorageIndex_> >
+ : traits<Matrix<StorageIndex_,SizeAtCompileTime,SizeAtCompileTime,0,MaxSizeAtCompileTime,MaxSizeAtCompileTime> >
 {
   typedef PermutationStorage StorageKind;
-  typedef Matrix<_StorageIndex, SizeAtCompileTime, 1, 0, MaxSizeAtCompileTime, 1> IndicesType;
-  typedef _StorageIndex StorageIndex;
+  typedef Matrix<StorageIndex_, SizeAtCompileTime, 1, 0, MaxSizeAtCompileTime, 1> IndicesType;
+  typedef StorageIndex_ StorageIndex;
   typedef void Scalar;
 };
 }
@@ -287,14 +287,14 @@
   *
   * \tparam SizeAtCompileTime the number of rows/cols, or Dynamic
   * \tparam MaxSizeAtCompileTime the maximum number of rows/cols, or Dynamic. This optional parameter defaults to SizeAtCompileTime. Most of the time, you should not have to specify it.
-  * \tparam _StorageIndex the integer type of the indices
+  * \tparam StorageIndex_ the integer type of the indices
   *
   * This class represents a permutation matrix, internally stored as a vector of integers.
   *
   * \sa class PermutationBase, class PermutationWrapper, class DiagonalMatrix
   */
-template<int SizeAtCompileTime, int MaxSizeAtCompileTime, typename _StorageIndex>
-class PermutationMatrix : public PermutationBase<PermutationMatrix<SizeAtCompileTime, MaxSizeAtCompileTime, _StorageIndex> >
+template<int SizeAtCompileTime, int MaxSizeAtCompileTime, typename StorageIndex_>
+class PermutationMatrix : public PermutationBase<PermutationMatrix<SizeAtCompileTime, MaxSizeAtCompileTime, StorageIndex_> >
 {
     typedef PermutationBase<PermutationMatrix> Base;
     typedef internal::traits<PermutationMatrix> Traits;
@@ -389,20 +389,20 @@
 
 
 namespace internal {
-template<int SizeAtCompileTime, int MaxSizeAtCompileTime, typename _StorageIndex, int _PacketAccess>
-struct traits<Map<PermutationMatrix<SizeAtCompileTime, MaxSizeAtCompileTime, _StorageIndex>,_PacketAccess> >
- : traits<Matrix<_StorageIndex,SizeAtCompileTime,SizeAtCompileTime,0,MaxSizeAtCompileTime,MaxSizeAtCompileTime> >
+template<int SizeAtCompileTime, int MaxSizeAtCompileTime, typename StorageIndex_, int _PacketAccess>
+struct traits<Map<PermutationMatrix<SizeAtCompileTime, MaxSizeAtCompileTime, StorageIndex_>,_PacketAccess> >
+ : traits<Matrix<StorageIndex_,SizeAtCompileTime,SizeAtCompileTime,0,MaxSizeAtCompileTime,MaxSizeAtCompileTime> >
 {
   typedef PermutationStorage StorageKind;
-  typedef Map<const Matrix<_StorageIndex, SizeAtCompileTime, 1, 0, MaxSizeAtCompileTime, 1>, _PacketAccess> IndicesType;
-  typedef _StorageIndex StorageIndex;
+  typedef Map<const Matrix<StorageIndex_, SizeAtCompileTime, 1, 0, MaxSizeAtCompileTime, 1>, _PacketAccess> IndicesType;
+  typedef StorageIndex_ StorageIndex;
   typedef void Scalar;
 };
 }
 
-template<int SizeAtCompileTime, int MaxSizeAtCompileTime, typename _StorageIndex, int _PacketAccess>
-class Map<PermutationMatrix<SizeAtCompileTime, MaxSizeAtCompileTime, _StorageIndex>,_PacketAccess>
-  : public PermutationBase<Map<PermutationMatrix<SizeAtCompileTime, MaxSizeAtCompileTime, _StorageIndex>,_PacketAccess> >
+template<int SizeAtCompileTime, int MaxSizeAtCompileTime, typename StorageIndex_, int _PacketAccess>
+class Map<PermutationMatrix<SizeAtCompileTime, MaxSizeAtCompileTime, StorageIndex_>,_PacketAccess>
+  : public PermutationBase<Map<PermutationMatrix<SizeAtCompileTime, MaxSizeAtCompileTime, StorageIndex_>,_PacketAccess> >
 {
     typedef PermutationBase<Map> Base;
     typedef internal::traits<Map> Traits;
@@ -452,18 +452,18 @@
     IndicesType m_indices;
 };
 
-template<typename _IndicesType> class TranspositionsWrapper;
+template<typename IndicesType_> class TranspositionsWrapper;
 namespace internal {
-template<typename _IndicesType>
-struct traits<PermutationWrapper<_IndicesType> >
+template<typename IndicesType_>
+struct traits<PermutationWrapper<IndicesType_> >
 {
   typedef PermutationStorage StorageKind;
   typedef void Scalar;
-  typedef typename _IndicesType::Scalar StorageIndex;
-  typedef _IndicesType IndicesType;
+  typedef typename IndicesType_::Scalar StorageIndex;
+  typedef IndicesType_ IndicesType;
   enum {
-    RowsAtCompileTime = _IndicesType::SizeAtCompileTime,
-    ColsAtCompileTime = _IndicesType::SizeAtCompileTime,
+    RowsAtCompileTime = IndicesType_::SizeAtCompileTime,
+    ColsAtCompileTime = IndicesType_::SizeAtCompileTime,
     MaxRowsAtCompileTime = IndicesType::MaxSizeAtCompileTime,
     MaxColsAtCompileTime = IndicesType::MaxSizeAtCompileTime,
     Flags = 0
@@ -476,14 +476,14 @@
   *
   * \brief Class to view a vector of integers as a permutation matrix
   *
-  * \tparam _IndicesType the type of the vector of integer (can be any compatible expression)
+  * \tparam IndicesType_ the type of the vector of integer (can be any compatible expression)
   *
   * This class allows to view any vector expression of integers as a permutation matrix.
   *
   * \sa class PermutationBase, class PermutationMatrix
   */
-template<typename _IndicesType>
-class PermutationWrapper : public PermutationBase<PermutationWrapper<_IndicesType> >
+template<typename IndicesType_>
+class PermutationWrapper : public PermutationBase<PermutationWrapper<IndicesType_> >
 {
     typedef PermutationBase<PermutationWrapper> Base;
     typedef internal::traits<PermutationWrapper> Traits;
diff --git a/Eigen/src/Core/PlainObjectBase.h b/Eigen/src/Core/PlainObjectBase.h
index e2ddbd1..00cdc55 100644
--- a/Eigen/src/Core/PlainObjectBase.h
+++ b/Eigen/src/Core/PlainObjectBase.h
@@ -64,18 +64,18 @@
 // This is a workaround to doxygen not being able to understand the inheritance logic
 // when it is hidden by the dense_xpr_base helper struct.
 // Moreover, doxygen fails to include members that are not documented in the declaration body of
-// MatrixBase if we inherits MatrixBase<Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols> >,
+// MatrixBase if we inherits MatrixBase<Matrix<Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_> >,
 // this is why we simply inherits MatrixBase, though this does not make sense.
 
 /** This class is just a workaround for Doxygen and it does not not actually exist. */
 template<typename Derived> struct dense_xpr_base_dispatcher;
 /** This class is just a workaround for Doxygen and it does not not actually exist. */
-template<typename _Scalar, int _Rows, int _Cols, int _Options, int _MaxRows, int _MaxCols>
-struct dense_xpr_base_dispatcher<Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols> >
+template<typename Scalar_, int Rows_, int Cols_, int Options_, int MaxRows_, int MaxCols_>
+struct dense_xpr_base_dispatcher<Matrix<Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_> >
     : public MatrixBase {};
 /** This class is just a workaround for Doxygen and it does not not actually exist. */
-template<typename _Scalar, int _Rows, int _Cols, int _Options, int _MaxRows, int _MaxCols>
-struct dense_xpr_base_dispatcher<Array<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols> >
+template<typename Scalar_, int Rows_, int Cols_, int Options_, int MaxRows_, int MaxCols_>
+struct dense_xpr_base_dispatcher<Array<Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_> >
     : public ArrayBase {};
 
 } // namespace doxygen
diff --git a/Eigen/src/Core/Product.h b/Eigen/src/Core/Product.h
index 70a6c10..1941749 100644
--- a/Eigen/src/Core/Product.h
+++ b/Eigen/src/Core/Product.h
@@ -58,8 +58,8 @@
   *
   * \brief Expression of the product of two arbitrary matrices or vectors
   *
-  * \tparam _Lhs the type of the left-hand side expression
-  * \tparam _Rhs the type of the right-hand side expression
+  * \tparam Lhs_ the type of the left-hand side expression
+  * \tparam Rhs_ the type of the right-hand side expression
   *
   * This class represents an expression of the product of two arbitrary matrices.
   *
@@ -67,16 +67,16 @@
   * \tparam Option     can be DefaultProduct, AliasFreeProduct, or LazyProduct
   *
   */
-template<typename _Lhs, typename _Rhs, int Option>
-class Product : public ProductImpl<_Lhs,_Rhs,Option,
-                                   typename internal::product_promote_storage_type<typename internal::traits<_Lhs>::StorageKind,
-                                                                                   typename internal::traits<_Rhs>::StorageKind,
-                                                                                   internal::product_type<_Lhs,_Rhs>::ret>::ret>
+template<typename Lhs_, typename Rhs_, int Option>
+class Product : public ProductImpl<Lhs_,Rhs_,Option,
+                                   typename internal::product_promote_storage_type<typename internal::traits<Lhs_>::StorageKind,
+                                                                                   typename internal::traits<Rhs_>::StorageKind,
+                                                                                   internal::product_type<Lhs_,Rhs_>::ret>::ret>
 {
   public:
 
-    typedef _Lhs Lhs;
-    typedef _Rhs Rhs;
+    typedef Lhs_ Lhs;
+    typedef Rhs_ Rhs;
 
     typedef typename ProductImpl<
         Lhs, Rhs, Option,
diff --git a/Eigen/src/Core/ProductEvaluators.h b/Eigen/src/Core/ProductEvaluators.h
index 8cf294b..b9eab97 100644
--- a/Eigen/src/Core/ProductEvaluators.h
+++ b/Eigen/src/Core/ProductEvaluators.h
@@ -836,13 +836,13 @@
     MatrixFlags = evaluator<MatrixType>::Flags,
     DiagFlags = evaluator<DiagonalType>::Flags,
 
-    _StorageOrder = (Derived::MaxRowsAtCompileTime==1 && Derived::MaxColsAtCompileTime!=1) ? RowMajor
+    StorageOrder_ = (Derived::MaxRowsAtCompileTime==1 && Derived::MaxColsAtCompileTime!=1) ? RowMajor
                   : (Derived::MaxColsAtCompileTime==1 && Derived::MaxRowsAtCompileTime!=1) ? ColMajor
                   : MatrixFlags & RowMajorBit ? RowMajor : ColMajor,
-    _SameStorageOrder = _StorageOrder == (MatrixFlags & RowMajorBit ? RowMajor : ColMajor),
+    _SameStorageOrder = StorageOrder_ == (MatrixFlags & RowMajorBit ? RowMajor : ColMajor),
 
-    _ScalarAccessOnDiag =  !((int(_StorageOrder) == ColMajor && int(ProductOrder) == OnTheLeft)
-                           ||(int(_StorageOrder) == RowMajor && int(ProductOrder) == OnTheRight)),
+    _ScalarAccessOnDiag =  !((int(StorageOrder_) == ColMajor && int(ProductOrder) == OnTheLeft)
+                           ||(int(StorageOrder_) == RowMajor && int(ProductOrder) == OnTheRight)),
     _SameTypes = is_same<typename MatrixType::Scalar, typename DiagonalType::Scalar>::value,
     // FIXME currently we need same types, but in the future the next rule should be the one
     //_Vectorizable = bool(int(MatrixFlags)&PacketAccessBit) && ((!_PacketOnDiag) || (_SameTypes && bool(int(DiagFlags)&PacketAccessBit))),
@@ -913,7 +913,7 @@
   typedef typename Lhs::DiagonalVectorType DiagonalType;
 
 
-  enum { StorageOrder = Base::_StorageOrder };
+  enum { StorageOrder = Base::StorageOrder_ };
 
   EIGEN_DEVICE_FUNC explicit product_evaluator(const XprType& xpr)
     : Base(xpr.rhs(), xpr.lhs().diagonal())
@@ -957,7 +957,7 @@
   typedef Product<Lhs, Rhs, ProductKind> XprType;
   typedef typename XprType::PlainObject PlainObject;
 
-  enum { StorageOrder = Base::_StorageOrder };
+  enum { StorageOrder = Base::StorageOrder_ };
 
   EIGEN_DEVICE_FUNC explicit product_evaluator(const XprType& xpr)
     : Base(xpr.lhs(), xpr.rhs().diagonal())
diff --git a/Eigen/src/Core/Redux.h b/Eigen/src/Core/Redux.h
index b6790d1..5732ba8 100644
--- a/Eigen/src/Core/Redux.h
+++ b/Eigen/src/Core/Redux.h
@@ -353,12 +353,12 @@
 };
 
 // evaluator adaptor
-template<typename _XprType>
-class redux_evaluator : public internal::evaluator<_XprType>
+template<typename XprType_>
+class redux_evaluator : public internal::evaluator<XprType_>
 {
-  typedef internal::evaluator<_XprType> Base;
+  typedef internal::evaluator<XprType_> Base;
 public:
-  typedef _XprType XprType;
+  typedef XprType_ XprType;
   EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
   explicit redux_evaluator(const XprType &xpr) : Base(xpr) {}
   
diff --git a/Eigen/src/Core/Ref.h b/Eigen/src/Core/Ref.h
index c2a37ea..716552a 100644
--- a/Eigen/src/Core/Ref.h
+++ b/Eigen/src/Core/Ref.h
@@ -14,16 +14,16 @@
 
 namespace internal {
 
-template<typename _PlainObjectType, int _Options, typename _StrideType>
-struct traits<Ref<_PlainObjectType, _Options, _StrideType> >
-  : public traits<Map<_PlainObjectType, _Options, _StrideType> >
+template<typename _PlainObjectType, int Options_, typename _StrideType>
+struct traits<Ref<_PlainObjectType, Options_, _StrideType> >
+  : public traits<Map<_PlainObjectType, Options_, _StrideType> >
 {
   typedef _PlainObjectType PlainObjectType;
   typedef _StrideType StrideType;
   enum {
-    Options = _Options,
-    Flags = traits<Map<_PlainObjectType, _Options, _StrideType> >::Flags | NestByRefBit,
-    Alignment = traits<Map<_PlainObjectType, _Options, _StrideType> >::Alignment
+    Options = Options_,
+    Flags = traits<Map<_PlainObjectType, Options_, _StrideType> >::Flags | NestByRefBit,
+    Alignment = traits<Map<_PlainObjectType, Options_, _StrideType> >::Alignment
   };
 
   template<typename Derived> struct match {
diff --git a/Eigen/src/Core/SelfAdjointView.h b/Eigen/src/Core/SelfAdjointView.h
index 8ce3b37..28f3a70 100644
--- a/Eigen/src/Core/SelfAdjointView.h
+++ b/Eigen/src/Core/SelfAdjointView.h
@@ -46,12 +46,12 @@
 }
 
 
-template<typename _MatrixType, unsigned int UpLo> class SelfAdjointView
-  : public TriangularBase<SelfAdjointView<_MatrixType, UpLo> >
+template<typename MatrixType_, unsigned int UpLo> class SelfAdjointView
+  : public TriangularBase<SelfAdjointView<MatrixType_, UpLo> >
 {
   public:
 
-    typedef _MatrixType MatrixType;
+    typedef MatrixType_ MatrixType;
     typedef TriangularBase<SelfAdjointView> Base;
     typedef typename internal::traits<SelfAdjointView>::MatrixTypeNested MatrixTypeNested;
     typedef typename internal::traits<SelfAdjointView>::MatrixTypeNestedCleaned MatrixTypeNestedCleaned;
diff --git a/Eigen/src/Core/StlIterators.h b/Eigen/src/Core/StlIterators.h
index 09041db..b412b39 100644
--- a/Eigen/src/Core/StlIterators.h
+++ b/Eigen/src/Core/StlIterators.h
@@ -256,10 +256,10 @@
   internal::variable_if_dynamic<Index, XprType::InnerStrideAtCompileTime> m_incr;
 };
 
-template<typename _XprType>
-struct indexed_based_stl_iterator_traits<generic_randaccess_stl_iterator<_XprType> >
+template<typename XprType_>
+struct indexed_based_stl_iterator_traits<generic_randaccess_stl_iterator<XprType_> >
 {
-  typedef _XprType XprType;
+  typedef XprType_ XprType;
   typedef generic_randaccess_stl_iterator<typename internal::remove_const<XprType>::type> non_const_iterator;
   typedef generic_randaccess_stl_iterator<typename internal::add_const<XprType>::type> const_iterator;
 };
@@ -301,10 +301,10 @@
   pointer   operator->()        const { return &((*mp_xpr)(m_index)); }
 };
 
-template<typename _XprType, DirectionType Direction>
-struct indexed_based_stl_iterator_traits<subvector_stl_iterator<_XprType,Direction> >
+template<typename XprType_, DirectionType Direction>
+struct indexed_based_stl_iterator_traits<subvector_stl_iterator<XprType_,Direction> >
 {
-  typedef _XprType XprType;
+  typedef XprType_ XprType;
   typedef subvector_stl_iterator<typename internal::remove_const<XprType>::type, Direction> non_const_iterator;
   typedef subvector_stl_iterator<typename internal::add_const<XprType>::type, Direction> const_iterator;
 };
@@ -349,10 +349,10 @@
   pointer   operator->()        const { return (*mp_xpr).template subVector<Direction>(m_index); }
 };
 
-template<typename _XprType, DirectionType Direction>
-struct indexed_based_stl_iterator_traits<subvector_stl_reverse_iterator<_XprType,Direction> >
+template<typename XprType_, DirectionType Direction>
+struct indexed_based_stl_iterator_traits<subvector_stl_reverse_iterator<XprType_,Direction> >
 {
-  typedef _XprType XprType;
+  typedef XprType_ XprType;
   typedef subvector_stl_reverse_iterator<typename internal::remove_const<XprType>::type, Direction> non_const_iterator;
   typedef subvector_stl_reverse_iterator<typename internal::add_const<XprType>::type, Direction> const_iterator;
 };
diff --git a/Eigen/src/Core/Stride.h b/Eigen/src/Core/Stride.h
index 6494d51..6ad48f8 100644
--- a/Eigen/src/Core/Stride.h
+++ b/Eigen/src/Core/Stride.h
@@ -31,8 +31,8 @@
   * arguments to the constructor.
   *
   * Indeed, this class takes two template parameters:
-  *  \tparam _OuterStrideAtCompileTime the outer stride, or Dynamic if you want to specify it at runtime.
-  *  \tparam _InnerStrideAtCompileTime the inner stride, or Dynamic if you want to specify it at runtime.
+  *  \tparam OuterStrideAtCompileTime_ the outer stride, or Dynamic if you want to specify it at runtime.
+  *  \tparam InnerStrideAtCompileTime_ the inner stride, or Dynamic if you want to specify it at runtime.
   *
   * Here is an example:
   * \include Map_general_stride.cpp
@@ -44,14 +44,14 @@
   *
   * \sa class InnerStride, class OuterStride, \ref TopicStorageOrders
   */
-template<int _OuterStrideAtCompileTime, int _InnerStrideAtCompileTime>
+template<int OuterStrideAtCompileTime_, int InnerStrideAtCompileTime_>
 class Stride
 {
   public:
     typedef Eigen::Index Index; ///< \deprecated since Eigen 3.3
     enum {
-      InnerStrideAtCompileTime = _InnerStrideAtCompileTime,
-      OuterStrideAtCompileTime = _OuterStrideAtCompileTime
+      InnerStrideAtCompileTime = InnerStrideAtCompileTime_,
+      OuterStrideAtCompileTime = OuterStrideAtCompileTime_
     };
 
     /** Default constructor, for use when strides are fixed at compile time */
diff --git a/Eigen/src/Core/Transpositions.h b/Eigen/src/Core/Transpositions.h
index 38a7b01..4119621 100644
--- a/Eigen/src/Core/Transpositions.h
+++ b/Eigen/src/Core/Transpositions.h
@@ -113,11 +113,11 @@
 };
 
 namespace internal {
-template<int SizeAtCompileTime, int MaxSizeAtCompileTime, typename _StorageIndex>
-struct traits<Transpositions<SizeAtCompileTime,MaxSizeAtCompileTime,_StorageIndex> >
- : traits<PermutationMatrix<SizeAtCompileTime,MaxSizeAtCompileTime,_StorageIndex> >
+template<int SizeAtCompileTime, int MaxSizeAtCompileTime, typename StorageIndex_>
+struct traits<Transpositions<SizeAtCompileTime,MaxSizeAtCompileTime,StorageIndex_> >
+ : traits<PermutationMatrix<SizeAtCompileTime,MaxSizeAtCompileTime,StorageIndex_> >
 {
-  typedef Matrix<_StorageIndex, SizeAtCompileTime, 1, 0, MaxSizeAtCompileTime, 1> IndicesType;
+  typedef Matrix<StorageIndex_, SizeAtCompileTime, 1, 0, MaxSizeAtCompileTime, 1> IndicesType;
   typedef TranspositionsStorage StorageKind;
 };
 }
@@ -151,8 +151,8 @@
   * \sa class PermutationMatrix
   */
 
-template<int SizeAtCompileTime, int MaxSizeAtCompileTime, typename _StorageIndex>
-class Transpositions : public TranspositionsBase<Transpositions<SizeAtCompileTime,MaxSizeAtCompileTime,_StorageIndex> >
+template<int SizeAtCompileTime, int MaxSizeAtCompileTime, typename StorageIndex_>
+class Transpositions : public TranspositionsBase<Transpositions<SizeAtCompileTime,MaxSizeAtCompileTime,StorageIndex_> >
 {
     typedef internal::traits<Transpositions> Traits;
   public:
@@ -199,19 +199,19 @@
 
 
 namespace internal {
-template<int SizeAtCompileTime, int MaxSizeAtCompileTime, typename _StorageIndex, int _PacketAccess>
-struct traits<Map<Transpositions<SizeAtCompileTime,MaxSizeAtCompileTime,_StorageIndex>,_PacketAccess> >
- : traits<PermutationMatrix<SizeAtCompileTime,MaxSizeAtCompileTime,_StorageIndex> >
+template<int SizeAtCompileTime, int MaxSizeAtCompileTime, typename StorageIndex_, int _PacketAccess>
+struct traits<Map<Transpositions<SizeAtCompileTime,MaxSizeAtCompileTime,StorageIndex_>,_PacketAccess> >
+ : traits<PermutationMatrix<SizeAtCompileTime,MaxSizeAtCompileTime,StorageIndex_> >
 {
-  typedef Map<const Matrix<_StorageIndex,SizeAtCompileTime,1,0,MaxSizeAtCompileTime,1>, _PacketAccess> IndicesType;
-  typedef _StorageIndex StorageIndex;
+  typedef Map<const Matrix<StorageIndex_,SizeAtCompileTime,1,0,MaxSizeAtCompileTime,1>, _PacketAccess> IndicesType;
+  typedef StorageIndex_ StorageIndex;
   typedef TranspositionsStorage StorageKind;
 };
 }
 
-template<int SizeAtCompileTime, int MaxSizeAtCompileTime, typename _StorageIndex, int PacketAccess>
-class Map<Transpositions<SizeAtCompileTime,MaxSizeAtCompileTime,_StorageIndex>,PacketAccess>
- : public TranspositionsBase<Map<Transpositions<SizeAtCompileTime,MaxSizeAtCompileTime,_StorageIndex>,PacketAccess> >
+template<int SizeAtCompileTime, int MaxSizeAtCompileTime, typename StorageIndex_, int PacketAccess>
+class Map<Transpositions<SizeAtCompileTime,MaxSizeAtCompileTime,StorageIndex_>,PacketAccess>
+ : public TranspositionsBase<Map<Transpositions<SizeAtCompileTime,MaxSizeAtCompileTime,StorageIndex_>,PacketAccess> >
 {
     typedef internal::traits<Map> Traits;
   public:
@@ -260,17 +260,17 @@
 };
 
 namespace internal {
-template<typename _IndicesType>
-struct traits<TranspositionsWrapper<_IndicesType> >
- : traits<PermutationWrapper<_IndicesType> >
+template<typename IndicesType_>
+struct traits<TranspositionsWrapper<IndicesType_> >
+ : traits<PermutationWrapper<IndicesType_> >
 {
   typedef TranspositionsStorage StorageKind;
 };
 }
 
-template<typename _IndicesType>
+template<typename IndicesType_>
 class TranspositionsWrapper
- : public TranspositionsBase<TranspositionsWrapper<_IndicesType> >
+ : public TranspositionsBase<TranspositionsWrapper<IndicesType_> >
 {
     typedef internal::traits<TranspositionsWrapper> Traits;
   public:
diff --git a/Eigen/src/Core/TriangularMatrix.h b/Eigen/src/Core/TriangularMatrix.h
index fdb8bc1..de95ff1 100644
--- a/Eigen/src/Core/TriangularMatrix.h
+++ b/Eigen/src/Core/TriangularMatrix.h
@@ -166,8 +166,8 @@
   * \sa MatrixBase::triangularView()
   */
 namespace internal {
-template<typename MatrixType, unsigned int _Mode>
-struct traits<TriangularView<MatrixType, _Mode> > : traits<MatrixType>
+template<typename MatrixType, unsigned int Mode_>
+struct traits<TriangularView<MatrixType, Mode_> > : traits<MatrixType>
 {
   typedef typename ref_selector<MatrixType>::non_const_type MatrixTypeNested;
   typedef typename remove_reference<MatrixTypeNested>::type MatrixTypeNestedNonRef;
@@ -175,30 +175,30 @@
   typedef typename MatrixType::PlainObject FullMatrixType;
   typedef MatrixType ExpressionType;
   enum {
-    Mode = _Mode,
+    Mode = Mode_,
     FlagsLvalueBit = is_lvalue<MatrixType>::value ? LvalueBit : 0,
     Flags = (MatrixTypeNestedCleaned::Flags & (HereditaryBits | FlagsLvalueBit) & (~(PacketAccessBit | DirectAccessBit | LinearAccessBit)))
   };
 };
 }
 
-template<typename _MatrixType, unsigned int _Mode, typename StorageKind> class TriangularViewImpl;
+template<typename MatrixType_, unsigned int Mode_, typename StorageKind> class TriangularViewImpl;
 
-template<typename _MatrixType, unsigned int _Mode> class TriangularView
-  : public TriangularViewImpl<_MatrixType, _Mode, typename internal::traits<_MatrixType>::StorageKind >
+template<typename MatrixType_, unsigned int Mode_> class TriangularView
+  : public TriangularViewImpl<MatrixType_, Mode_, typename internal::traits<MatrixType_>::StorageKind >
 {
   public:
 
-    typedef TriangularViewImpl<_MatrixType, _Mode, typename internal::traits<_MatrixType>::StorageKind > Base;
+    typedef TriangularViewImpl<MatrixType_, Mode_, typename internal::traits<MatrixType_>::StorageKind > Base;
     typedef typename internal::traits<TriangularView>::Scalar Scalar;
-    typedef _MatrixType MatrixType;
+    typedef MatrixType_ MatrixType;
 
   protected:
     typedef typename internal::traits<TriangularView>::MatrixTypeNested MatrixTypeNested;
     typedef typename internal::traits<TriangularView>::MatrixTypeNestedNonRef MatrixTypeNestedNonRef;
 
     typedef typename internal::remove_all<typename MatrixType::ConjugateReturnType>::type MatrixConjugateReturnType;
-    typedef TriangularView<typename internal::add_const<MatrixType>::type, _Mode> ConstTriangularView;
+    typedef TriangularView<typename internal::add_const<MatrixType>::type, Mode_> ConstTriangularView;
 
   public:
 
@@ -206,7 +206,7 @@
     typedef typename internal::traits<TriangularView>::MatrixTypeNestedCleaned NestedExpression;
 
     enum {
-      Mode = _Mode,
+      Mode = Mode_,
       Flags = internal::traits<TriangularView>::Flags,
       TransposeMode = (Mode & Upper ? Lower : 0)
                     | (Mode & Lower ? Upper : 0)
@@ -342,16 +342,17 @@
   *
   * \sa class TriangularView, MatrixBase::triangularView()
   */
-template<typename _MatrixType, unsigned int _Mode> class TriangularViewImpl<_MatrixType,_Mode,Dense>
-  : public TriangularBase<TriangularView<_MatrixType, _Mode> >
+template<typename MatrixType_, unsigned int Mode_> class TriangularViewImpl<MatrixType_,Mode_,Dense>
+  : public TriangularBase<TriangularView<MatrixType_, Mode_> >
 {
   public:
 
-    typedef TriangularView<_MatrixType, _Mode> TriangularViewType;
+    typedef TriangularView<MatrixType_, Mode_> TriangularViewType;
+
     typedef TriangularBase<TriangularViewType> Base;
     typedef typename internal::traits<TriangularViewType>::Scalar Scalar;
 
-    typedef _MatrixType MatrixType;
+    typedef MatrixType_ MatrixType;
     typedef typename MatrixType::PlainObject DenseMatrixType;
     typedef DenseMatrixType PlainObject;
 
@@ -362,7 +363,7 @@
     typedef typename internal::traits<TriangularViewType>::StorageKind StorageKind;
 
     enum {
-      Mode = _Mode,
+      Mode = Mode_,
       Flags = internal::traits<TriangularViewType>::Flags
     };
 
diff --git a/Eigen/src/Core/arch/AVX/PacketMath.h b/Eigen/src/Core/arch/AVX/PacketMath.h
index dd3f243..41cb7af 100644
--- a/Eigen/src/Core/arch/AVX/PacketMath.h
+++ b/Eigen/src/Core/arch/AVX/PacketMath.h
@@ -196,23 +196,21 @@
     HasNdtri  = 1
   };
 };
-#endif
 
-template<> struct scalar_div_cost<float,true> { enum { value = 14 }; };
-template<> struct scalar_div_cost<double,true> { enum { value = 16 }; };
-
-/* Proper support for integers is only provided by AVX2. In the meantime, we'll
-   use SSE instructions and packets to deal with integers.
-template<> struct packet_traits<int>    : default_packet_traits
+template<> struct packet_traits<int> : default_packet_traits
 {
   typedef Packet8i type;
+  typedef Packet4i half;
   enum {
     Vectorizable = 1,
     AlignedOnScalar = 1,
     size=8
   };
 };
-*/
+#endif
+
+template<> struct scalar_div_cost<float,true> { enum { value = 14 }; };
+template<> struct scalar_div_cost<double,true> { enum { value = 16 }; };
 
 template<> struct unpacket_traits<Packet8f> {
   typedef float     type;
@@ -226,8 +224,16 @@
   typedef Packet2d half;
   enum {size=4, alignment=Aligned32, vectorizable=true, masked_load_available=false, masked_store_available=false};
 };
-template<> struct unpacket_traits<Packet8i> { typedef int    type; typedef Packet4i half; enum {size=8, alignment=Aligned32, vectorizable=false, masked_load_available=false, masked_store_available=false}; };
-template<> struct unpacket_traits<Packet8bf> { typedef bfloat16 type; typedef Packet8bf half; enum {size=8, alignment=Aligned16, vectorizable=true, masked_load_available=false, masked_store_available=false}; };
+template<> struct unpacket_traits<Packet8i> {
+  typedef int    type;
+  typedef Packet4i half;
+  enum {size=8, alignment=Aligned32, vectorizable=true, masked_load_available=false, masked_store_available=false};
+};
+template<> struct unpacket_traits<Packet8bf> {
+  typedef bfloat16 type;
+  typedef Packet8bf half;
+  enum {size=8, alignment=Aligned16, vectorizable=true, masked_load_available=false, masked_store_available=false};
+};
 
 // Helper function for bit packing snippet of low precision comparison.
 // It packs the flags from 16x16 to 8x16.
@@ -256,9 +262,6 @@
 template<> EIGEN_STRONG_INLINE Packet8f pload1<Packet8f>(const float*  from) { return _mm256_broadcast_ss(from); }
 template<> EIGEN_STRONG_INLINE Packet4d pload1<Packet4d>(const double* from) { return _mm256_broadcast_sd(from); }
 
-template<> EIGEN_STRONG_INLINE Packet8f plset<Packet8f>(const float& a) { return _mm256_add_ps(_mm256_set1_ps(a), _mm256_set_ps(7.0,6.0,5.0,4.0,3.0,2.0,1.0,0.0)); }
-template<> EIGEN_STRONG_INLINE Packet4d plset<Packet4d>(const double& a) { return _mm256_add_pd(_mm256_set1_pd(a), _mm256_set_pd(3.0,2.0,1.0,0.0)); }
-
 template<> EIGEN_STRONG_INLINE Packet8f padd<Packet8f>(const Packet8f& a, const Packet8f& b) { return _mm256_add_ps(a,b); }
 template<> EIGEN_STRONG_INLINE Packet4d padd<Packet4d>(const Packet4d& a, const Packet4d& b) { return _mm256_add_pd(a,b); }
 template<> EIGEN_STRONG_INLINE Packet8i padd<Packet8i>(const Packet8i& a, const Packet8i& b) {
@@ -271,6 +274,10 @@
 #endif
 }
 
+template<> EIGEN_STRONG_INLINE Packet8f plset<Packet8f>(const float& a) { return padd(pset1<Packet8f>(a), _mm256_set_ps(7.0,6.0,5.0,4.0,3.0,2.0,1.0,0.0)); }
+template<> EIGEN_STRONG_INLINE Packet4d plset<Packet4d>(const double& a) { return padd(pset1<Packet4d>(a), _mm256_set_pd(3.0,2.0,1.0,0.0)); }
+template<> EIGEN_STRONG_INLINE Packet8i plset<Packet8i>(const int& a) { return padd(pset1<Packet8i>(a), _mm256_set_epi32(7,6,5,4,3,2,1,0)); }
+
 template<> EIGEN_STRONG_INLINE Packet8f psub<Packet8f>(const Packet8f& a, const Packet8f& b) { return _mm256_sub_ps(a,b); }
 template<> EIGEN_STRONG_INLINE Packet4d psub<Packet4d>(const Packet4d& a, const Packet4d& b) { return _mm256_sub_pd(a,b); }
 template<> EIGEN_STRONG_INLINE Packet8i psub<Packet8i>(const Packet8i& a, const Packet8i& b) {
@@ -291,6 +298,10 @@
 {
   return _mm256_sub_pd(_mm256_set1_pd(0.0),a);
 }
+template<> EIGEN_STRONG_INLINE Packet8i pnegate(const Packet8i& a)
+{
+  return psub(pzero(a), a);
+}
 
 template<> EIGEN_STRONG_INLINE Packet8f pconj(const Packet8f& a) { return a; }
 template<> EIGEN_STRONG_INLINE Packet4d pconj(const Packet4d& a) { return a; }
@@ -352,7 +363,26 @@
 template<> EIGEN_STRONG_INLINE Packet4d pcmp_lt_or_nan(const Packet4d& a, const Packet4d& b) { return _mm256_cmp_pd(a, b, _CMP_NGE_UQ); }
 template<> EIGEN_STRONG_INLINE Packet4d pcmp_eq(const Packet4d& a, const Packet4d& b) { return _mm256_cmp_pd(a,b,_CMP_EQ_OQ); }
 
-
+template<> EIGEN_STRONG_INLINE Packet8i pcmp_le(const Packet8i& a, const Packet8i& b) {
+#ifdef EIGEN_VECTORIZE_AVX2
+  return _mm256_xor_si256(_mm256_cmpgt_epi32(a,b), _mm256_set1_epi32(-1));
+#else
+  __m128i lo = _mm_cmpgt_epi32(_mm256_extractf128_si256(a, 0), _mm256_extractf128_si256(b, 0));
+  lo = _mm_xor_si128(lo, _mm_set1_epi32(-1));
+  __m128i hi = _mm_cmpgt_epi32(_mm256_extractf128_si256(a, 1), _mm256_extractf128_si256(b, 1));
+  hi = _mm_xor_si128(hi, _mm_set1_epi32(-1));
+  return _mm256_insertf128_si256(_mm256_castsi128_si256(lo), (hi), 1);
+#endif
+}
+template<> EIGEN_STRONG_INLINE Packet8i pcmp_lt(const Packet8i& a, const Packet8i& b) {
+#ifdef EIGEN_VECTORIZE_AVX2
+  return _mm256_cmpgt_epi32(b,a);
+#else
+  __m128i lo = _mm_cmpgt_epi32(_mm256_extractf128_si256(b, 0), _mm256_extractf128_si256(a, 0));
+  __m128i hi = _mm_cmpgt_epi32(_mm256_extractf128_si256(b, 1), _mm256_extractf128_si256(a, 1));
+  return _mm256_insertf128_si256(_mm256_castsi128_si256(lo), (hi), 1);
+#endif
+}
 template<> EIGEN_STRONG_INLINE Packet8i pcmp_eq(const Packet8i& a, const Packet8i& b) {
 #ifdef EIGEN_VECTORIZE_AVX2
   return _mm256_cmpeq_epi32(a,b);
@@ -388,6 +418,15 @@
   return _mm256_min_pd(b,a);
 #endif
 }
+template<> EIGEN_STRONG_INLINE Packet8i pmin<Packet8i>(const Packet8i& a, const Packet8i& b) {
+#ifdef EIGEN_VECTORIZE_AVX2
+  return _mm256_min_epi32(a, b);
+#else
+  __m128i lo = _mm_min_epi32(_mm256_extractf128_si256(a, 0), _mm256_extractf128_si256(b, 0));
+  __m128i hi = _mm_min_epi32(_mm256_extractf128_si256(a, 1), _mm256_extractf128_si256(b, 1));
+  return _mm256_insertf128_si256(_mm256_castsi128_si256(lo), (hi), 1);
+#endif
+}
 
 template<> EIGEN_STRONG_INLINE Packet8f pmax<Packet8f>(const Packet8f& a, const Packet8f& b) {
 #if EIGEN_COMP_GNUC && EIGEN_COMP_GNUC < 63
@@ -411,6 +450,15 @@
   return _mm256_max_pd(b,a);
 #endif
 }
+template<> EIGEN_STRONG_INLINE Packet8i pmax<Packet8i>(const Packet8i& a, const Packet8i& b) {
+#ifdef EIGEN_VECTORIZE_AVX2
+  return _mm256_max_epi32(a, b);
+#else
+  __m128i lo = _mm_max_epi32(_mm256_extractf128_si256(a, 0), _mm256_extractf128_si256(b, 0));
+  __m128i hi = _mm_max_epi32(_mm256_extractf128_si256(a, 1), _mm256_extractf128_si256(b, 1));
+  return _mm256_insertf128_si256(_mm256_castsi128_si256(lo), (hi), 1);
+#endif
+}
 
 // Add specializations for min/max with prescribed NaN progation.
 template<>
@@ -605,12 +653,26 @@
   // then we can perform a consistent permutation on the global register to get everything in shape:
   return  _mm256_permute_ps(tmp, _MM_SHUFFLE(3,3,2,2));
 }
-// Loads 2 doubles from memory a returns the packet {a0, a0  a1, a1}
+// Loads 2 doubles from memory a returns the packet {a0, a0, a1, a1}
 template<> EIGEN_STRONG_INLINE Packet4d ploaddup<Packet4d>(const double* from)
 {
   Packet4d tmp = _mm256_broadcast_pd((const __m128d*)(const void*)from);
   return  _mm256_permute_pd(tmp, 3<<2);
 }
+// Loads 4 integers from memory a returns the packet {a0, a0, a1, a1, a2, a2, a3, a3}
+template<> EIGEN_STRONG_INLINE Packet8i ploaddup<Packet8i>(const int* from)
+{
+#ifdef EIGEN_VECTORIZE_AVX2
+  const Packet8i a = _mm256_castsi128_si256(ploadu<Packet4i>(from));
+  return _mm256_permutevar8x32_epi32(a, _mm256_setr_epi32(0, 0, 1, 1, 2, 2, 3, 3));
+#else
+  __m256 tmp = _mm256_broadcast_ps((const __m128*)(const void*)from);
+  // mimic an "inplace" permutation of the lower 128bits using a blend
+  tmp = _mm256_blend_ps(tmp,_mm256_castps128_ps256(_mm_permute_ps( _mm256_castps256_ps128(tmp), _MM_SHUFFLE(1,0,1,0))), 15);
+  // then we can perform a consistent permutation on the global register to get everything in shape:
+  return  _mm256_castps_si256(_mm256_permute_ps(tmp, _MM_SHUFFLE(3,3,2,2)));
+#endif
+}
 
 // Loads 2 floats from memory a returns the packet {a0, a0  a0, a0, a1, a1, a1, a1}
 template<> EIGEN_STRONG_INLINE Packet8f ploadquad<Packet8f>(const float* from)
@@ -618,6 +680,10 @@
   Packet8f tmp = _mm256_castps128_ps256(_mm_broadcast_ss(from));
   return _mm256_insertf128_ps(tmp, _mm_broadcast_ss(from+1), 1);
 }
+template<> EIGEN_STRONG_INLINE Packet8i ploadquad<Packet8i>(const int* from)
+{
+  return _mm256_insertf128_si256(_mm256_set1_epi32(*from), _mm_set1_epi32(*(from+1)), 1);
+}
 
 template<> EIGEN_STRONG_INLINE void pstore<float>(float*   to, const Packet8f& from) { EIGEN_DEBUG_ALIGNED_STORE _mm256_store_ps(to, from); }
 template<> EIGEN_STRONG_INLINE void pstore<double>(double* to, const Packet4d& from) { EIGEN_DEBUG_ALIGNED_STORE _mm256_store_pd(to, from); }
@@ -646,6 +712,11 @@
 {
   return _mm256_set_pd(from[3*stride], from[2*stride], from[1*stride], from[0*stride]);
 }
+template<> EIGEN_DEVICE_FUNC inline Packet8i pgather<int, Packet8i>(const int* from, Index stride)
+{
+  return _mm256_set_epi32(from[7*stride], from[6*stride], from[5*stride], from[4*stride],
+                          from[3*stride], from[2*stride], from[1*stride], from[0*stride]);
+}
 
 template<> EIGEN_DEVICE_FUNC inline void pscatter<float, Packet8f>(float* to, const Packet8f& from, Index stride)
 {
@@ -670,6 +741,20 @@
   to[stride*2] = _mm_cvtsd_f64(high);
   to[stride*3] = _mm_cvtsd_f64(_mm_shuffle_pd(high, high, 1));
 }
+template<> EIGEN_DEVICE_FUNC inline void pscatter<int, Packet8i>(int* to, const Packet8i& from, Index stride)
+{
+  __m128i low = _mm256_extractf128_si256(from, 0);
+  to[stride*0] = _mm_extract_epi32(low, 0);
+  to[stride*1] = _mm_extract_epi32(low, 1);
+  to[stride*2] = _mm_extract_epi32(low, 2);
+  to[stride*3] = _mm_extract_epi32(low, 3);
+
+  __m128i high = _mm256_extractf128_si256(from, 1);
+  to[stride*4] = _mm_extract_epi32(high, 0);
+  to[stride*5] = _mm_extract_epi32(high, 1);
+  to[stride*6] = _mm_extract_epi32(high, 2);
+  to[stride*7] = _mm_extract_epi32(high, 3);
+}
 
 template<> EIGEN_STRONG_INLINE void pstore1<Packet8f>(float* to, const float& a)
 {
@@ -720,6 +805,10 @@
     return _mm256_permute_pd(swap_halves,5);
   #endif
 }
+template<> EIGEN_STRONG_INLINE Packet8i preverse(const Packet8i& a)
+{
+  return _mm256_castps_si256(preverse(_mm256_castsi256_ps(a)));
+}
 
 // pabs should be ok
 template<> EIGEN_STRONG_INLINE Packet8f pabs(const Packet8f& a)
@@ -732,6 +821,16 @@
   const Packet4d mask = _mm256_castsi256_pd(_mm256_setr_epi32(0xFFFFFFFF,0x7FFFFFFF,0xFFFFFFFF,0x7FFFFFFF,0xFFFFFFFF,0x7FFFFFFF,0xFFFFFFFF,0x7FFFFFFF));
   return _mm256_and_pd(a,mask);
 }
+template<> EIGEN_STRONG_INLINE Packet8i pabs(const Packet8i& a)
+{
+#ifdef EIGEN_VECTORIZE_AVX2
+  return _mm256_abs_epi32(a);
+#else
+  __m128i lo = _mm_abs_epi32(_mm256_extractf128_si256(a, 0));
+  __m128i hi = _mm_abs_epi32(_mm256_extractf128_si256(a, 1));
+  return _mm256_insertf128_si256(_mm256_castsi128_si256(lo), (hi), 1);
+#endif
+}
 
 template<> EIGEN_STRONG_INLINE Packet8f pfrexp<Packet8f>(const Packet8f& a, Packet8f& exponent) {
   return pfrexp_generic(a,exponent);
@@ -803,11 +902,19 @@
 {
   return predux(Packet2d(_mm_add_pd(_mm256_castpd256_pd128(a),_mm256_extractf128_pd(a,1))));
 }
+template<> EIGEN_STRONG_INLINE int predux<Packet8i>(const Packet8i& a)
+{
+  return predux(Packet4i(_mm_add_epi32(_mm256_castsi256_si128(a),_mm256_extractf128_si256(a,1))));
+}
 
 template<> EIGEN_STRONG_INLINE Packet4f predux_half_dowto4<Packet8f>(const Packet8f& a)
 {
   return _mm_add_ps(_mm256_castps256_ps128(a),_mm256_extractf128_ps(a,1));
 }
+template<> EIGEN_STRONG_INLINE Packet4i predux_half_dowto4<Packet8i>(const Packet8i& a)
+{
+  return _mm_add_epi32(_mm256_castsi256_si128(a),_mm256_extractf128_si256(a,1));
+}
 
 template<> EIGEN_STRONG_INLINE float predux_mul<Packet8f>(const Packet8f& a)
 {
@@ -905,6 +1012,66 @@
   kernel.packet[3] = _mm256_permute2f128_ps(S2, S3, 0x31);
 }
 
+#define MM256_SHUFFLE_EPI32(A, B, M) \
+  _mm256_castps_si256(_mm256_shuffle_ps(_mm256_castsi256_ps(A), _mm256_castsi256_ps(B), M))
+
+#ifndef EIGEN_VECTORIZE_AVX2
+#define MM256_UNPACKLO_EPI32(A, B) \
+  _mm256_castps_si256(_mm256_unpacklo_ps(_mm256_castsi256_ps(A), _mm256_castsi256_ps(B)))
+#define MM256_UNPACKHI_EPI32(A, B) \
+  _mm256_castps_si256(_mm256_unpackhi_ps(_mm256_castsi256_ps(A), _mm256_castsi256_ps(B)))
+#else
+#define MM256_UNPACKLO_EPI32(A, B) _mm256_unpacklo_epi32(A, B)
+#define MM256_UNPACKHI_EPI32(A, B) _mm256_unpackhi_epi32(A, B)
+#endif
+
+
+EIGEN_DEVICE_FUNC inline void
+ptranspose(PacketBlock<Packet8i,8>& kernel) {
+  __m256i T0 = MM256_UNPACKLO_EPI32(kernel.packet[0], kernel.packet[1]);
+  __m256i T1 = MM256_UNPACKHI_EPI32(kernel.packet[0], kernel.packet[1]);
+  __m256i T2 = MM256_UNPACKLO_EPI32(kernel.packet[2], kernel.packet[3]);
+  __m256i T3 = MM256_UNPACKHI_EPI32(kernel.packet[2], kernel.packet[3]);
+  __m256i T4 = MM256_UNPACKLO_EPI32(kernel.packet[4], kernel.packet[5]);
+  __m256i T5 = MM256_UNPACKHI_EPI32(kernel.packet[4], kernel.packet[5]);
+  __m256i T6 = MM256_UNPACKLO_EPI32(kernel.packet[6], kernel.packet[7]);
+  __m256i T7 = MM256_UNPACKHI_EPI32(kernel.packet[6], kernel.packet[7]);
+  __m256i S0 = MM256_SHUFFLE_EPI32(T0,T2,_MM_SHUFFLE(1,0,1,0));
+  __m256i S1 = MM256_SHUFFLE_EPI32(T0,T2,_MM_SHUFFLE(3,2,3,2));
+  __m256i S2 = MM256_SHUFFLE_EPI32(T1,T3,_MM_SHUFFLE(1,0,1,0));
+  __m256i S3 = MM256_SHUFFLE_EPI32(T1,T3,_MM_SHUFFLE(3,2,3,2));
+  __m256i S4 = MM256_SHUFFLE_EPI32(T4,T6,_MM_SHUFFLE(1,0,1,0));
+  __m256i S5 = MM256_SHUFFLE_EPI32(T4,T6,_MM_SHUFFLE(3,2,3,2));
+  __m256i S6 = MM256_SHUFFLE_EPI32(T5,T7,_MM_SHUFFLE(1,0,1,0));
+  __m256i S7 = MM256_SHUFFLE_EPI32(T5,T7,_MM_SHUFFLE(3,2,3,2));
+  kernel.packet[0] = _mm256_permute2f128_si256(S0, S4, 0x20);
+  kernel.packet[1] = _mm256_permute2f128_si256(S1, S5, 0x20);
+  kernel.packet[2] = _mm256_permute2f128_si256(S2, S6, 0x20);
+  kernel.packet[3] = _mm256_permute2f128_si256(S3, S7, 0x20);
+  kernel.packet[4] = _mm256_permute2f128_si256(S0, S4, 0x31);
+  kernel.packet[5] = _mm256_permute2f128_si256(S1, S5, 0x31);
+  kernel.packet[6] = _mm256_permute2f128_si256(S2, S6, 0x31);
+  kernel.packet[7] = _mm256_permute2f128_si256(S3, S7, 0x31);
+}
+
+EIGEN_DEVICE_FUNC inline void
+ptranspose(PacketBlock<Packet8i,4>& kernel) {
+  __m256i T0 = MM256_UNPACKLO_EPI32(kernel.packet[0], kernel.packet[1]);
+  __m256i T1 = MM256_UNPACKHI_EPI32(kernel.packet[0], kernel.packet[1]);
+  __m256i T2 = MM256_UNPACKLO_EPI32(kernel.packet[2], kernel.packet[3]);
+  __m256i T3 = MM256_UNPACKHI_EPI32(kernel.packet[2], kernel.packet[3]);
+
+  __m256i S0 = MM256_SHUFFLE_EPI32(T0,T2,_MM_SHUFFLE(1,0,1,0));
+  __m256i S1 = MM256_SHUFFLE_EPI32(T0,T2,_MM_SHUFFLE(3,2,3,2));
+  __m256i S2 = MM256_SHUFFLE_EPI32(T1,T3,_MM_SHUFFLE(1,0,1,0));
+  __m256i S3 = MM256_SHUFFLE_EPI32(T1,T3,_MM_SHUFFLE(3,2,3,2));
+
+  kernel.packet[0] = _mm256_permute2f128_si256(S0, S1, 0x20);
+  kernel.packet[1] = _mm256_permute2f128_si256(S2, S3, 0x20);
+  kernel.packet[2] = _mm256_permute2f128_si256(S0, S1, 0x31);
+  kernel.packet[3] = _mm256_permute2f128_si256(S2, S3, 0x31);
+}
+
 EIGEN_DEVICE_FUNC inline void
 ptranspose(PacketBlock<Packet4d,4>& kernel) {
   __m256d T0 = _mm256_shuffle_pd(kernel.packet[0], kernel.packet[1], 15);
@@ -1274,12 +1441,7 @@
 EIGEN_STRONG_INLINE Packet8bf F32ToBf16(const Packet8f& a) {
   Packet8bf r;
 
-  // Flush input denormals value to zero with hardware capability.
-  _MM_SET_DENORMALS_ZERO_MODE(_MM_DENORMALS_ZERO_ON);
-  __m256 flush = _mm256_and_ps(a, a);
-  _MM_SET_DENORMALS_ZERO_MODE(_MM_DENORMALS_ZERO_OFF);
-
-  __m256i input = _mm256_castps_si256(flush);
+  __m256i input = _mm256_castps_si256(a);
 
 #ifdef EIGEN_VECTORIZE_AVX2
   // uint32_t lsb = (input >> 16);
@@ -1293,7 +1455,7 @@
   // input = input >> 16;
   t = _mm256_srli_epi32(t, 16);
   // Check NaN before converting back to bf16
-  __m256 mask = _mm256_cmp_ps(flush, flush, _CMP_ORD_Q);
+  __m256 mask = _mm256_cmp_ps(a, a, _CMP_ORD_Q);
   __m256i nan = _mm256_set1_epi32(0x7fc0);
   t = _mm256_blendv_epi8(nan, t, _mm256_castps_si256(mask));
   // output = numext::bit_cast<uint16_t>(input);
@@ -1316,7 +1478,7 @@
   lo = _mm_srli_epi32(lo, 16);
   hi = _mm_srli_epi32(hi, 16);
   // Check NaN before converting back to bf16
-  __m256 mask = _mm256_cmp_ps(flush, flush, _CMP_ORD_Q);
+  __m256 mask = _mm256_cmp_ps(a, a, _CMP_ORD_Q);
   __m128i nan = _mm_set1_epi32(0x7fc0);
   lo = _mm_blendv_epi8(nan, lo, _mm_castps_si128(_mm256_castps256_ps128(mask)));
   hi = _mm_blendv_epi8(nan, hi, _mm_castps_si128(_mm256_extractf128_ps(mask, 1)));
diff --git a/Eigen/src/Core/arch/AVX512/PacketMath.h b/Eigen/src/Core/arch/AVX512/PacketMath.h
index 59bbef0..0810f66 100644
--- a/Eigen/src/Core/arch/AVX512/PacketMath.h
+++ b/Eigen/src/Core/arch/AVX512/PacketMath.h
@@ -153,17 +153,16 @@
   };
 };
 
-/* TODO Implement AVX512 for integers
-template<> struct packet_traits<int>    : default_packet_traits
+template<> struct packet_traits<int> : default_packet_traits
 {
   typedef Packet16i type;
+  typedef Packet8i half;
   enum {
     Vectorizable = 1,
     AlignedOnScalar = 1,
-    size=8
+    size=16
   };
 };
-*/
 
 template <>
 struct unpacket_traits<Packet16f> {
@@ -183,7 +182,7 @@
 struct unpacket_traits<Packet16i> {
   typedef int type;
   typedef Packet8i half;
-  enum { size = 16, alignment=Aligned64, vectorizable=false, masked_load_available=false, masked_store_available=false };
+  enum { size = 16, alignment=Aligned64, vectorizable=true, masked_load_available=false, masked_store_available=false };
 };
 
 template<>
@@ -254,6 +253,12 @@
   return _mm512_add_pd(_mm512_set1_pd(a),
                        _mm512_set_pd(7.0, 6.0, 5.0, 4.0, 3.0, 2.0, 1.0, 0.0));
 }
+template <>
+EIGEN_STRONG_INLINE Packet16i plset<Packet16i>(const int& a) {
+  return _mm512_add_epi32(
+      _mm512_set1_epi32(a),
+      _mm512_set_epi32(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0));
+}
 
 template <>
 EIGEN_STRONG_INLINE Packet16f padd<Packet16f>(const Packet16f& a,
@@ -295,6 +300,10 @@
 EIGEN_STRONG_INLINE Packet8d pnegate(const Packet8d& a) {
   return _mm512_sub_pd(_mm512_set1_pd(0.0), a);
 }
+template <>
+EIGEN_STRONG_INLINE Packet16i pnegate(const Packet16i& a) {
+  return _mm512_sub_epi32(_mm512_set1_epi32(0), a);
+}
 
 template <>
 EIGEN_STRONG_INLINE Packet16f pconj(const Packet16f& a) {
@@ -379,6 +388,11 @@
   // Arguments are reversed to match NaN propagation behavior of std::min.
   return _mm512_min_pd(b, a);
 }
+template <>
+EIGEN_STRONG_INLINE Packet16i pmin<Packet16i>(const Packet16i& a,
+                                              const Packet16i& b) {
+  return _mm512_min_epi32(b, a);
+}
 
 template <>
 EIGEN_STRONG_INLINE Packet16f pmax<Packet16f>(const Packet16f& a,
@@ -392,6 +406,11 @@
   // Arguments are reversed to match NaN propagation behavior of std::max.
   return _mm512_max_pd(b, a);
 }
+template <>
+EIGEN_STRONG_INLINE Packet16i pmax<Packet16i>(const Packet16i& a,
+                                              const Packet16i& b) {
+  return _mm512_max_epi32(b, a);
+}
 
 // Add specializations for min/max with prescribed NaN progation.
 template<>
@@ -493,10 +512,17 @@
 }
 
 template<> EIGEN_STRONG_INLINE Packet16i pcmp_eq(const Packet16i& a, const Packet16i& b) {
-  __mmask16 mask = _mm512_cmp_epi32_mask(a, b, _CMP_EQ_OQ);
+  __mmask16 mask = _mm512_cmp_epi32_mask(a, b, _MM_CMPINT_EQ);
   return _mm512_mask_set1_epi32(_mm512_set1_epi32(0), mask, 0xffffffffu);
 }
-
+template<> EIGEN_STRONG_INLINE Packet16i pcmp_le(const Packet16i& a, const Packet16i& b) {
+  __mmask16 mask = _mm512_cmp_epi32_mask(a, b, _MM_CMPINT_LE);
+  return _mm512_mask_set1_epi32(_mm512_set1_epi32(0), mask, 0xffffffffu);
+}
+template<> EIGEN_STRONG_INLINE Packet16i pcmp_lt(const Packet16i& a, const Packet16i& b) {
+  __mmask16 mask = _mm512_cmp_epi32_mask(a, b, _MM_CMPINT_LT);
+  return _mm512_mask_set1_epi32(_mm512_set1_epi32(0), mask, 0xffffffffu);
+}
 
 template <>
 EIGEN_STRONG_INLINE Packet8d pcmp_eq(const Packet8d& a, const Packet8d& b) {
@@ -746,6 +772,16 @@
 }
 #endif
 
+// Loads 8 integers from memory and returns the packet
+// {a0, a0  a1, a1, a2, a2, a3, a3, a4, a4, a5, a5, a6, a6, a7, a7}
+template <>
+EIGEN_STRONG_INLINE Packet16i ploaddup<Packet16i>(const int* from) {
+  __m256i low_half = _mm256_loadu_si256(reinterpret_cast<const __m256i*>(from));
+  __m512 even_elements = _mm512_castsi512_ps(_mm512_cvtepu32_epi64(low_half));
+  __m512 pairs = _mm512_permute_ps(even_elements, _MM_SHUFFLE(2, 2, 0, 0));
+  return _mm512_castps_si512(pairs);
+}
+
 // Loads 4 floats from memory a returns the packet
 // {a0, a0  a0, a0, a1, a1, a1, a1, a2, a2, a2, a2, a3, a3, a3, a3}
 template <>
@@ -766,6 +802,15 @@
   return _mm512_insertf64x4(tmp, lane1, 1);
 }
 
+// Loads 4 integers from memory and returns the packet
+// {a0, a0  a0, a0, a1, a1, a1, a1, a2, a2, a2, a2, a3, a3, a3, a3}
+template <>
+EIGEN_STRONG_INLINE Packet16i ploadquad<Packet16i>(const int* from) {
+  Packet16i tmp = _mm512_castsi128_si512(ploadu<Packet4i>(from));
+  const Packet16i scatter_mask = _mm512_set_epi32(3,3,3,3, 2,2,2,2, 1,1,1,1, 0,0,0,0);
+  return _mm512_permutexvar_epi32(scatter_mask, tmp);
+}
+
 template <>
 EIGEN_STRONG_INLINE void pstore<float>(float* to, const Packet16f& from) {
   EIGEN_DEBUG_ALIGNED_STORE _mm512_store_ps(to, from);
@@ -818,6 +863,15 @@
 
   return _mm512_i32gather_pd(indices, from, 8);
 }
+template <>
+EIGEN_DEVICE_FUNC inline Packet16i pgather<int, Packet16i>(const int* from,
+                                                           Index stride) {
+  Packet16i stride_vector = _mm512_set1_epi32(convert_index<int>(stride));
+  Packet16i stride_multiplier =
+      _mm512_set_epi32(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
+  Packet16i indices = _mm512_mullo_epi32(stride_vector, stride_multiplier);
+  return _mm512_i32gather_epi32(indices, from, 4);
+}
 
 template <>
 EIGEN_DEVICE_FUNC inline void pscatter<float, Packet16f>(float* to,
@@ -838,6 +892,16 @@
   Packet8i indices = _mm256_mullo_epi32(stride_vector, stride_multiplier);
   _mm512_i32scatter_pd(to, indices, from, 8);
 }
+template <>
+EIGEN_DEVICE_FUNC inline void pscatter<int, Packet16i>(int* to,
+                                                       const Packet16i& from,
+                                                       Index stride) {
+  Packet16i stride_vector = _mm512_set1_epi32(convert_index<int>(stride));
+  Packet16i stride_multiplier =
+      _mm512_set_epi32(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
+  Packet16i indices = _mm512_mullo_epi32(stride_vector, stride_multiplier);
+  _mm512_i32scatter_epi32(to, indices, from, 4);
+}
 
 template <>
 EIGEN_STRONG_INLINE void pstore1<Packet16f>(float* to, const float& a) {
@@ -882,6 +946,11 @@
   return _mm512_permutexvar_pd(_mm512_set_epi32(0, 0, 0, 1, 0, 2, 0, 3, 0, 4, 0, 5, 0, 6, 0, 7), a);
 }
 
+template<> EIGEN_STRONG_INLINE Packet16i preverse(const Packet16i& a)
+{
+  return _mm512_permutexvar_epi32(_mm512_set_epi32(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15), a);
+}
+
 template<> EIGEN_STRONG_INLINE Packet16f pabs(const Packet16f& a)
 {
   // _mm512_abs_ps intrinsic not found, so hack around it
@@ -893,6 +962,10 @@
   return _mm512_castsi512_pd(_mm512_and_si512(_mm512_castpd_si512(a),
                                    _mm512_set1_epi64(0x7fffffffffffffff)));
 }
+template<> EIGEN_STRONG_INLINE Packet16i pabs(const Packet16i& a)
+{
+  return _mm512_abs_epi32(a);
+}
 
 template<>
 EIGEN_STRONG_INLINE Packet16f pfrexp<Packet16f>(const Packet16f& a, Packet16f& exponent){
@@ -952,6 +1025,11 @@
 #define EIGEN_EXTRACT_8f_FROM_16f(INPUT, OUTPUT)                           \
   __m256 OUTPUT##_0 = _mm512_extractf32x8_ps(INPUT, 0);                    \
   __m256 OUTPUT##_1 = _mm512_extractf32x8_ps(INPUT, 1)
+
+// AVX512F does not define _mm512_extracti32x8_epi32 to extract _m256i from _m512i
+#define EIGEN_EXTRACT_8i_FROM_16i(INPUT, OUTPUT)                           \
+  __m256i OUTPUT##_0 = _mm512_extracti32x8_epi32(INPUT, 0);                \
+  __m256i OUTPUT##_1 = _mm512_extracti32x8_epi32(INPUT, 1) 
 #else
 #define EIGEN_EXTRACT_8f_FROM_16f(INPUT, OUTPUT)                \
   __m256 OUTPUT##_0 = _mm256_insertf128_ps(                     \
@@ -959,12 +1037,23 @@
       _mm512_extractf32x4_ps(INPUT, 1), 1);                     \
   __m256 OUTPUT##_1 = _mm256_insertf128_ps(                     \
       _mm256_castps128_ps256(_mm512_extractf32x4_ps(INPUT, 2)), \
-      _mm512_extractf32x4_ps(INPUT, 3), 1);
+      _mm512_extractf32x4_ps(INPUT, 3), 1)
+
+#define EIGEN_EXTRACT_8i_FROM_16i(INPUT, OUTPUT)                    \
+  __m256i OUTPUT##_0 = _mm256_insertf128_si256(                     \
+      _mm256_castsi128_si256(_mm512_extracti32x4_epi32(INPUT, 0)),  \
+      _mm512_extracti32x4_epi32(INPUT, 1), 1);                      \
+  __m256i OUTPUT##_1 = _mm256_insertf128_si256(                     \
+      _mm256_castsi128_si256(_mm512_extracti32x4_epi32(INPUT, 2)),  \
+      _mm512_extracti32x4_epi32(INPUT, 3), 1)
 #endif
 
 #ifdef EIGEN_VECTORIZE_AVX512DQ
 #define EIGEN_INSERT_8f_INTO_16f(OUTPUT, INPUTA, INPUTB) \
   OUTPUT = _mm512_insertf32x8(_mm512_castps256_ps512(INPUTA), INPUTB, 1);
+
+#define EIGEN_INSERT_8i_INTO_16i(OUTPUT, INPUTA, INPUTB) \
+  OUTPUT = _mm512_inserti32x8(_mm512_castsi256_si512(INPUTA), INPUTB, 1);
 #else
 #define EIGEN_INSERT_8f_INTO_16f(OUTPUT, INPUTA, INPUTB)                    \
   OUTPUT = _mm512_undefined_ps();                                           \
@@ -972,6 +1061,13 @@
   OUTPUT = _mm512_insertf32x4(OUTPUT, _mm256_extractf128_ps(INPUTA, 1), 1); \
   OUTPUT = _mm512_insertf32x4(OUTPUT, _mm256_extractf128_ps(INPUTB, 0), 2); \
   OUTPUT = _mm512_insertf32x4(OUTPUT, _mm256_extractf128_ps(INPUTB, 1), 3);
+
+#define EIGEN_INSERT_8i_INTO_16i(OUTPUT, INPUTA, INPUTB)                    \
+  OUTPUT = _mm512_undefined_epi32();                                           \
+  OUTPUT = _mm512_inserti32x4(OUTPUT, _mm256_extractf128_si256(INPUTA, 0), 0); \
+  OUTPUT = _mm512_inserti32x4(OUTPUT, _mm256_extractf128_si256(INPUTA, 1), 1); \
+  OUTPUT = _mm512_inserti32x4(OUTPUT, _mm256_extractf128_si256(INPUTB, 0), 2); \
+  OUTPUT = _mm512_inserti32x4(OUTPUT, _mm256_extractf128_si256(INPUTB, 1), 3);
 #endif
 
 template <>
@@ -1000,6 +1096,24 @@
   __m256d tmp0 = _mm256_hadd_pd(sum, _mm256_permute2f128_pd(sum, sum, 1));
   return _mm_cvtsd_f64(_mm256_castpd256_pd128(_mm256_hadd_pd(tmp0, tmp0)));
 }
+template <>
+EIGEN_STRONG_INLINE int predux<Packet16i>(const Packet16i& a) {
+#ifdef EIGEN_VECTORIZE_AVX512DQ
+  __m256i lane0 = _mm512_extracti32x8_epi32(a, 0);
+  __m256i lane1 = _mm512_extracti32x8_epi32(a, 1);
+  Packet8i x = _mm256_add_epi32(lane0, lane1);
+  return predux<Packet8i>(x);
+#else
+  __m128i lane0 = _mm512_extracti32x4_epi32(a, 0);
+  __m128i lane1 = _mm512_extracti32x4_epi32(a, 1);
+  __m128i lane2 = _mm512_extracti32x4_epi32(a, 2);
+  __m128i lane3 = _mm512_extracti32x4_epi32(a, 3);
+  __m128i sum = _mm_add_epi32(_mm_add_epi32(lane0, lane1), _mm_add_epi32(lane2, lane3));
+  sum = _mm_hadd_epi32(sum, sum);
+  sum = _mm_hadd_epi32(sum, _mm_castps_si128(_mm_permute_ps(_mm_castsi128_ps(sum), 1)));
+  return _mm_cvtsi128_si32(sum);
+#endif
+}
 
 template <>
 EIGEN_STRONG_INLINE Packet8f predux_half_dowto4<Packet16f>(const Packet16f& a) {
@@ -1023,6 +1137,22 @@
   __m256d lane1 = _mm512_extractf64x4_pd(a, 1);
   return _mm256_add_pd(lane0, lane1);
 }
+template <>
+EIGEN_STRONG_INLINE Packet8i predux_half_dowto4<Packet16i>(const Packet16i& a) {
+#ifdef EIGEN_VECTORIZE_AVX512DQ
+  __m256i lane0 = _mm512_extracti32x8_epi32(a, 0);
+  __m256i lane1 = _mm512_extracti32x8_epi32(a, 1);
+  return _mm256_add_epi32(lane0, lane1);
+#else
+  __m128i lane0 = _mm512_extracti32x4_epi32(a, 0);
+  __m128i lane1 = _mm512_extracti32x4_epi32(a, 1);
+  __m128i lane2 = _mm512_extracti32x4_epi32(a, 2);
+  __m128i lane3 = _mm512_extracti32x4_epi32(a, 3);
+  __m128i sum0 = _mm_add_epi32(lane0, lane2);
+  __m128i sum1 = _mm_add_epi32(lane1, lane3);
+  return _mm256_inserti128_si256(_mm256_castsi128_si256(sum0), sum1, 1);
+#endif
+}
 
 template <>
 EIGEN_STRONG_INLINE float predux_mul<Packet16f>(const Packet16f& a) {
@@ -1352,6 +1482,163 @@
   PACK_OUTPUT_SQ_D(kernel.packet, tmp.packet, 6, 8);
   PACK_OUTPUT_SQ_D(kernel.packet, tmp.packet, 7, 8);
 }
+
+#define PACK_OUTPUT_I32(OUTPUT, INPUT, INDEX, STRIDE) \
+  EIGEN_INSERT_8i_INTO_16i(OUTPUT[INDEX], INPUT[INDEX], INPUT[INDEX + STRIDE]);
+
+#define PACK_OUTPUT_I32_2(OUTPUT, INPUT, INDEX, STRIDE)     \
+  EIGEN_INSERT_8i_INTO_16i(OUTPUT[INDEX], INPUT[2 * INDEX], \
+                           INPUT[2 * INDEX + STRIDE]);
+
+#define SHUFFLE_EPI32(A, B, M) \
+  _mm512_castps_si512(_mm512_shuffle_ps(_mm512_castsi512_ps(A), _mm512_castsi512_ps(B), M))
+
+EIGEN_DEVICE_FUNC inline void ptranspose(PacketBlock<Packet16i, 16>& kernel) {
+  __m512i T0 = _mm512_unpacklo_epi32(kernel.packet[0], kernel.packet[1]);
+  __m512i T1 = _mm512_unpackhi_epi32(kernel.packet[0], kernel.packet[1]);
+  __m512i T2 = _mm512_unpacklo_epi32(kernel.packet[2], kernel.packet[3]);
+  __m512i T3 = _mm512_unpackhi_epi32(kernel.packet[2], kernel.packet[3]);
+  __m512i T4 = _mm512_unpacklo_epi32(kernel.packet[4], kernel.packet[5]);
+  __m512i T5 = _mm512_unpackhi_epi32(kernel.packet[4], kernel.packet[5]);
+  __m512i T6 = _mm512_unpacklo_epi32(kernel.packet[6], kernel.packet[7]);
+  __m512i T7 = _mm512_unpackhi_epi32(kernel.packet[6], kernel.packet[7]);
+  __m512i T8 = _mm512_unpacklo_epi32(kernel.packet[8], kernel.packet[9]);
+  __m512i T9 = _mm512_unpackhi_epi32(kernel.packet[8], kernel.packet[9]);
+  __m512i T10 = _mm512_unpacklo_epi32(kernel.packet[10], kernel.packet[11]);
+  __m512i T11 = _mm512_unpackhi_epi32(kernel.packet[10], kernel.packet[11]);
+  __m512i T12 = _mm512_unpacklo_epi32(kernel.packet[12], kernel.packet[13]);
+  __m512i T13 = _mm512_unpackhi_epi32(kernel.packet[12], kernel.packet[13]);
+  __m512i T14 = _mm512_unpacklo_epi32(kernel.packet[14], kernel.packet[15]);
+  __m512i T15 = _mm512_unpackhi_epi32(kernel.packet[14], kernel.packet[15]);
+  __m512i S0 = SHUFFLE_EPI32(T0, T2, _MM_SHUFFLE(1, 0, 1, 0));
+  __m512i S1 = SHUFFLE_EPI32(T0, T2, _MM_SHUFFLE(3, 2, 3, 2));
+  __m512i S2 = SHUFFLE_EPI32(T1, T3, _MM_SHUFFLE(1, 0, 1, 0));
+  __m512i S3 = SHUFFLE_EPI32(T1, T3, _MM_SHUFFLE(3, 2, 3, 2));
+  __m512i S4 = SHUFFLE_EPI32(T4, T6, _MM_SHUFFLE(1, 0, 1, 0));
+  __m512i S5 = SHUFFLE_EPI32(T4, T6, _MM_SHUFFLE(3, 2, 3, 2));
+  __m512i S6 = SHUFFLE_EPI32(T5, T7, _MM_SHUFFLE(1, 0, 1, 0));
+  __m512i S7 = SHUFFLE_EPI32(T5, T7, _MM_SHUFFLE(3, 2, 3, 2));
+  __m512i S8 = SHUFFLE_EPI32(T8, T10, _MM_SHUFFLE(1, 0, 1, 0));
+  __m512i S9 = SHUFFLE_EPI32(T8, T10, _MM_SHUFFLE(3, 2, 3, 2));
+  __m512i S10 = SHUFFLE_EPI32(T9, T11, _MM_SHUFFLE(1, 0, 1, 0));
+  __m512i S11 = SHUFFLE_EPI32(T9, T11, _MM_SHUFFLE(3, 2, 3, 2));
+  __m512i S12 = SHUFFLE_EPI32(T12, T14, _MM_SHUFFLE(1, 0, 1, 0));
+  __m512i S13 = SHUFFLE_EPI32(T12, T14, _MM_SHUFFLE(3, 2, 3, 2));
+  __m512i S14 = SHUFFLE_EPI32(T13, T15, _MM_SHUFFLE(1, 0, 1, 0));
+  __m512i S15 = SHUFFLE_EPI32(T13, T15, _MM_SHUFFLE(3, 2, 3, 2));
+
+  EIGEN_EXTRACT_8i_FROM_16i(S0, S0);
+  EIGEN_EXTRACT_8i_FROM_16i(S1, S1);
+  EIGEN_EXTRACT_8i_FROM_16i(S2, S2);
+  EIGEN_EXTRACT_8i_FROM_16i(S3, S3);
+  EIGEN_EXTRACT_8i_FROM_16i(S4, S4);
+  EIGEN_EXTRACT_8i_FROM_16i(S5, S5);
+  EIGEN_EXTRACT_8i_FROM_16i(S6, S6);
+  EIGEN_EXTRACT_8i_FROM_16i(S7, S7);
+  EIGEN_EXTRACT_8i_FROM_16i(S8, S8);
+  EIGEN_EXTRACT_8i_FROM_16i(S9, S9);
+  EIGEN_EXTRACT_8i_FROM_16i(S10, S10);
+  EIGEN_EXTRACT_8i_FROM_16i(S11, S11);
+  EIGEN_EXTRACT_8i_FROM_16i(S12, S12);
+  EIGEN_EXTRACT_8i_FROM_16i(S13, S13);
+  EIGEN_EXTRACT_8i_FROM_16i(S14, S14);
+  EIGEN_EXTRACT_8i_FROM_16i(S15, S15);
+
+  PacketBlock<Packet8i, 32> tmp;
+
+  tmp.packet[0] = _mm256_permute2f128_si256(S0_0, S4_0, 0x20);
+  tmp.packet[1] = _mm256_permute2f128_si256(S1_0, S5_0, 0x20);
+  tmp.packet[2] = _mm256_permute2f128_si256(S2_0, S6_0, 0x20);
+  tmp.packet[3] = _mm256_permute2f128_si256(S3_0, S7_0, 0x20);
+  tmp.packet[4] = _mm256_permute2f128_si256(S0_0, S4_0, 0x31);
+  tmp.packet[5] = _mm256_permute2f128_si256(S1_0, S5_0, 0x31);
+  tmp.packet[6] = _mm256_permute2f128_si256(S2_0, S6_0, 0x31);
+  tmp.packet[7] = _mm256_permute2f128_si256(S3_0, S7_0, 0x31);
+
+  tmp.packet[8] = _mm256_permute2f128_si256(S0_1, S4_1, 0x20);
+  tmp.packet[9] = _mm256_permute2f128_si256(S1_1, S5_1, 0x20);
+  tmp.packet[10] = _mm256_permute2f128_si256(S2_1, S6_1, 0x20);
+  tmp.packet[11] = _mm256_permute2f128_si256(S3_1, S7_1, 0x20);
+  tmp.packet[12] = _mm256_permute2f128_si256(S0_1, S4_1, 0x31);
+  tmp.packet[13] = _mm256_permute2f128_si256(S1_1, S5_1, 0x31);
+  tmp.packet[14] = _mm256_permute2f128_si256(S2_1, S6_1, 0x31);
+  tmp.packet[15] = _mm256_permute2f128_si256(S3_1, S7_1, 0x31);
+
+  // Second set of _m256 outputs
+  tmp.packet[16] = _mm256_permute2f128_si256(S8_0, S12_0, 0x20);
+  tmp.packet[17] = _mm256_permute2f128_si256(S9_0, S13_0, 0x20);
+  tmp.packet[18] = _mm256_permute2f128_si256(S10_0, S14_0, 0x20);
+  tmp.packet[19] = _mm256_permute2f128_si256(S11_0, S15_0, 0x20);
+  tmp.packet[20] = _mm256_permute2f128_si256(S8_0, S12_0, 0x31);
+  tmp.packet[21] = _mm256_permute2f128_si256(S9_0, S13_0, 0x31);
+  tmp.packet[22] = _mm256_permute2f128_si256(S10_0, S14_0, 0x31);
+  tmp.packet[23] = _mm256_permute2f128_si256(S11_0, S15_0, 0x31);
+
+  tmp.packet[24] = _mm256_permute2f128_si256(S8_1, S12_1, 0x20);
+  tmp.packet[25] = _mm256_permute2f128_si256(S9_1, S13_1, 0x20);
+  tmp.packet[26] = _mm256_permute2f128_si256(S10_1, S14_1, 0x20);
+  tmp.packet[27] = _mm256_permute2f128_si256(S11_1, S15_1, 0x20);
+  tmp.packet[28] = _mm256_permute2f128_si256(S8_1, S12_1, 0x31);
+  tmp.packet[29] = _mm256_permute2f128_si256(S9_1, S13_1, 0x31);
+  tmp.packet[30] = _mm256_permute2f128_si256(S10_1, S14_1, 0x31);
+  tmp.packet[31] = _mm256_permute2f128_si256(S11_1, S15_1, 0x31);
+
+  // Pack them into the output
+  PACK_OUTPUT_I32(kernel.packet, tmp.packet, 0, 16);
+  PACK_OUTPUT_I32(kernel.packet, tmp.packet, 1, 16);
+  PACK_OUTPUT_I32(kernel.packet, tmp.packet, 2, 16);
+  PACK_OUTPUT_I32(kernel.packet, tmp.packet, 3, 16);
+
+  PACK_OUTPUT_I32(kernel.packet, tmp.packet, 4, 16);
+  PACK_OUTPUT_I32(kernel.packet, tmp.packet, 5, 16);
+  PACK_OUTPUT_I32(kernel.packet, tmp.packet, 6, 16);
+  PACK_OUTPUT_I32(kernel.packet, tmp.packet, 7, 16);
+
+  PACK_OUTPUT_I32(kernel.packet, tmp.packet, 8, 16);
+  PACK_OUTPUT_I32(kernel.packet, tmp.packet, 9, 16);
+  PACK_OUTPUT_I32(kernel.packet, tmp.packet, 10, 16);
+  PACK_OUTPUT_I32(kernel.packet, tmp.packet, 11, 16);
+
+  PACK_OUTPUT_I32(kernel.packet, tmp.packet, 12, 16);
+  PACK_OUTPUT_I32(kernel.packet, tmp.packet, 13, 16);
+  PACK_OUTPUT_I32(kernel.packet, tmp.packet, 14, 16);
+  PACK_OUTPUT_I32(kernel.packet, tmp.packet, 15, 16);
+}
+
+EIGEN_DEVICE_FUNC inline void ptranspose(PacketBlock<Packet16i, 4>& kernel) {
+  __m512i T0 = _mm512_unpacklo_epi32(kernel.packet[0], kernel.packet[1]);
+  __m512i T1 = _mm512_unpackhi_epi32(kernel.packet[0], kernel.packet[1]);
+  __m512i T2 = _mm512_unpacklo_epi32(kernel.packet[2], kernel.packet[3]);
+  __m512i T3 = _mm512_unpackhi_epi32(kernel.packet[2], kernel.packet[3]);
+
+  __m512i S0 = SHUFFLE_EPI32(T0, T2, _MM_SHUFFLE(1, 0, 1, 0));
+  __m512i S1 = SHUFFLE_EPI32(T0, T2, _MM_SHUFFLE(3, 2, 3, 2));
+  __m512i S2 = SHUFFLE_EPI32(T1, T3, _MM_SHUFFLE(1, 0, 1, 0));
+  __m512i S3 = SHUFFLE_EPI32(T1, T3, _MM_SHUFFLE(3, 2, 3, 2));
+
+  EIGEN_EXTRACT_8i_FROM_16i(S0, S0);
+  EIGEN_EXTRACT_8i_FROM_16i(S1, S1);
+  EIGEN_EXTRACT_8i_FROM_16i(S2, S2);
+  EIGEN_EXTRACT_8i_FROM_16i(S3, S3);
+
+  PacketBlock<Packet8i, 8> tmp;
+
+  tmp.packet[0] = _mm256_permute2f128_si256(S0_0, S1_0, 0x20);
+  tmp.packet[1] = _mm256_permute2f128_si256(S2_0, S3_0, 0x20);
+  tmp.packet[2] = _mm256_permute2f128_si256(S0_0, S1_0, 0x31);
+  tmp.packet[3] = _mm256_permute2f128_si256(S2_0, S3_0, 0x31);
+
+  tmp.packet[4] = _mm256_permute2f128_si256(S0_1, S1_1, 0x20);
+  tmp.packet[5] = _mm256_permute2f128_si256(S2_1, S3_1, 0x20);
+  tmp.packet[6] = _mm256_permute2f128_si256(S0_1, S1_1, 0x31);
+  tmp.packet[7] = _mm256_permute2f128_si256(S2_1, S3_1, 0x31);
+
+  PACK_OUTPUT_I32_2(kernel.packet, tmp.packet, 0, 1);
+  PACK_OUTPUT_I32_2(kernel.packet, tmp.packet, 1, 1);
+  PACK_OUTPUT_I32_2(kernel.packet, tmp.packet, 2, 1);
+  PACK_OUTPUT_I32_2(kernel.packet, tmp.packet, 3, 1);
+}
+
 template <>
 EIGEN_STRONG_INLINE Packet16f pblend(const Selector<16>& /*ifPacket*/,
                                      const Packet16f& /*thenPacket*/,
@@ -1945,23 +2232,15 @@
 EIGEN_STRONG_INLINE Packet16bf F32ToBf16(const Packet16f& a) {
   Packet16bf r;
 
-  // Flush input denormals value to zero with hardware capability.
-  _MM_SET_DENORMALS_ZERO_MODE(_MM_DENORMALS_ZERO_ON);
-#if defined(EIGEN_VECTORIZE_AVX512DQ)
-  __m512 flush = _mm512_and_ps(a, a);
-#else
-  __m512 flush = _mm512_max_ps(a, a);
-#endif // EIGEN_VECTORIZE_AVX512DQ
-  _MM_SET_DENORMALS_ZERO_MODE(_MM_DENORMALS_ZERO_OFF);
-
 #if defined(EIGEN_VECTORIZE_AVX512BF16) && EIGEN_GNUC_AT_LEAST(10, 1)
   // Since GCC 10.1 supports avx512bf16 and C style explicit cast
   // (C++ static_cast is not supported yet), do converion via intrinsic
   // and register path for performance.
-  r = (__m256i)(_mm512_cvtneps_pbh(flush));
+  r = (__m256i)(_mm512_cvtneps_pbh(a));
+
 #else
   __m512i t;
-  __m512i input = _mm512_castps_si512(flush);
+  __m512i input = _mm512_castps_si512(a);
   __m512i nan = _mm512_set1_epi32(0x7fc0);
 
   // uint32_t lsb = (input >> 16) & 1;
@@ -1974,9 +2253,9 @@
   t = _mm512_srli_epi32(t, 16);
 
   // Check NaN before converting back to bf16
-  __mmask16 mask = _mm512_cmp_ps_mask(flush, flush, _CMP_ORD_Q);
-  t = _mm512_mask_blend_epi32(mask, nan, t);
+  __mmask16 mask = _mm512_cmp_ps_mask(a, a, _CMP_ORD_Q);
 
+  t = _mm512_mask_blend_epi32(mask, nan, t);
   // output.value = static_cast<uint16_t>(input);
   r = _mm512_cvtepi32_epi16(t);
 #endif // EIGEN_VECTORIZE_AVX512BF16
diff --git a/Eigen/src/Core/arch/AltiVec/Complex.h b/Eigen/src/Core/arch/AltiVec/Complex.h
index 058f8dd..b603dff 100644
--- a/Eigen/src/Core/arch/AltiVec/Complex.h
+++ b/Eigen/src/Core/arch/AltiVec/Complex.h
@@ -74,7 +74,7 @@
     return Packet2cf(*this) -= b;
   }
   EIGEN_STRONG_INLINE Packet2cf operator-(void) const {
-    return Packet2cf(vec_neg(v));
+    return Packet2cf(-v);
   }
 
   Packet4f  v;
@@ -291,7 +291,7 @@
     return Packet1cd(*this) -= b;
   }
   EIGEN_STRONG_INLINE Packet1cd operator-(void) const {
-    return Packet1cd(vec_neg(v));
+    return Packet1cd(-v);
   }
 
   Packet2d v;
diff --git a/Eigen/src/Core/arch/AltiVec/MatrixProduct.h b/Eigen/src/Core/arch/AltiVec/MatrixProduct.h
index 454b36c..3f79b97 100644
--- a/Eigen/src/Core/arch/AltiVec/MatrixProduct.h
+++ b/Eigen/src/Core/arch/AltiVec/MatrixProduct.h
@@ -1113,7 +1113,7 @@
 template<typename Scalar, typename Packet>
 EIGEN_ALWAYS_INLINE Packet ploadLhs(const Scalar* lhs)
 {
-  return *reinterpret_cast<Packet *>(const_cast<Scalar *>(lhs));
+  return ploadu<Packet>(lhs);
 }
 
 // Zero the accumulator on PacketBlock.
@@ -1570,7 +1570,7 @@
   const Packet& pAlpha)
 {
   const Scalar* rhs_ptr = rhs_base;
-  const Scalar* lhs_ptr0, *  lhs_ptr1, * lhs_ptr2, * lhs_ptr3, * lhs_ptr4, * lhs_ptr5, * lhs_ptr6, * lhs_ptr7;
+  const Scalar* lhs_ptr0 = NULL, *  lhs_ptr1 = NULL, * lhs_ptr2 = NULL, * lhs_ptr3 = NULL, * lhs_ptr4 = NULL, * lhs_ptr5 = NULL, * lhs_ptr6 = NULL, * lhs_ptr7 = NULL;
   PacketBlock<Packet,4> accZero0, accZero1, accZero2, accZero3, accZero4, accZero5, accZero6, accZero7;
   PacketBlock<Packet,4> acc;
 
@@ -1607,7 +1607,7 @@
   const Packet& pAlpha)
 {
   const Scalar* rhs_ptr = rhs_base;
-  const Scalar* lhs_ptr0, * lhs_ptr1, * lhs_ptr2, * lhs_ptr3, * lhs_ptr4, * lhs_ptr5, * lhs_ptr6, *lhs_ptr7;
+  const Scalar* lhs_ptr0 = NULL, * lhs_ptr1 = NULL, * lhs_ptr2 = NULL, * lhs_ptr3 = NULL, * lhs_ptr4 = NULL, * lhs_ptr5 = NULL, * lhs_ptr6 = NULL, *lhs_ptr7 = NULL;
   PacketBlock<Packet,1> accZero0, accZero1, accZero2, accZero3, accZero4, accZero5, accZero6, accZero7;
   PacketBlock<Packet,1> acc;
 
@@ -2180,9 +2180,9 @@
   } else {
     EIGEN_UNUSED_VARIABLE(rhs_ptr_imag);
   }
-  const Scalar* lhs_ptr_real0, * lhs_ptr_imag0, * lhs_ptr_real1, * lhs_ptr_imag1;
-  const Scalar* lhs_ptr_real2, * lhs_ptr_imag2, * lhs_ptr_real3, * lhs_ptr_imag3;
-  const Scalar* lhs_ptr_real4, * lhs_ptr_imag4;
+  const Scalar* lhs_ptr_real0 = NULL, * lhs_ptr_imag0 = NULL, * lhs_ptr_real1 = NULL, * lhs_ptr_imag1 = NULL;
+  const Scalar* lhs_ptr_real2 = NULL, * lhs_ptr_imag2 = NULL, * lhs_ptr_real3 = NULL, * lhs_ptr_imag3 = NULL;
+  const Scalar* lhs_ptr_real4 = NULL, * lhs_ptr_imag4 = NULL;
   PacketBlock<Packet,4> accReal0, accImag0, accReal1, accImag1;
   PacketBlock<Packet,4> accReal2, accImag2, accReal3, accImag3;
   PacketBlock<Packet,4> accReal4, accImag4;
@@ -2234,9 +2234,9 @@
   } else {
     EIGEN_UNUSED_VARIABLE(rhs_ptr_imag);
   }
-  const Scalar* lhs_ptr_real0, * lhs_ptr_imag0, * lhs_ptr_real1, * lhs_ptr_imag1;
-  const Scalar* lhs_ptr_real2, * lhs_ptr_imag2, * lhs_ptr_real3, * lhs_ptr_imag3;
-  const Scalar* lhs_ptr_real4, * lhs_ptr_imag4;
+  const Scalar* lhs_ptr_real0 = NULL, * lhs_ptr_imag0 = NULL, * lhs_ptr_real1 = NULL, * lhs_ptr_imag1 = NULL;
+  const Scalar* lhs_ptr_real2 = NULL, * lhs_ptr_imag2 = NULL, * lhs_ptr_real3 = NULL, * lhs_ptr_imag3 = NULL;
+  const Scalar* lhs_ptr_real4 = NULL, * lhs_ptr_imag4 = NULL;
   PacketBlock<Packet,1> accReal0, accImag0, accReal1, accImag1;
   PacketBlock<Packet,1> accReal2, accImag2, accReal3, accImag3;
   PacketBlock<Packet,1> accReal4, accImag4;
diff --git a/Eigen/src/Core/arch/AltiVec/MatrixProductCommon.h b/Eigen/src/Core/arch/AltiVec/MatrixProductCommon.h
index 41b27bf..33d5434 100644
--- a/Eigen/src/Core/arch/AltiVec/MatrixProductCommon.h
+++ b/Eigen/src/Core/arch/AltiVec/MatrixProductCommon.h
@@ -214,7 +214,7 @@
 template<typename Scalar, typename Packet>
 EIGEN_ALWAYS_INLINE Packet ploadRhs(const Scalar* rhs)
 {
-  return *reinterpret_cast<Packet *>(const_cast<Scalar *>(rhs));
+  return ploadu<Packet>(rhs);
 }
 
 } // end namespace internal
diff --git a/Eigen/src/Core/arch/AltiVec/MatrixProductMMA.h b/Eigen/src/Core/arch/AltiVec/MatrixProductMMA.h
index 13d9517..6540c6f 100644
--- a/Eigen/src/Core/arch/AltiVec/MatrixProductMMA.h
+++ b/Eigen/src/Core/arch/AltiVec/MatrixProductMMA.h
@@ -256,7 +256,7 @@
   const Packet& pAlpha)
 {
   const Scalar* rhs_ptr = rhs_base;
-  const Scalar* lhs_ptr0, * lhs_ptr1, * lhs_ptr2, * lhs_ptr3, * lhs_ptr4, * lhs_ptr5, * lhs_ptr6, * lhs_ptr7;
+  const Scalar* lhs_ptr0 = NULL, * lhs_ptr1 = NULL, * lhs_ptr2 = NULL, * lhs_ptr3 = NULL, * lhs_ptr4 = NULL, * lhs_ptr5 = NULL, * lhs_ptr6 = NULL, * lhs_ptr7 = NULL;
   __vector_quad accZero0, accZero1, accZero2, accZero3, accZero4, accZero5, accZero6, accZero7;
 
   MICRO_MMA_SRC_PTR
@@ -510,9 +510,9 @@
   } else {
     EIGEN_UNUSED_VARIABLE(rhs_ptr_imag);
   }
-  const Scalar* lhs_ptr_real0, * lhs_ptr_imag0, * lhs_ptr_real1, * lhs_ptr_imag1;
-  const Scalar* lhs_ptr_real2, * lhs_ptr_imag2, * lhs_ptr_real3, * lhs_ptr_imag3;
-  const Scalar* lhs_ptr_real4, * lhs_ptr_imag4;
+  const Scalar* lhs_ptr_real0 = NULL, * lhs_ptr_imag0 = NULL, * lhs_ptr_real1 = NULL, * lhs_ptr_imag1 = NULL;
+  const Scalar* lhs_ptr_real2 = NULL, * lhs_ptr_imag2 = NULL, * lhs_ptr_real3 = NULL, * lhs_ptr_imag3 = NULL;
+  const Scalar* lhs_ptr_real4 = NULL, * lhs_ptr_imag4 = NULL;
   __vector_quad accReal0, accImag0, accReal1, accImag1, accReal2, accImag2, accReal3, accImag3, accReal4, accImag4;
 
   MICRO_COMPLEX_MMA_SRC_PTR
diff --git a/Eigen/src/Core/arch/AltiVec/PacketMath.h b/Eigen/src/Core/arch/AltiVec/PacketMath.h
index 8c42f49..2a44054 100755
--- a/Eigen/src/Core/arch/AltiVec/PacketMath.h
+++ b/Eigen/src/Core/arch/AltiVec/PacketMath.h
@@ -433,7 +433,7 @@
   EIGEN_UNUSED_VARIABLE(from);
   EIGEN_DEBUG_ALIGNED_LOAD
 #ifdef __VSX__
-  return vec_xl(0, from);
+  return vec_xl(0, const_cast<__UNPACK_TYPE__(Packet)*>(from));
 #else
   return vec_ld(0, from);
 #endif
@@ -867,17 +867,26 @@
 template<> EIGEN_STRONG_INLINE Packet4f pcmp_le(const Packet4f& a, const Packet4f& b) { return reinterpret_cast<Packet4f>(vec_cmple(a,b)); }
 template<> EIGEN_STRONG_INLINE Packet4f pcmp_lt(const Packet4f& a, const Packet4f& b) { return reinterpret_cast<Packet4f>(vec_cmplt(a,b)); }
 template<> EIGEN_STRONG_INLINE Packet4f pcmp_eq(const Packet4f& a, const Packet4f& b) { return reinterpret_cast<Packet4f>(vec_cmpeq(a,b)); }
-template<> EIGEN_STRONG_INLINE Packet16c pcmp_eq(const Packet16c& a, const Packet16c& b) { return reinterpret_cast<Packet16c>(vec_cmpeq(a,b)); }
-template<> EIGEN_STRONG_INLINE Packet16uc pcmp_eq(const Packet16uc& a, const Packet16uc& b) { return reinterpret_cast<Packet16uc>(vec_cmpeq(a,b)); }
-
-template<> EIGEN_STRONG_INLINE Packet8s pcmp_eq(const Packet8s& a, const Packet8s& b) { return reinterpret_cast<Packet8s>(vec_cmpeq(a,b)); }
-template<> EIGEN_STRONG_INLINE Packet8us pcmp_eq(const Packet8us& a, const Packet8us& b) { return reinterpret_cast<Packet8us>(vec_cmpeq(a,b)); }
-
 template<> EIGEN_STRONG_INLINE Packet4f pcmp_lt_or_nan(const Packet4f& a, const Packet4f& b) {
   Packet4f c = reinterpret_cast<Packet4f>(vec_cmpge(a,b));
   return vec_nor(c,c);
 }
+
+template<> EIGEN_STRONG_INLINE Packet4i pcmp_le(const Packet4i& a, const Packet4i& b) { return reinterpret_cast<Packet4i>(vec_cmple(a,b)); }
+template<> EIGEN_STRONG_INLINE Packet4i pcmp_lt(const Packet4i& a, const Packet4i& b) { return reinterpret_cast<Packet4i>(vec_cmplt(a,b)); }
 template<> EIGEN_STRONG_INLINE Packet4i pcmp_eq(const Packet4i& a, const Packet4i& b) { return reinterpret_cast<Packet4i>(vec_cmpeq(a,b)); }
+template<> EIGEN_STRONG_INLINE Packet8s pcmp_le(const Packet8s& a, const Packet8s& b) { return reinterpret_cast<Packet8s>(vec_cmple(a,b)); }
+template<> EIGEN_STRONG_INLINE Packet8s pcmp_lt(const Packet8s& a, const Packet8s& b) { return reinterpret_cast<Packet8s>(vec_cmplt(a,b)); }
+template<> EIGEN_STRONG_INLINE Packet8s pcmp_eq(const Packet8s& a, const Packet8s& b) { return reinterpret_cast<Packet8s>(vec_cmpeq(a,b)); }
+template<> EIGEN_STRONG_INLINE Packet8us pcmp_le(const Packet8us& a, const Packet8us& b) { return reinterpret_cast<Packet8us>(vec_cmple(a,b)); }
+template<> EIGEN_STRONG_INLINE Packet8us pcmp_lt(const Packet8us& a, const Packet8us& b) { return reinterpret_cast<Packet8us>(vec_cmplt(a,b)); }
+template<> EIGEN_STRONG_INLINE Packet8us pcmp_eq(const Packet8us& a, const Packet8us& b) { return reinterpret_cast<Packet8us>(vec_cmpeq(a,b)); }
+template<> EIGEN_STRONG_INLINE Packet16c pcmp_le(const Packet16c& a, const Packet16c& b) { return reinterpret_cast<Packet16c>(vec_cmple(a,b)); }
+template<> EIGEN_STRONG_INLINE Packet16c pcmp_lt(const Packet16c& a, const Packet16c& b) { return reinterpret_cast<Packet16c>(vec_cmplt(a,b)); }
+template<> EIGEN_STRONG_INLINE Packet16c pcmp_eq(const Packet16c& a, const Packet16c& b) { return reinterpret_cast<Packet16c>(vec_cmpeq(a,b)); }
+template<> EIGEN_STRONG_INLINE Packet16uc pcmp_le(const Packet16uc& a, const Packet16uc& b) { return reinterpret_cast<Packet16uc>(vec_cmple(a,b)); }
+template<> EIGEN_STRONG_INLINE Packet16uc pcmp_lt(const Packet16uc& a, const Packet16uc& b) { return reinterpret_cast<Packet16uc>(vec_cmplt(a,b)); }
+template<> EIGEN_STRONG_INLINE Packet16uc pcmp_eq(const Packet16uc& a, const Packet16uc& b) { return reinterpret_cast<Packet16uc>(vec_cmpeq(a,b)); }
 
 template<> EIGEN_STRONG_INLINE Packet4f pand<Packet4f>(const Packet4f& a, const Packet4f& b) { return vec_and(a, b); }
 template<> EIGEN_STRONG_INLINE Packet4i pand<Packet4i>(const Packet4i& a, const Packet4i& b) { return vec_and(a, b); }
@@ -902,8 +911,8 @@
   return pxor<Packet8us>(a, b);
 }
 
-template<> EIGEN_STRONG_INLINE Packet4f pandnot<Packet4f>(const Packet4f& a, const Packet4f& b) { return vec_and(a, vec_nor(b, b)); }
-template<> EIGEN_STRONG_INLINE Packet4i pandnot<Packet4i>(const Packet4i& a, const Packet4i& b) { return vec_and(a, vec_nor(b, b)); }
+template<> EIGEN_STRONG_INLINE Packet4f pandnot<Packet4f>(const Packet4f& a, const Packet4f& b) { return vec_andc(a, b); }
+template<> EIGEN_STRONG_INLINE Packet4i pandnot<Packet4i>(const Packet4i& a, const Packet4i& b) { return vec_andc(a, b); }
 
 template<> EIGEN_STRONG_INLINE Packet4f pselect(const Packet4f& mask, const Packet4f& a, const Packet4f& b) {
   return vec_sel(b, a, reinterpret_cast<Packet4ui>(mask));
@@ -952,7 +961,7 @@
   return (Packet) vec_perm(MSQ, LSQ, mask);           // align the data
 #else
   EIGEN_DEBUG_UNALIGNED_LOAD
-  return vec_xl(0, from);
+  return vec_xl(0, const_cast<__UNPACK_TYPE__(Packet)*>(from));
 #endif
 }
 
@@ -1260,15 +1269,15 @@
   Packet4bi is_max_exp = vec_cmpeq(exp, p4ui_max_exp);
   Packet4bi is_zero_exp = vec_cmpeq(exp, reinterpret_cast<Packet4ui>(p4i_ZERO));
 
-  Packet4bi is_mant_not_zero = vec_cmpne(mantissa, reinterpret_cast<Packet4ui>(p4i_ZERO));
-  Packet4ui nan_selector = pand<Packet4ui>(
+  Packet4bi is_mant_zero = vec_cmpeq(mantissa, reinterpret_cast<Packet4ui>(p4i_ZERO));
+  Packet4ui nan_selector = pandnot<Packet4ui>(
       reinterpret_cast<Packet4ui>(is_max_exp),
-      reinterpret_cast<Packet4ui>(is_mant_not_zero)
+      reinterpret_cast<Packet4ui>(is_mant_zero)
   );
 
-  Packet4ui subnormal_selector = pand<Packet4ui>(
+  Packet4ui subnormal_selector = pandnot<Packet4ui>(
       reinterpret_cast<Packet4ui>(is_zero_exp),
-      reinterpret_cast<Packet4ui>(is_mant_not_zero)
+      reinterpret_cast<Packet4ui>(is_mant_zero)
   );
 
   const _EIGEN_DECLARE_CONST_FAST_Packet4ui(nan, 0x7FC00000);
@@ -2453,7 +2462,7 @@
 template<> EIGEN_STRONG_INLINE Packet2d ploadu<Packet2d>(const double* from)
 {
   EIGEN_DEBUG_UNALIGNED_LOAD
-  return vec_xl(0, from);
+  return vec_xl(0, const_cast<double*>(from));
 }
 
 template<> EIGEN_STRONG_INLINE Packet2d ploaddup<Packet2d>(const double*   from)
diff --git a/Eigen/src/Core/arch/Default/BFloat16.h b/Eigen/src/Core/arch/Default/BFloat16.h
index aac60f1..1c28f4f 100644
--- a/Eigen/src/Core/arch/Default/BFloat16.h
+++ b/Eigen/src/Core/arch/Default/BFloat16.h
@@ -250,10 +250,6 @@
   if (Eigen::numext::isnan EIGEN_NOT_A_MACRO(v)) {
     output.value = std::signbit(v) ? 0xFFC0: 0x7FC0;
     return output;
-  } else if (std::fabs(v) < std::numeric_limits<float>::min EIGEN_NOT_A_MACRO()) {
-    // Flush denormal to +/- 0.
-    output.value = std::signbit(v) ? 0x8000 : 0;
-    return output;
   }
   const uint16_t* p = reinterpret_cast<const uint16_t*>(&v);
 #if defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
@@ -288,9 +284,6 @@
     // qNaN magic: All exponent bits set + most significant bit of fraction
     // set.
     output.value = std::signbit(ff) ? 0xFFC0: 0x7FC0;
-  } else if (std::fabs(ff) < std::numeric_limits<float>::min EIGEN_NOT_A_MACRO()) {
-    // Flush denormal to +/- 0.0
-    output.value = std::signbit(ff) ? 0x8000 : 0;
   } else {
     // Fast rounding algorithm that rounds a half value to nearest even. This
     // reduces expected error when we convert a large number of floats. Here
diff --git a/Eigen/src/Core/arch/GPU/PacketMath.h b/Eigen/src/Core/arch/GPU/PacketMath.h
index 689110d..25c45fd 100644
--- a/Eigen/src/Core/arch/GPU/PacketMath.h
+++ b/Eigen/src/Core/arch/GPU/PacketMath.h
@@ -493,9 +493,10 @@
 
 #endif // defined(EIGEN_GPUCC) && defined(EIGEN_USE_GPU)
 
-// Packet4h2 must be defined in the macro without EIGEN_CUDA_ARCH, meaning
-// its corresponding packet_traits<Eigen::half> must be visible on host.
-#if defined(EIGEN_HAS_CUDA_FP16) || defined(EIGEN_HAS_HIP_FP16)
+// Half-packet functions are not available on the host for CUDA 9.0-9.2, only
+// on device. There is no benefit to using them on the host anyways, since they are
+// emulated.
+#if (defined(EIGEN_HAS_CUDA_FP16) || defined(EIGEN_HAS_HIP_FP16)) && defined(EIGEN_GPU_COMPILE_PHASE)
 
 typedef ulonglong2 Packet4h2;
 template<> struct unpacket_traits<Packet4h2> { typedef Eigen::half type; enum {size=8, alignment=Aligned16, vectorizable=true, masked_load_available=false, masked_store_available=false}; typedef Packet4h2 half; };
@@ -526,42 +527,9 @@
   };
 };
 
-namespace {
-// This is equivalent to make_half2, which is undocumented and doesn't seem to always exist.
-EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE half2 combine_half(const __half& a, const __half& b) {
-#if defined(EIGEN_GPU_COMPILE_PHASE)
-  return __halves2half2(a, b);
-#else
-  // Round-about way since __halves2half2 is a __device__ function.
-  return __floats2half2_rn(__half2float(a), __half2float(b));
-#endif
-}
-
-EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE __half get_half2_low(const half2& a) {
-#if defined(EIGEN_GPU_COMPILE_PHASE)
-  return __low2half(a);
-#else
-  return __float2half(__low2float(a));
-#endif
-}
-
-EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE __half get_half2_high(const half2& a) {
-#if defined(EIGEN_GPU_COMPILE_PHASE)
-  return __high2half(a);
-#else
-  return __float2half(__high2float(a));
-#endif
-}
-} // namespace
-
 template<>
 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE half2 pset1<half2>(const Eigen::half& from) {
-#if defined(EIGEN_GPU_COMPILE_PHASE)
   return __half2half2(from);
-#else
-  const float f = __half2float(from);
-  return __floats2half2_rn(f, f);
-#endif
 }
 
 template <>
@@ -576,8 +544,6 @@
   return r;
 }
 
-// We now need this visible on both host and device.
-// #if defined(EIGEN_CUDA_ARCH) || defined(EIGEN_HIPCC) || (defined(EIGEN_CUDACC) && EIGEN_COMP_CLANG && !EIGEN_COMP_NVCC)
 namespace {
 
 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE half2 pload(const Eigen::half* from) {
@@ -585,11 +551,11 @@
 }
 
 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE half2 ploadu(const Eigen::half* from) {
-  return combine_half(from[0], from[1]);
+  return __halves2half2(from[0], from[1]);
 }
 
 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE half2 ploaddup(const Eigen::half*  from) {
-  return combine_half(from[0], from[0]);
+  return __halves2half2(from[0], from[0]);
 }
 
 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void pstore(Eigen::half* to,
@@ -599,8 +565,8 @@
 
 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void pstoreu(Eigen::half* to,
                                                    const half2& from) {
-  to[0] = get_half2_low(from);
-  to[1] = get_half2_high(from);
+  to[0] = __low2half(from);
+  to[1] = __high2half(from);
 }
 
 
@@ -610,7 +576,7 @@
   // Input is guaranteed to be properly aligned.
   return __ldg(reinterpret_cast<const half2*>(from));
 #else
-  return combine_half(*(from+0), *(from+1));
+  return __halves2half2(*(from+0), *(from+1));
 #endif
 }
 
@@ -619,31 +585,31 @@
 #if defined(EIGEN_GPU_HAS_LDG)
   return __halves2half2(__ldg(from+0), __ldg(from+1));
 #else
-  return combine_half(*(from+0), *(from+1));
+  return __halves2half2(*(from+0), *(from+1));
 #endif
 }
 
 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE half2 pgather(const Eigen::half* from,
                                                     Index stride) {
-  return combine_half(from[0*stride], from[1*stride]);
+  return __halves2half2(from[0*stride], from[1*stride]);
 }
 
 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void pscatter(
     Eigen::half* to, const half2& from, Index stride) {
-  to[stride*0] = get_half2_low(from);
-  to[stride*1] = get_half2_high(from);
+  to[stride*0] = __low2half(from);
+  to[stride*1] = __high2half(from);
 }
 
 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Eigen::half pfirst(const half2& a) {
-  return get_half2_low(a);
+  return __low2half(a);
 }
 
 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE half2 pabs(const half2& a) {
-  half a1 = get_half2_low(a);
-  half a2 = get_half2_high(a);
+  half a1 = __low2half(a);
+  half a2 = __high2half(a);
   half result1 = half_impl::raw_uint16_to_half(a1.x & 0x7FFF);
   half result2 = half_impl::raw_uint16_to_half(a2.x & 0x7FFF);
-  return combine_half(result1, result2);
+  return __halves2half2(result1, result2);
 }
 
 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE half2 ptrue(const half2& /*a*/) {
@@ -658,12 +624,12 @@
 
 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void
 ptranspose(PacketBlock<half2,2>& kernel) {
-  __half a1 = get_half2_low(kernel.packet[0]);
-  __half a2 = get_half2_high(kernel.packet[0]);
-  __half b1 = get_half2_low(kernel.packet[1]);
-  __half b2 = get_half2_high(kernel.packet[1]);
-  kernel.packet[0] = combine_half(a1, b1);
-  kernel.packet[1] = combine_half(a2, b2);
+  __half a1 = __low2half(kernel.packet[0]);
+  __half a2 = __high2half(kernel.packet[0]);
+  __half b1 = __low2half(kernel.packet[1]);
+  __half b2 = __high2half(kernel.packet[1]);
+  kernel.packet[0] = __halves2half2(a1, b1);
+  kernel.packet[1] = __halves2half2(a2, b2);
 }
 
 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE half2 plset(const Eigen::half& a) {
@@ -671,88 +637,88 @@
   return __halves2half2(a, __hadd(a, __float2half(1.0f)));
 #else
   float f = __half2float(a) + 1.0f;
-  return combine_half(a, __float2half(f));
+  return __halves2half2(a, __float2half(f));
 #endif
 }
 
 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE half2 pselect(const half2& mask,
                                                     const half2& a,
                                                     const half2& b) {
-  half mask_low = get_half2_low(mask);
-  half mask_high = get_half2_high(mask);
-  half result_low = mask_low == half(0) ? get_half2_low(b) : get_half2_low(a);
-  half result_high = mask_high == half(0) ? get_half2_high(b) : get_half2_high(a);
-  return combine_half(result_low, result_high);
+  half mask_low = __low2half(mask);
+  half mask_high = __high2half(mask);
+  half result_low = mask_low == half(0) ? __low2half(b) : __low2half(a);
+  half result_high = mask_high == half(0) ? __high2half(b) : __high2half(a);
+  return __halves2half2(result_low, result_high);
 }
 
 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE half2 pcmp_eq(const half2& a,
                                                     const half2& b) {
   half true_half = half_impl::raw_uint16_to_half(0xffffu);
   half false_half = half_impl::raw_uint16_to_half(0x0000u);
-  half a1 = get_half2_low(a);
-  half a2 = get_half2_high(a);
-  half b1 = get_half2_low(b);
-  half b2 = get_half2_high(b);
+  half a1 = __low2half(a);
+  half a2 = __high2half(a);
+  half b1 = __low2half(b);
+  half b2 = __high2half(b);
   half eq1 = __half2float(a1) == __half2float(b1) ? true_half : false_half;
   half eq2 = __half2float(a2) == __half2float(b2) ? true_half : false_half;
-  return combine_half(eq1, eq2);
+  return __halves2half2(eq1, eq2);
 }
 
 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE half2 pcmp_lt(const half2& a,
                                                     const half2& b) {
   half true_half = half_impl::raw_uint16_to_half(0xffffu);
   half false_half = half_impl::raw_uint16_to_half(0x0000u);
-  half a1 = get_half2_low(a);
-  half a2 = get_half2_high(a);
-  half b1 = get_half2_low(b);
-  half b2 = get_half2_high(b);
+  half a1 = __low2half(a);
+  half a2 = __high2half(a);
+  half b1 = __low2half(b);
+  half b2 = __high2half(b);
   half eq1 = __half2float(a1) < __half2float(b1) ? true_half : false_half;
   half eq2 = __half2float(a2) < __half2float(b2) ? true_half : false_half;
-  return combine_half(eq1, eq2);
+  return __halves2half2(eq1, eq2);
 }
 
 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE half2 pand(const half2& a,
                                                  const half2& b) {
-  half a1 = get_half2_low(a);
-  half a2 = get_half2_high(a);
-  half b1 = get_half2_low(b);
-  half b2 = get_half2_high(b);
+  half a1 = __low2half(a);
+  half a2 = __high2half(a);
+  half b1 = __low2half(b);
+  half b2 = __high2half(b);
   half result1 = half_impl::raw_uint16_to_half(a1.x & b1.x);
   half result2 = half_impl::raw_uint16_to_half(a2.x & b2.x);
-  return combine_half(result1, result2);
+  return __halves2half2(result1, result2);
 }
 
 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE half2 por(const half2& a,
                                                 const half2& b) {
-  half a1 = get_half2_low(a);
-  half a2 = get_half2_high(a);
-  half b1 = get_half2_low(b);
-  half b2 = get_half2_high(b);
+  half a1 = __low2half(a);
+  half a2 = __high2half(a);
+  half b1 = __low2half(b);
+  half b2 = __high2half(b);
   half result1 = half_impl::raw_uint16_to_half(a1.x | b1.x);
   half result2 = half_impl::raw_uint16_to_half(a2.x | b2.x);
-  return combine_half(result1, result2);
+  return __halves2half2(result1, result2);
 }
 
 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE half2 pxor(const half2& a,
                                                  const half2& b) {
-  half a1 = get_half2_low(a);
-  half a2 = get_half2_high(a);
-  half b1 = get_half2_low(b);
-  half b2 = get_half2_high(b);
+  half a1 = __low2half(a);
+  half a2 = __high2half(a);
+  half b1 = __low2half(b);
+  half b2 = __high2half(b);
   half result1 = half_impl::raw_uint16_to_half(a1.x ^ b1.x);
   half result2 = half_impl::raw_uint16_to_half(a2.x ^ b2.x);
-  return combine_half(result1, result2);
+  return __halves2half2(result1, result2);
 }
 
 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE half2 pandnot(const half2& a,
                                                     const half2& b) {
-  half a1 = get_half2_low(a);
-  half a2 = get_half2_high(a);
-  half b1 = get_half2_low(b);
-  half b2 = get_half2_high(b);
+  half a1 = __low2half(a);
+  half a2 = __high2half(a);
+  half b1 = __low2half(b);
+  half b2 = __high2half(b);
   half result1 = half_impl::raw_uint16_to_half(a1.x & ~b1.x);
   half result2 = half_impl::raw_uint16_to_half(a2.x & ~b2.x);
-  return combine_half(result1, result2);
+  return __halves2half2(result1, result2);
 }
 
 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE half2 padd(const half2& a,
@@ -851,9 +817,9 @@
   float a2 = __high2float(a);
   float b1 = __low2float(b);
   float b2 = __high2float(b);
-  __half r1 = a1 < b1 ? get_half2_low(a) : get_half2_low(b);
-  __half r2 = a2 < b2 ? get_half2_high(a) : get_half2_high(b);
-  return combine_half(r1, r2);
+  __half r1 = a1 < b1 ? __low2half(a) : __low2half(b);
+  __half r2 = a2 < b2 ? __high2half(a) : __high2half(b);
+  return __halves2half2(r1, r2);
 }
 
 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE half2 pmax(const half2& a,
@@ -862,9 +828,9 @@
   float a2 = __high2float(a);
   float b1 = __low2float(b);
   float b2 = __high2float(b);
-  __half r1 = a1 > b1 ? get_half2_low(a) : get_half2_low(b);
-  __half r2 = a2 > b2 ? get_half2_high(a) : get_half2_high(b);
-  return combine_half(r1, r2);
+  __half r1 = a1 > b1 ? __low2half(a) : __low2half(b);
+  __half r2 = a2 > b2 ? __high2half(a) : __high2half(b);
+  return __halves2half2(r1, r2);
 }
 
 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Eigen::half predux(const half2& a) {
@@ -885,7 +851,7 @@
 #else
   float a1 = __low2float(a);
   float a2 = __high2float(a);
-  return a1 > a2 ? get_half2_low(a) : get_half2_high(a);
+  return a1 > a2 ? __low2half(a) : __high2half(a);
 #endif
 }
 
@@ -897,7 +863,7 @@
 #else
   float a1 = __low2float(a);
   float a2 = __high2float(a);
-  return a1 < a2 ? get_half2_low(a) : get_half2_high(a);
+  return a1 < a2 ? __low2half(a) : __high2half(a);
 #endif
 }
 
@@ -1068,10 +1034,10 @@
 pgather<Eigen::half, Packet4h2>(const Eigen::half* from, Index stride) {
   Packet4h2 r;
   half2* p_alias = reinterpret_cast<half2*>(&r);
-  p_alias[0] = combine_half(from[0 * stride], from[1 * stride]);
-  p_alias[1] = combine_half(from[2 * stride], from[3 * stride]);
-  p_alias[2] = combine_half(from[4 * stride], from[5 * stride]);
-  p_alias[3] = combine_half(from[6 * stride], from[7 * stride]);
+  p_alias[0] = __halves2half2(from[0 * stride], from[1 * stride]);
+  p_alias[1] = __halves2half2(from[2 * stride], from[3 * stride]);
+  p_alias[2] = __halves2half2(from[4 * stride], from[5 * stride]);
+  p_alias[3] = __halves2half2(from[6 * stride], from[7 * stride]);
   return r;
 }
 
@@ -1152,12 +1118,12 @@
 
 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void
 ptranspose_half(half2& f0, half2& f1) {
-  __half a1 = get_half2_low(f0);
-  __half a2 = get_half2_high(f0);
-  __half b1 = get_half2_low(f1);
-  __half b2 = get_half2_high(f1);
-  f0 = combine_half(a1, b1);
-  f1 = combine_half(a2, b2);
+  __half a1 = __low2half(f0);
+  __half a2 = __high2half(f0);
+  __half b1 = __low2half(f1);
+  __half b2 = __high2half(f1);
+  f0 = __halves2half2(a1, b1);
+  f1 = __halves2half2(a2, b2);
 }
 
 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void
@@ -1254,10 +1220,10 @@
   float f = __half2float(a);
   Packet4h2 r;
   half2* p_alias = reinterpret_cast<half2*>(&r);
-  p_alias[0] = combine_half(a, __float2half(f + 1.0f));
-  p_alias[1] = combine_half(__float2half(f + 2.0f), __float2half(f + 3.0f));
-  p_alias[2] = combine_half(__float2half(f + 4.0f), __float2half(f + 5.0f));
-  p_alias[3] = combine_half(__float2half(f + 6.0f), __float2half(f + 7.0f));
+  p_alias[0] = __halves2half2(a, __float2half(f + 1.0f));
+  p_alias[1] = __halves2half2(__float2half(f + 2.0f), __float2half(f + 3.0f));
+  p_alias[2] = __halves2half2(__float2half(f + 4.0f), __float2half(f + 5.0f));
+  p_alias[3] = __halves2half2(__float2half(f + 6.0f), __float2half(f + 7.0f));
   return r;
 #endif
 }
@@ -1477,9 +1443,9 @@
 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Eigen::half predux_max<Packet4h2>(
     const Packet4h2& a) {
   const half2* a_alias = reinterpret_cast<const half2*>(&a);
-  half2 m0 = combine_half(predux_max(a_alias[0]),
+  half2 m0 = __halves2half2(predux_max(a_alias[0]),
                             predux_max(a_alias[1]));
-  half2 m1 = combine_half(predux_max(a_alias[2]),
+  half2 m1 = __halves2half2(predux_max(a_alias[2]),
                             predux_max(a_alias[3]));
   __half first  = predux_max(m0);
   __half second = predux_max(m1);
@@ -1496,9 +1462,9 @@
 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Eigen::half predux_min<Packet4h2>(
     const Packet4h2& a) {
   const half2* a_alias = reinterpret_cast<const half2*>(&a);
-  half2 m0 = combine_half(predux_min(a_alias[0]),
+  half2 m0 = __halves2half2(predux_min(a_alias[0]),
                             predux_min(a_alias[1]));
-  half2 m1 = combine_half(predux_min(a_alias[2]),
+  half2 m1 = __halves2half2(predux_min(a_alias[2]),
                             predux_min(a_alias[3]));
   __half first  = predux_min(m0);
   __half second = predux_min(m1);
@@ -1652,9 +1618,9 @@
   float a2 = __high2float(a);
   float b1 = __low2float(b);
   float b2 = __high2float(b);
-  __half r1 = a1 < b1 ? get_half2_low(a) : get_half2_low(b);
-  __half r2 = a2 < b2 ? get_half2_high(a) : get_half2_high(b);
-  return combine_half(r1, r2);
+  __half r1 = a1 < b1 ? __low2half(a) : __low2half(b);
+  __half r2 = a2 < b2 ? __high2half(a) : __high2half(b);
+  return __halves2half2(r1, r2);
 }
 
 template<>
@@ -1664,14 +1630,12 @@
   float a2 = __high2float(a);
   float b1 = __low2float(b);
   float b2 = __high2float(b);
-  __half r1 = a1 > b1 ? get_half2_low(a) : get_half2_low(b);
-  __half r2 = a2 > b2 ? get_half2_high(a) : get_half2_high(b);
-  return combine_half(r1, r2);
+  __half r1 = a1 > b1 ? __low2half(a) : __low2half(b);
+  __half r2 = a2 > b2 ? __high2half(a) : __high2half(b);
+  return __halves2half2(r1, r2);
 }
 
-// #endif // defined(EIGEN_CUDA_ARCH) || defined(EIGEN_HIPCC) || (defined(EIGEN_CUDACC) && EIGEN_COMP_CLANG && !EIGEN_COMP_NVCC)
-
-#endif // defined(EIGEN_HAS_CUDA_FP16) || defined(EIGEN_HAS_HIP_FP16)
+#endif // (defined(EIGEN_HAS_CUDA_FP16) || defined(EIGEN_HAS_HIP_FP16)) && defined(EIGEN_GPU_COMPILE_PHASE)
 
 #undef EIGEN_GPU_HAS_LDG
 #undef EIGEN_CUDA_HAS_FP16_ARITHMETIC
diff --git a/Eigen/src/Core/arch/GPU/TypeCasting.h b/Eigen/src/Core/arch/GPU/TypeCasting.h
index 7545462..c8195bb 100644
--- a/Eigen/src/Core/arch/GPU/TypeCasting.h
+++ b/Eigen/src/Core/arch/GPU/TypeCasting.h
@@ -15,8 +15,7 @@
 namespace internal {
 
 #if (defined(EIGEN_HAS_CUDA_FP16) && defined(EIGEN_CUDA_ARCH) && EIGEN_CUDA_ARCH >= 300) || \
-  (defined(EIGEN_HAS_HIP_FP16) && defined(EIGEN_HIP_DEVICE_COMPILE))
-
+    (defined(EIGEN_HAS_HIP_FP16) && defined(EIGEN_HIP_DEVICE_COMPILE))
 
 template <>
 struct type_casting_traits<Eigen::half, float> {
diff --git a/Eigen/src/Core/arch/NEON/PacketMath.h b/Eigen/src/Core/arch/NEON/PacketMath.h
index 8cac1be..f5fa3fa 100644
--- a/Eigen/src/Core/arch/NEON/PacketMath.h
+++ b/Eigen/src/Core/arch/NEON/PacketMath.h
@@ -155,7 +155,7 @@
   #define EIGEN_ARM_PREFETCH(ADDR) __builtin_prefetch(ADDR);
 #elif defined __pld
   #define EIGEN_ARM_PREFETCH(ADDR) __pld(ADDR)
-#elif EIGEN_ARCH_ARM32
+#elif EIGEN_ARCH_ARM
   #define EIGEN_ARM_PREFETCH(ADDR) __asm__ __volatile__ ("pld [%[addr]]\n" :: [addr] "r" (ADDR) : );
 #else
   // by default no explicit prefetching
@@ -2386,12 +2386,17 @@
 template<> EIGEN_STRONG_INLINE Packet4f pldexp<Packet4f>(const Packet4f& a, const Packet4f& exponent)
 { return pldexp_generic(a,exponent); }
 
+#if EIGEN_ARCH_ARM64
+template<> EIGEN_STRONG_INLINE float predux<Packet2f>(const Packet2f& a) { return vaddv_f32(a); }
+template<> EIGEN_STRONG_INLINE float predux<Packet4f>(const Packet4f& a) { return vaddvq_f32(a); }
+#else
 template<> EIGEN_STRONG_INLINE float predux<Packet2f>(const Packet2f& a) { return vget_lane_f32(vpadd_f32(a,a), 0); }
 template<> EIGEN_STRONG_INLINE float predux<Packet4f>(const Packet4f& a)
 {
   const float32x2_t sum = vadd_f32(vget_low_f32(a), vget_high_f32(a));
   return vget_lane_f32(vpadd_f32(sum, sum), 0);
 }
+#endif
 template<> EIGEN_STRONG_INLINE int8_t predux<Packet4c>(const Packet4c& a)
 {
   const int8x8_t a_dup = vreinterpret_s8_s32(vdup_n_s32(a));
@@ -2399,6 +2404,10 @@
   sum = vpadd_s8(sum, sum);
   return vget_lane_s8(sum, 0);
 }
+#if EIGEN_ARCH_ARM64
+template<> EIGEN_STRONG_INLINE int8_t predux<Packet8c>(const Packet8c& a) { return vaddv_s8(a); }
+template<> EIGEN_STRONG_INLINE int8_t predux<Packet16c>(const Packet16c& a) { return vaddvq_s8(a); }
+#else
 template<> EIGEN_STRONG_INLINE int8_t predux<Packet8c>(const Packet8c& a)
 {
   int8x8_t sum = vpadd_s8(a,a);
@@ -2414,6 +2423,7 @@
   sum = vpadd_s8(sum, sum);
   return vget_lane_s8(sum, 0);
 }
+#endif
 template<> EIGEN_STRONG_INLINE uint8_t predux<Packet4uc>(const Packet4uc& a)
 {
   const uint8x8_t a_dup = vreinterpret_u8_u32(vdup_n_u32(a));
@@ -2421,6 +2431,20 @@
   sum = vpadd_u8(sum, sum);
   return vget_lane_u8(sum, 0);
 }
+#if EIGEN_ARCH_ARM64
+template<> EIGEN_STRONG_INLINE uint8_t predux<Packet8uc>(const Packet8uc& a) { return vaddv_u8(a); }
+template<> EIGEN_STRONG_INLINE uint8_t predux<Packet16uc>(const Packet16uc& a) { return vaddvq_u8(a); }
+template<> EIGEN_STRONG_INLINE int16_t predux<Packet4s>(const Packet4s& a) { return vaddv_s16(a); }
+template<> EIGEN_STRONG_INLINE int16_t predux<Packet8s>(const Packet8s& a) { return vaddvq_s16(a); }
+template<> EIGEN_STRONG_INLINE uint16_t predux<Packet4us>(const Packet4us& a) { return vaddv_u16(a); }
+template<> EIGEN_STRONG_INLINE uint16_t predux<Packet8us>(const Packet8us& a) { return vaddvq_u16(a); }
+template<> EIGEN_STRONG_INLINE int32_t predux<Packet2i>(const Packet2i& a) { return vaddv_s32(a); }
+template<> EIGEN_STRONG_INLINE int32_t predux<Packet4i>(const Packet4i& a) { return vaddvq_s32(a); }
+template<> EIGEN_STRONG_INLINE uint32_t predux<Packet2ui>(const Packet2ui& a) { return vaddv_u32(a); }
+template<> EIGEN_STRONG_INLINE uint32_t predux<Packet4ui>(const Packet4ui& a) { return vaddvq_u32(a); }
+template<> EIGEN_STRONG_INLINE int64_t predux<Packet2l>(const Packet2l& a) { return vaddvq_s64(a); }
+template<> EIGEN_STRONG_INLINE uint64_t predux<Packet2ul>(const Packet2ul& a) { return vaddvq_u64(a); }
+#else
 template<> EIGEN_STRONG_INLINE uint8_t predux<Packet8uc>(const Packet8uc& a)
 {
   uint8x8_t sum = vpadd_u8(a,a);
@@ -2476,6 +2500,7 @@
 { return vgetq_lane_s64(a, 0) + vgetq_lane_s64(a, 1); }
 template<> EIGEN_STRONG_INLINE uint64_t predux<Packet2ul>(const Packet2ul& a)
 { return vgetq_lane_u64(a, 0) + vgetq_lane_u64(a, 1); }
+#endif
 
 template<> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Packet4c predux_half_dowto4(const Packet8c& a)
 {
@@ -2576,6 +2601,10 @@
 { return vgetq_lane_u64(a, 0) * vgetq_lane_u64(a, 1); }
 
 // min
+#if EIGEN_ARCH_ARM64
+template<> EIGEN_STRONG_INLINE float predux_min<Packet2f>(const Packet2f& a) { return vminv_f32(a); }
+template<> EIGEN_STRONG_INLINE float predux_min<Packet4f>(const Packet4f& a) { return vminvq_f32(a); }
+#else
 template<> EIGEN_STRONG_INLINE float predux_min<Packet2f>(const Packet2f& a)
 { return vget_lane_f32(vpmin_f32(a,a), 0); }
 template<> EIGEN_STRONG_INLINE float predux_min<Packet4f>(const Packet4f& a)
@@ -2583,6 +2612,7 @@
   const float32x2_t min = vmin_f32(vget_low_f32(a), vget_high_f32(a));
   return vget_lane_f32(vpmin_f32(min, min), 0);
 }
+#endif
 template<> EIGEN_STRONG_INLINE int8_t predux_min<Packet4c>(const Packet4c& a)
 {
   const int8x8_t a_dup = vreinterpret_s8_s32(vdup_n_s32(a));
@@ -2590,6 +2620,10 @@
   min = vpmin_s8(min, min);
   return vget_lane_s8(min, 0);
 }
+#if EIGEN_ARCH_ARM64
+template<> EIGEN_STRONG_INLINE int8_t predux_min<Packet8c>(const Packet8c& a) { return vminv_s8(a); }
+template<> EIGEN_STRONG_INLINE int8_t predux_min<Packet16c>(const Packet16c& a) { return vminvq_s8(a); }
+#else
 template<> EIGEN_STRONG_INLINE int8_t predux_min<Packet8c>(const Packet8c& a)
 {
   int8x8_t min = vpmin_s8(a,a);
@@ -2605,6 +2639,7 @@
   min = vpmin_s8(min, min);
   return vget_lane_s8(min, 0);
 }
+#endif
 template<> EIGEN_STRONG_INLINE uint8_t predux_min<Packet4uc>(const Packet4uc& a)
 {
   const uint8x8_t a_dup = vreinterpret_u8_u32(vdup_n_u32(a));
@@ -2612,6 +2647,18 @@
   min = vpmin_u8(min, min);
   return vget_lane_u8(min, 0);
 }
+#if EIGEN_ARCH_ARM64
+template<> EIGEN_STRONG_INLINE uint8_t predux_min<Packet8uc>(const Packet8uc& a) { return vminv_u8(a); }
+template<> EIGEN_STRONG_INLINE uint8_t predux_min<Packet16uc>(const Packet16uc& a) { return vminvq_u8(a); }
+template<> EIGEN_STRONG_INLINE int16_t predux_min<Packet4s>(const Packet4s& a) { return vminv_s16(a); }
+template<> EIGEN_STRONG_INLINE int16_t predux_min<Packet8s>(const Packet8s& a) { return vminvq_s16(a); }
+template<> EIGEN_STRONG_INLINE uint16_t predux_min<Packet4us>(const Packet4us& a) { return vminv_u16(a); }
+template<> EIGEN_STRONG_INLINE uint16_t predux_min<Packet8us>(const Packet8us& a) { return vminvq_u16(a); }
+template<> EIGEN_STRONG_INLINE int32_t predux_min<Packet2i>(const Packet2i& a) { return vminv_s32(a); }
+template<> EIGEN_STRONG_INLINE int32_t predux_min<Packet4i>(const Packet4i& a) { return vminvq_s32(a); }
+template<> EIGEN_STRONG_INLINE uint32_t predux_min<Packet2ui>(const Packet2ui& a) { return vminv_u32(a); }
+template<> EIGEN_STRONG_INLINE uint32_t predux_min<Packet4ui>(const Packet4ui& a) { return vminvq_u32(a); }
+#else
 template<> EIGEN_STRONG_INLINE uint8_t predux_min<Packet8uc>(const Packet8uc& a)
 {
   uint8x8_t min = vpmin_u8(a,a);
@@ -2665,12 +2712,17 @@
   const uint32x2_t min = vmin_u32(vget_low_u32(a), vget_high_u32(a));
   return vget_lane_u32(vpmin_u32(min, min), 0);
 }
+#endif
 template<> EIGEN_STRONG_INLINE int64_t predux_min<Packet2l>(const Packet2l& a)
 { return (std::min)(vgetq_lane_s64(a, 0), vgetq_lane_s64(a, 1)); }
 template<> EIGEN_STRONG_INLINE uint64_t predux_min<Packet2ul>(const Packet2ul& a)
 { return (std::min)(vgetq_lane_u64(a, 0), vgetq_lane_u64(a, 1)); }
 
 // max
+#if EIGEN_ARCH_ARM64
+template<> EIGEN_STRONG_INLINE float predux_max<Packet2f>(const Packet2f& a) { return vmaxv_f32(a); }
+template<> EIGEN_STRONG_INLINE float predux_max<Packet4f>(const Packet4f& a) { return vmaxvq_f32(a); }
+#else
 template<> EIGEN_STRONG_INLINE float predux_max<Packet2f>(const Packet2f& a)
 { return vget_lane_f32(vpmax_f32(a,a), 0); }
 template<> EIGEN_STRONG_INLINE float predux_max<Packet4f>(const Packet4f& a)
@@ -2678,6 +2730,7 @@
   const float32x2_t max = vmax_f32(vget_low_f32(a), vget_high_f32(a));
   return vget_lane_f32(vpmax_f32(max, max), 0);
 }
+#endif
 template<> EIGEN_STRONG_INLINE int8_t predux_max<Packet4c>(const Packet4c& a)
 {
   const int8x8_t a_dup = vreinterpret_s8_s32(vdup_n_s32(a));
@@ -2685,6 +2738,10 @@
   max = vpmax_s8(max, max);
   return vget_lane_s8(max, 0);
 }
+#if EIGEN_ARCH_ARM64
+template<> EIGEN_STRONG_INLINE int8_t predux_max<Packet8c>(const Packet8c& a) { return vmaxv_s8(a); }
+template<> EIGEN_STRONG_INLINE int8_t predux_max<Packet16c>(const Packet16c& a) { return vmaxvq_s8(a); }
+#else
 template<> EIGEN_STRONG_INLINE int8_t predux_max<Packet8c>(const Packet8c& a)
 {
   int8x8_t max = vpmax_s8(a,a);
@@ -2700,6 +2757,7 @@
   max = vpmax_s8(max, max);
   return vget_lane_s8(max, 0);
 }
+#endif
 template<> EIGEN_STRONG_INLINE uint8_t predux_max<Packet4uc>(const Packet4uc& a)
 {
   const uint8x8_t a_dup = vreinterpret_u8_u32(vdup_n_u32(a));
@@ -2707,6 +2765,18 @@
   max = vpmax_u8(max, max);
   return vget_lane_u8(max, 0);
 }
+#if EIGEN_ARCH_ARM64
+template<> EIGEN_STRONG_INLINE uint8_t predux_max<Packet8uc>(const Packet8uc& a) { return vmaxv_u8(a); }
+template<> EIGEN_STRONG_INLINE uint8_t predux_max<Packet16uc>(const Packet16uc& a) { return vmaxvq_u8(a); }
+template<> EIGEN_STRONG_INLINE int16_t predux_max<Packet4s>(const Packet4s& a) { return vmaxv_s16(a); }
+template<> EIGEN_STRONG_INLINE int16_t predux_max<Packet8s>(const Packet8s& a) { return vmaxvq_s16(a); }
+template<> EIGEN_STRONG_INLINE uint16_t predux_max<Packet4us>(const Packet4us& a) { return vmaxv_u16(a); }
+template<> EIGEN_STRONG_INLINE uint16_t predux_max<Packet8us>(const Packet8us& a) { return vmaxvq_u16(a); }
+template<> EIGEN_STRONG_INLINE int32_t predux_max<Packet2i>(const Packet2i& a) { return vmaxv_s32(a); }
+template<> EIGEN_STRONG_INLINE int32_t predux_max<Packet4i>(const Packet4i& a) { return vmaxvq_s32(a); }
+template<> EIGEN_STRONG_INLINE uint32_t predux_max<Packet2ui>(const Packet2ui& a) { return vmaxv_u32(a); }
+template<> EIGEN_STRONG_INLINE uint32_t predux_max<Packet4ui>(const Packet4ui& a) { return vmaxvq_u32(a); }
+#else
 template<> EIGEN_STRONG_INLINE uint8_t predux_max<Packet8uc>(const Packet8uc& a)
 {
   uint8x8_t max = vpmax_u8(a,a);
@@ -2760,6 +2830,7 @@
   const uint32x2_t max = vmax_u32(vget_low_u32(a), vget_high_u32(a));
   return vget_lane_u32(vpmax_u32(max, max), 0);
 }
+#endif
 template<> EIGEN_STRONG_INLINE int64_t predux_max<Packet2l>(const Packet2l& a)
 { return (std::max)(vgetq_lane_s64(a, 0), vgetq_lane_s64(a, 1)); }
 template<> EIGEN_STRONG_INLINE uint64_t predux_max<Packet2ul>(const Packet2ul& a)
@@ -3848,14 +3919,8 @@
 
 template<> EIGEN_STRONG_INLINE Packet2d pabs(const Packet2d& a) { return vabsq_f64(a); }
 
-#if EIGEN_COMP_CLANG && defined(__apple_build_version__)
-// workaround ICE, see bug 907
 template<> EIGEN_STRONG_INLINE double predux<Packet2d>(const Packet2d& a)
-{ return (vget_low_f64(a) + vget_high_f64(a))[0]; }
-#else
-template<> EIGEN_STRONG_INLINE double predux<Packet2d>(const Packet2d& a)
-{ return vget_lane_f64(vget_low_f64(a) + vget_high_f64(a), 0); }
-#endif
+{ return vaddvq_f64(a); }
 
 // Other reduction functions:
 // mul
@@ -3869,11 +3934,11 @@
 
 // min
 template<> EIGEN_STRONG_INLINE double predux_min<Packet2d>(const Packet2d& a)
-{ return vgetq_lane_f64(vpminq_f64(a,a), 0); }
+{ return vminvq_f64(a); }
 
 // max
 template<> EIGEN_STRONG_INLINE double predux_max<Packet2d>(const Packet2d& a)
-{ return vgetq_lane_f64(vpmaxq_f64(a,a), 0); }
+{ return vmaxvq_f64(a); }
 
 
 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void
@@ -3920,8 +3985,6 @@
 
 template<> EIGEN_STRONG_INLINE Packet2d psqrt(const Packet2d& _x){ return vsqrtq_f64(_x); }
 
-#endif // EIGEN_ARCH_ARM64
-
 // Do we have an fp16 types and supporting Neon intrinsics?
 #if EIGEN_HAS_ARM64_FP16_VECTOR_ARITHMETIC
 typedef float16x4_t Packet4hf;
@@ -4478,51 +4541,29 @@
 
 template <>
 EIGEN_STRONG_INLINE Eigen::half predux_min<Packet8hf>(const Packet8hf& a) {
-  float16x4_t a_lo, a_hi, min;
-
-  a_lo = vget_low_f16(a);
-  a_hi = vget_high_f16(a);
-  min = vpmin_f16(a_lo, a_hi);
-  min = vpmin_f16(min, min);
-  min = vpmin_f16(min, min);
-
   Eigen::half h;
-  h.x = vget_lane_f16(min, 0);
+  h.x = vminvq_f16(a);
   return h;
 }
 
 template <>
 EIGEN_STRONG_INLINE Eigen::half predux_min<Packet4hf>(const Packet4hf& a) {
-  Packet4hf tmp;
-  tmp = vpmin_f16(a, a);
-  tmp = vpmin_f16(tmp, tmp);
   Eigen::half h;
-  h.x = vget_lane_f16(tmp, 0);
+  h.x = vminv_f16(a);
   return h;
 }
 
 template <>
 EIGEN_STRONG_INLINE Eigen::half predux_max<Packet8hf>(const Packet8hf& a) {
-  float16x4_t a_lo, a_hi, max;
-
-  a_lo = vget_low_f16(a);
-  a_hi = vget_high_f16(a);
-  max = vpmax_f16(a_lo, a_hi);
-  max = vpmax_f16(max, max);
-  max = vpmax_f16(max, max);
-
   Eigen::half h;
-  h.x = vget_lane_f16(max, 0);
+  h.x = vmaxvq_f16(a);
   return h;
 }
 
 template <>
 EIGEN_STRONG_INLINE Eigen::half predux_max<Packet4hf>(const Packet4hf& a) {
-  Packet4hf tmp;
-  tmp = vpmax_f16(a, a);
-  tmp = vpmax_f16(tmp, tmp);
   Eigen::half h;
-  h.x = vget_lane_f16(tmp, 0);
+  h.x = vmaxv_f16(a);
   return h;
 }
 
@@ -4582,6 +4623,8 @@
 }
 #endif // end EIGEN_HAS_ARM64_FP16_VECTOR_ARITHMETIC
 
+#endif // EIGEN_ARCH_ARM64
+
 } // end namespace internal
 
 } // end namespace Eigen
diff --git a/Eigen/src/Core/arch/SSE/PacketMath.h b/Eigen/src/Core/arch/SSE/PacketMath.h
index db102c7..d658f65 100755
--- a/Eigen/src/Core/arch/SSE/PacketMath.h
+++ b/Eigen/src/Core/arch/SSE/PacketMath.h
@@ -180,7 +180,6 @@
     HasRint = 1
   };
 };
-#endif
 template<> struct packet_traits<int>    : default_packet_traits
 {
   typedef Packet4i type;
@@ -194,7 +193,7 @@
     HasBlend = 1
   };
 };
-
+#endif
 template<> struct packet_traits<bool> : default_packet_traits
 {
   typedef Packet16b type;
@@ -233,7 +232,7 @@
 template<> struct unpacket_traits<Packet4i> {
   typedef int       type;
   typedef Packet4i  half;
-  enum {size=4, alignment=Aligned16, vectorizable=false, masked_load_available=false, masked_store_available=false};
+  enum {size=4, alignment=Aligned16, vectorizable=true, masked_load_available=false, masked_store_available=false};
 };
 template<> struct unpacket_traits<Packet16b> {
   typedef bool       type;
diff --git a/Eigen/src/Core/products/GeneralBlockPanelKernel.h b/Eigen/src/Core/products/GeneralBlockPanelKernel.h
index f35b760..ed26b9a 100644
--- a/Eigen/src/Core/products/GeneralBlockPanelKernel.h
+++ b/Eigen/src/Core/products/GeneralBlockPanelKernel.h
@@ -21,7 +21,7 @@
   GEBPPacketQuarter
 };
 
-template<typename _LhsScalar, typename _RhsScalar, bool _ConjLhs=false, bool _ConjRhs=false, int Arch=Architecture::Target, int _PacketSize=GEBPPacketFull>
+template<typename LhsScalar_, typename RhsScalar_, bool ConjLhs_=false, bool ConjRhs_=false, int Arch=Architecture::Target, int PacketSize_=GEBPPacketFull>
 class gebp_traits;
 
 
@@ -414,21 +414,21 @@
  *  cplx*real : unpack rhs to constant packets, ...
  *  real*cplx : load lhs as (a0,a0,a1,a1), and mul as usual
  */
-template<typename _LhsScalar, typename _RhsScalar, bool _ConjLhs, bool _ConjRhs, int Arch, int _PacketSize>
+template<typename LhsScalar_, typename RhsScalar_, bool ConjLhs_, bool ConjRhs_, int Arch, int PacketSize_>
 class gebp_traits
 {
 public:
-  typedef _LhsScalar LhsScalar;
-  typedef _RhsScalar RhsScalar;
+  typedef LhsScalar_ LhsScalar;
+  typedef RhsScalar_ RhsScalar;
   typedef typename ScalarBinaryOpTraits<LhsScalar, RhsScalar>::ReturnType ResScalar;
 
-  PACKET_DECL_COND_PREFIX(_, Lhs, _PacketSize);
-  PACKET_DECL_COND_PREFIX(_, Rhs, _PacketSize);
-  PACKET_DECL_COND_PREFIX(_, Res, _PacketSize);
+  PACKET_DECL_COND_PREFIX(_, Lhs, PacketSize_);
+  PACKET_DECL_COND_PREFIX(_, Rhs, PacketSize_);
+  PACKET_DECL_COND_PREFIX(_, Res, PacketSize_);
 
   enum {
-    ConjLhs = _ConjLhs,
-    ConjRhs = _ConjRhs,
+    ConjLhs = ConjLhs_,
+    ConjRhs = ConjRhs_,
     Vectorizable = unpacket_traits<_LhsPacket>::vectorizable && unpacket_traits<_RhsPacket>::vectorizable,
     LhsPacketSize = Vectorizable ? unpacket_traits<_LhsPacket>::size : 1,
     RhsPacketSize = Vectorizable ? unpacket_traits<_RhsPacket>::size : 1,
@@ -543,20 +543,20 @@
 
 };
 
-template<typename RealScalar, bool _ConjLhs, int Arch, int _PacketSize>
-class gebp_traits<std::complex<RealScalar>, RealScalar, _ConjLhs, false, Arch, _PacketSize>
+template<typename RealScalar, bool ConjLhs_, int Arch, int PacketSize_>
+class gebp_traits<std::complex<RealScalar>, RealScalar, ConjLhs_, false, Arch, PacketSize_>
 {
 public:
   typedef std::complex<RealScalar> LhsScalar;
   typedef RealScalar RhsScalar;
   typedef typename ScalarBinaryOpTraits<LhsScalar, RhsScalar>::ReturnType ResScalar;
 
-  PACKET_DECL_COND_PREFIX(_, Lhs, _PacketSize);
-  PACKET_DECL_COND_PREFIX(_, Rhs, _PacketSize);
-  PACKET_DECL_COND_PREFIX(_, Res, _PacketSize);
+  PACKET_DECL_COND_PREFIX(_, Lhs, PacketSize_);
+  PACKET_DECL_COND_PREFIX(_, Rhs, PacketSize_);
+  PACKET_DECL_COND_PREFIX(_, Res, PacketSize_);
 
   enum {
-    ConjLhs = _ConjLhs,
+    ConjLhs = ConjLhs_,
     ConjRhs = false,
     Vectorizable = unpacket_traits<_LhsPacket>::vectorizable && unpacket_traits<_RhsPacket>::vectorizable,
     LhsPacketSize = Vectorizable ? unpacket_traits<_LhsPacket>::size : 1,
@@ -754,8 +754,8 @@
 //   return res;
 // }
 
-template<typename RealScalar, bool _ConjLhs, bool _ConjRhs, int Arch, int _PacketSize>
-class gebp_traits<std::complex<RealScalar>, std::complex<RealScalar>, _ConjLhs, _ConjRhs, Arch, _PacketSize >
+template<typename RealScalar, bool ConjLhs_, bool ConjRhs_, int Arch, int PacketSize_>
+class gebp_traits<std::complex<RealScalar>, std::complex<RealScalar>, ConjLhs_, ConjRhs_, Arch, PacketSize_ >
 {
 public:
   typedef std::complex<RealScalar>  Scalar;
@@ -763,15 +763,15 @@
   typedef std::complex<RealScalar>  RhsScalar;
   typedef std::complex<RealScalar>  ResScalar;
   
-  PACKET_DECL_COND_PREFIX(_, Lhs, _PacketSize);
-  PACKET_DECL_COND_PREFIX(_, Rhs, _PacketSize);
-  PACKET_DECL_COND_PREFIX(_, Res, _PacketSize);
-  PACKET_DECL_COND(Real, _PacketSize);
-  PACKET_DECL_COND_SCALAR(_PacketSize);
+  PACKET_DECL_COND_PREFIX(_, Lhs, PacketSize_);
+  PACKET_DECL_COND_PREFIX(_, Rhs, PacketSize_);
+  PACKET_DECL_COND_PREFIX(_, Res, PacketSize_);
+  PACKET_DECL_COND(Real, PacketSize_);
+  PACKET_DECL_COND_SCALAR(PacketSize_);
 
   enum {
-    ConjLhs = _ConjLhs,
-    ConjRhs = _ConjRhs,
+    ConjLhs = ConjLhs_,
+    ConjRhs = ConjRhs_,
     Vectorizable = unpacket_traits<RealPacket>::vectorizable
                 && unpacket_traits<ScalarPacket>::vectorizable,
     ResPacketSize   = Vectorizable ? unpacket_traits<_ResPacket>::size : 1,
@@ -920,8 +920,8 @@
   conj_helper<LhsScalar,RhsScalar,ConjLhs,ConjRhs> cj;
 };
 
-template<typename RealScalar, bool _ConjRhs, int Arch, int _PacketSize>
-class gebp_traits<RealScalar, std::complex<RealScalar>, false, _ConjRhs, Arch, _PacketSize >
+template<typename RealScalar, bool ConjRhs_, int Arch, int PacketSize_>
+class gebp_traits<RealScalar, std::complex<RealScalar>, false, ConjRhs_, Arch, PacketSize_ >
 {
 public:
   typedef std::complex<RealScalar>  Scalar;
@@ -929,11 +929,11 @@
   typedef Scalar      RhsScalar;
   typedef Scalar      ResScalar;
 
-  PACKET_DECL_COND_PREFIX(_, Lhs, _PacketSize);
-  PACKET_DECL_COND_PREFIX(_, Rhs, _PacketSize);
-  PACKET_DECL_COND_PREFIX(_, Res, _PacketSize);
-  PACKET_DECL_COND_PREFIX(_, Real, _PacketSize);
-  PACKET_DECL_COND_SCALAR_PREFIX(_, _PacketSize);
+  PACKET_DECL_COND_PREFIX(_, Lhs, PacketSize_);
+  PACKET_DECL_COND_PREFIX(_, Rhs, PacketSize_);
+  PACKET_DECL_COND_PREFIX(_, Res, PacketSize_);
+  PACKET_DECL_COND_PREFIX(_, Real, PacketSize_);
+  PACKET_DECL_COND_SCALAR_PREFIX(_, PacketSize_);
 
 #undef PACKET_DECL_COND_SCALAR_PREFIX
 #undef PACKET_DECL_COND_PREFIX
@@ -942,7 +942,7 @@
 
   enum {
     ConjLhs = false,
-    ConjRhs = _ConjRhs,
+    ConjRhs = ConjRhs_,
     Vectorizable = unpacket_traits<_RealPacket>::vectorizable
                 && unpacket_traits<_ScalarPacket>::vectorizable,
     LhsPacketSize = Vectorizable ? unpacket_traits<_LhsPacket>::size : 1,
diff --git a/Eigen/src/Core/products/GeneralMatrixMatrix.h b/Eigen/src/Core/products/GeneralMatrixMatrix.h
index caa65fc..62a6aaa 100644
--- a/Eigen/src/Core/products/GeneralMatrixMatrix.h
+++ b/Eigen/src/Core/products/GeneralMatrixMatrix.h
@@ -14,7 +14,7 @@
 
 namespace internal {
 
-template<typename _LhsScalar, typename _RhsScalar> class level3_blocking;
+template<typename LhsScalar_, typename RhsScalar_> class level3_blocking;
 
 /* Specialization for a row-major destination matrix => simple transposition of the product */
 template<
@@ -247,11 +247,11 @@
 template<int StorageOrder, typename LhsScalar, typename RhsScalar, int MaxRows, int MaxCols, int MaxDepth, int KcFactor=1,
 bool FiniteAtCompileTime = MaxRows!=Dynamic && MaxCols!=Dynamic && MaxDepth != Dynamic> class gemm_blocking_space;
 
-template<typename _LhsScalar, typename _RhsScalar>
+template<typename LhsScalar_, typename RhsScalar_>
 class level3_blocking
 {
-    typedef _LhsScalar LhsScalar;
-    typedef _RhsScalar RhsScalar;
+    typedef LhsScalar_ LhsScalar;
+    typedef RhsScalar_ RhsScalar;
 
   protected:
     LhsScalar* m_blockA;
@@ -275,19 +275,19 @@
     inline RhsScalar* blockB() { return m_blockB; }
 };
 
-template<int StorageOrder, typename _LhsScalar, typename _RhsScalar, int MaxRows, int MaxCols, int MaxDepth, int KcFactor>
-class gemm_blocking_space<StorageOrder,_LhsScalar,_RhsScalar,MaxRows, MaxCols, MaxDepth, KcFactor, true /* == FiniteAtCompileTime */>
+template<int StorageOrder, typename LhsScalar_, typename RhsScalar_, int MaxRows, int MaxCols, int MaxDepth, int KcFactor>
+class gemm_blocking_space<StorageOrder,LhsScalar_,RhsScalar_,MaxRows, MaxCols, MaxDepth, KcFactor, true /* == FiniteAtCompileTime */>
   : public level3_blocking<
-      typename conditional<StorageOrder==RowMajor,_RhsScalar,_LhsScalar>::type,
-      typename conditional<StorageOrder==RowMajor,_LhsScalar,_RhsScalar>::type>
+      typename conditional<StorageOrder==RowMajor,RhsScalar_,LhsScalar_>::type,
+      typename conditional<StorageOrder==RowMajor,LhsScalar_,RhsScalar_>::type>
 {
     enum {
       Transpose = StorageOrder==RowMajor,
       ActualRows = Transpose ? MaxCols : MaxRows,
       ActualCols = Transpose ? MaxRows : MaxCols
     };
-    typedef typename conditional<Transpose,_RhsScalar,_LhsScalar>::type LhsScalar;
-    typedef typename conditional<Transpose,_LhsScalar,_RhsScalar>::type RhsScalar;
+    typedef typename conditional<Transpose,RhsScalar_,LhsScalar_>::type LhsScalar;
+    typedef typename conditional<Transpose,LhsScalar_,RhsScalar_>::type RhsScalar;
     typedef gebp_traits<LhsScalar,RhsScalar> Traits;
     enum {
       SizeA = ActualRows * MaxDepth,
@@ -326,17 +326,17 @@
     inline void allocateAll() {}
 };
 
-template<int StorageOrder, typename _LhsScalar, typename _RhsScalar, int MaxRows, int MaxCols, int MaxDepth, int KcFactor>
-class gemm_blocking_space<StorageOrder,_LhsScalar,_RhsScalar,MaxRows, MaxCols, MaxDepth, KcFactor, false>
+template<int StorageOrder, typename LhsScalar_, typename RhsScalar_, int MaxRows, int MaxCols, int MaxDepth, int KcFactor>
+class gemm_blocking_space<StorageOrder,LhsScalar_,RhsScalar_,MaxRows, MaxCols, MaxDepth, KcFactor, false>
   : public level3_blocking<
-      typename conditional<StorageOrder==RowMajor,_RhsScalar,_LhsScalar>::type,
-      typename conditional<StorageOrder==RowMajor,_LhsScalar,_RhsScalar>::type>
+      typename conditional<StorageOrder==RowMajor,RhsScalar_,LhsScalar_>::type,
+      typename conditional<StorageOrder==RowMajor,LhsScalar_,RhsScalar_>::type>
 {
     enum {
       Transpose = StorageOrder==RowMajor
     };
-    typedef typename conditional<Transpose,_RhsScalar,_LhsScalar>::type LhsScalar;
-    typedef typename conditional<Transpose,_LhsScalar,_RhsScalar>::type RhsScalar;
+    typedef typename conditional<Transpose,RhsScalar_,LhsScalar_>::type LhsScalar;
+    typedef typename conditional<Transpose,LhsScalar_,RhsScalar_>::type RhsScalar;
     typedef gebp_traits<LhsScalar,RhsScalar> Traits;
 
     Index m_sizeA;
diff --git a/Eigen/src/Core/products/GeneralMatrixVector.h b/Eigen/src/Core/products/GeneralMatrixVector.h
index dfb6aeb..0fa5736 100644
--- a/Eigen/src/Core/products/GeneralMatrixVector.h
+++ b/Eigen/src/Core/products/GeneralMatrixVector.h
@@ -29,7 +29,7 @@
 template <typename T1, typename T2, typename T3>
 struct gemv_packet_cond<GEMVPacketHalf, T1, T2, T3> { typedef T2 type; };
 
-template<typename LhsScalar, typename RhsScalar, int _PacketSize=GEMVPacketFull>
+template<typename LhsScalar, typename RhsScalar, int PacketSize_=GEMVPacketFull>
 class gemv_traits
 {
   typedef typename ScalarBinaryOpTraits<LhsScalar, RhsScalar>::ReturnType ResScalar;
@@ -41,9 +41,9 @@
                                     typename unpacket_traits<typename packet_traits<name ## Scalar>::half>::half>::type \
   prefix ## name ## Packet
 
-  PACKET_DECL_COND_PREFIX(_, Lhs, _PacketSize);
-  PACKET_DECL_COND_PREFIX(_, Rhs, _PacketSize);
-  PACKET_DECL_COND_PREFIX(_, Res, _PacketSize);
+  PACKET_DECL_COND_PREFIX(_, Lhs, PacketSize_);
+  PACKET_DECL_COND_PREFIX(_, Rhs, PacketSize_);
+  PACKET_DECL_COND_PREFIX(_, Res, PacketSize_);
 #undef PACKET_DECL_COND_PREFIX
 
 public:
diff --git a/Eigen/src/Core/util/BlasUtil.h b/Eigen/src/Core/util/BlasUtil.h
index e16a564..5bb86e5 100755
--- a/Eigen/src/Core/util/BlasUtil.h
+++ b/Eigen/src/Core/util/BlasUtil.h
@@ -308,15 +308,15 @@
   }
 
   // storePacketBlock_helper defines a way to access values inside the PacketBlock, this is essentially required by the Complex types.
-  template<typename SubPacket, typename ScalarT, int n, int idx>
+  template<typename SubPacket, typename Scalar_, int n, int idx>
   struct storePacketBlock_helper
   {
-    storePacketBlock_helper<SubPacket, ScalarT, n, idx-1> spbh;
+    storePacketBlock_helper<SubPacket, Scalar_, n, idx-1> spbh;
     EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE void store(const blas_data_mapper<Scalar, Index, StorageOrder, AlignmentType, Incr>* sup, Index i, Index j, const PacketBlock<SubPacket, n>& block) const {
       spbh.store(sup, i,j,block);
       for(int l = 0; l < unpacket_traits<SubPacket>::size; l++)
       {
-        ScalarT *v = &sup->operator()(i+l, j+idx);
+        Scalar_ *v = &sup->operator()(i+l, j+idx);
         *v = block.packet[idx][l];
       }
     }
@@ -352,8 +352,8 @@
     }
   };
 
-  template<typename SubPacket, typename ScalarT, int n>
-  struct storePacketBlock_helper<SubPacket, ScalarT, n, -1>
+  template<typename SubPacket, typename Scalar_, int n>
+  struct storePacketBlock_helper<SubPacket, Scalar_, n, -1>
   {
     EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE void store(const blas_data_mapper<Scalar, Index, StorageOrder, AlignmentType, Incr>*, Index, Index, const PacketBlock<SubPacket, n>& ) const {
     }
diff --git a/Eigen/src/Core/util/Constants.h b/Eigen/src/Core/util/Constants.h
index 35dcaa7..b93f689 100644
--- a/Eigen/src/Core/util/Constants.h
+++ b/Eigen/src/Core/util/Constants.h
@@ -312,7 +312,7 @@
 };
 
 /** \ingroup enums
-  * Enum containing possible values for the \p _Options template parameter of
+  * Enum containing possible values for the \p Options_ template parameter of
   * Matrix, Array and BandMatrix. */
 enum StorageOptions {
   /** Storage order is column major (see \ref TopicStorageOrders). */
diff --git a/Eigen/src/Core/util/DisableStupidWarnings.h b/Eigen/src/Core/util/DisableStupidWarnings.h
index fe0cfec..fa33689 100755
--- a/Eigen/src/Core/util/DisableStupidWarnings.h
+++ b/Eigen/src/Core/util/DisableStupidWarnings.h
@@ -4,6 +4,7 @@
 #ifdef _MSC_VER
   // 4100 - unreferenced formal parameter (occurred e.g. in aligned_allocator::destroy(pointer p))
   // 4101 - unreferenced local variable
+  // 4127 - conditional expression is constant
   // 4181 - qualifier applied to reference type ignored
   // 4211 - nonstandard extension used : redefined extern to static
   // 4244 - 'argument' : conversion from 'type1' to 'type2', possible loss of data
@@ -19,7 +20,7 @@
   #ifndef EIGEN_PERMANENTLY_DISABLE_STUPID_WARNINGS
     #pragma warning( push )
   #endif
-  #pragma warning( disable : 4100 4101 4181 4211 4244 4273 4324 4503 4512 4522 4700 4714 4717 4800)
+  #pragma warning( disable : 4100 4101 4127 4181 4211 4244 4273 4324 4503 4512 4522 4700 4714 4717 4800)
 
 #elif defined __INTEL_COMPILER
   // 2196 - routine is both "inline" and "noinline" ("noinline" assumed)
diff --git a/Eigen/src/Core/util/ForwardDeclarations.h b/Eigen/src/Core/util/ForwardDeclarations.h
index 2f9cc44..90db26c 100644
--- a/Eigen/src/Core/util/ForwardDeclarations.h
+++ b/Eigen/src/Core/util/ForwardDeclarations.h
@@ -49,24 +49,24 @@
 template<typename Derived> class PlainObjectBase;
 template<typename Derived, int Level> class DenseCoeffsBase;
 
-template<typename _Scalar, int _Rows, int _Cols,
-         int _Options = AutoAlign |
+template<typename Scalar_, int Rows_, int Cols_,
+         int Options_ = AutoAlign |
 #if EIGEN_GNUC_AT(3,4)
     // workaround a bug in at least gcc 3.4.6
     // the innermost ?: ternary operator is misparsed. We write it slightly
     // differently and this makes gcc 3.4.6 happy, but it's ugly.
     // The error would only show up with EIGEN_DEFAULT_TO_ROW_MAJOR is defined
     // (when EIGEN_DEFAULT_MATRIX_STORAGE_ORDER_OPTION is RowMajor)
-                          ( (_Rows==1 && _Cols!=1) ? Eigen::RowMajor
-                          : !(_Cols==1 && _Rows!=1) ?  EIGEN_DEFAULT_MATRIX_STORAGE_ORDER_OPTION
+                          ( (Rows_==1 && Cols_!=1) ? Eigen::RowMajor
+                          : !(Cols_==1 && Rows_!=1) ?  EIGEN_DEFAULT_MATRIX_STORAGE_ORDER_OPTION
                           : Eigen::ColMajor ),
 #else
-                          ( (_Rows==1 && _Cols!=1) ? Eigen::RowMajor
-                          : (_Cols==1 && _Rows!=1) ? Eigen::ColMajor
+                          ( (Rows_==1 && Cols_!=1) ? Eigen::RowMajor
+                          : (Cols_==1 && Rows_!=1) ? Eigen::ColMajor
                           : EIGEN_DEFAULT_MATRIX_STORAGE_ORDER_OPTION ),
 #endif
-         int _MaxRows = _Rows,
-         int _MaxCols = _Cols
+         int MaxRows_ = Rows_,
+         int MaxCols_ = Cols_
 > class Matrix;
 
 template<typename Derived> class MatrixBase;
@@ -97,15 +97,15 @@
 
 template<typename Derived> class DiagonalBase;
 template<typename _DiagonalVectorType> class DiagonalWrapper;
-template<typename _Scalar, int SizeAtCompileTime, int MaxSizeAtCompileTime=SizeAtCompileTime> class DiagonalMatrix;
+template<typename Scalar_, int SizeAtCompileTime, int MaxSizeAtCompileTime=SizeAtCompileTime> class DiagonalMatrix;
 template<typename MatrixType, typename DiagonalType, int ProductOrder> class DiagonalProduct;
 template<typename MatrixType, int Index = 0> class Diagonal;
 template<int SizeAtCompileTime, int MaxSizeAtCompileTime = SizeAtCompileTime, typename IndexType=int> class PermutationMatrix;
 template<int SizeAtCompileTime, int MaxSizeAtCompileTime = SizeAtCompileTime, typename IndexType=int> class Transpositions;
 template<typename Derived> class PermutationBase;
 template<typename Derived> class TranspositionsBase;
-template<typename _IndicesType> class PermutationWrapper;
-template<typename _IndicesType> class TranspositionsWrapper;
+template<typename IndicesType_> class PermutationWrapper;
+template<typename IndicesType_> class TranspositionsWrapper;
 
 template<typename Derived,
          int Level = internal::accessors_level<Derived>::has_write_access ? WriteAccessors : ReadOnlyAccessors
@@ -142,7 +142,7 @@
 } // end namespace internal
 
 namespace internal {
-template<typename _Scalar, int Rows=Dynamic, int Cols=Dynamic, int Supers=Dynamic, int Subs=Dynamic, int Options=0> class BandMatrix;
+template<typename Scalar_, int Rows=Dynamic, int Cols=Dynamic, int Supers=Dynamic, int Subs=Dynamic, int Options=0> class BandMatrix;
 }
 
 namespace internal {
@@ -242,23 +242,23 @@
 struct IOFormat;
 
 // Array module
-template<typename _Scalar, int _Rows, int _Cols,
-         int _Options = AutoAlign |
+template<typename Scalar_, int Rows_, int Cols_,
+         int Options_ = AutoAlign |
 #if EIGEN_GNUC_AT(3,4)
     // workaround a bug in at least gcc 3.4.6
     // the innermost ?: ternary operator is misparsed. We write it slightly
     // differently and this makes gcc 3.4.6 happy, but it's ugly.
     // The error would only show up with EIGEN_DEFAULT_TO_ROW_MAJOR is defined
     // (when EIGEN_DEFAULT_MATRIX_STORAGE_ORDER_OPTION is RowMajor)
-                          ( (_Rows==1 && _Cols!=1) ? Eigen::RowMajor
-                          : !(_Cols==1 && _Rows!=1) ?  EIGEN_DEFAULT_MATRIX_STORAGE_ORDER_OPTION
+                          ( (Rows_==1 && Cols_!=1) ? Eigen::RowMajor
+                          : !(Cols_==1 && Rows_!=1) ?  EIGEN_DEFAULT_MATRIX_STORAGE_ORDER_OPTION
                           : Eigen::ColMajor ),
 #else
-                          ( (_Rows==1 && _Cols!=1) ? Eigen::RowMajor
-                          : (_Cols==1 && _Rows!=1) ? Eigen::ColMajor
+                          ( (Rows_==1 && Cols_!=1) ? Eigen::RowMajor
+                          : (Cols_==1 && Rows_!=1) ? Eigen::ColMajor
                           : EIGEN_DEFAULT_MATRIX_STORAGE_ORDER_OPTION ),
 #endif
-         int _MaxRows = _Rows, int _MaxCols = _Cols> class Array;
+         int MaxRows_ = Rows_, int MaxCols_ = Cols_> class Array;
 template<typename ConditionMatrixType, typename ThenMatrixType, typename ElseMatrixType> class Select;
 template<typename MatrixType, typename BinaryOp, int Direction> class PartialReduxExpr;
 template<typename ExpressionType, int Direction> class VectorwiseOp;
@@ -283,7 +283,7 @@
 template<typename Scalar>     class JacobiRotation;
 
 // Geometry module:
-template<typename Derived, int _Dim> class RotationBase;
+template<typename Derived, int Dim_> class RotationBase;
 template<typename Lhs, typename Rhs> class Cross;
 template<typename Derived> class QuaternionBase;
 template<typename Scalar> class Rotation2D;
@@ -291,9 +291,9 @@
 template<typename Scalar,int Dim> class Translation;
 template<typename Scalar,int Dim> class AlignedBox;
 template<typename Scalar, int Options = AutoAlign> class Quaternion;
-template<typename Scalar,int Dim,int Mode,int _Options=AutoAlign> class Transform;
-template <typename _Scalar, int _AmbientDim, int Options=AutoAlign> class ParametrizedLine;
-template <typename _Scalar, int _AmbientDim, int Options=AutoAlign> class Hyperplane;
+template<typename Scalar,int Dim,int Mode,int Options_=AutoAlign> class Transform;
+template <typename Scalar_, int _AmbientDim, int Options=AutoAlign> class ParametrizedLine;
+template <typename Scalar_, int _AmbientDim, int Options=AutoAlign> class Hyperplane;
 template<typename Scalar> class UniformScaling;
 template<typename MatrixType,int Direction> class Homogeneous;
 
diff --git a/Eigen/src/Core/util/IntegralConstant.h b/Eigen/src/Core/util/IntegralConstant.h
index 945d426..e0092f6 100644
--- a/Eigen/src/Core/util/IntegralConstant.h
+++ b/Eigen/src/Core/util/IntegralConstant.h
@@ -138,7 +138,7 @@
   static const int value = N;
 };
 
-#if !EIGEN_HAS_CXX14
+#if !EIGEN_HAS_CXX14_VARIABLE_TEMPLATES
 template<int N,int Default> struct get_fixed_value<FixedInt<N> (*)(),Default> {
   static const int value = N;
 };
@@ -154,7 +154,7 @@
 };
 
 template<typename T> EIGEN_DEVICE_FUNC Index get_runtime_value(const T &x) { return x; }
-#if !EIGEN_HAS_CXX14
+#if !EIGEN_HAS_CXX14_VARIABLE_TEMPLATES
 template<int N> EIGEN_DEVICE_FUNC Index get_runtime_value(FixedInt<N> (*)()) { return N; }
 #endif
 
@@ -166,7 +166,7 @@
 // Convert any integral type (e.g., short, int, unsigned int, etc.) to Eigen::Index
 template<typename T, int DynamicKey> struct cleanup_index_type<T,DynamicKey,typename internal::enable_if<internal::is_integral<T>::value>::type> { typedef Index type; };
 
-#if !EIGEN_HAS_CXX14
+#if !EIGEN_HAS_CXX14_VARIABLE_TEMPLATES
 // In c++98/c++11, fix<N> is a pointer to function that we better cleanup to a true FixedInt<N>:
 template<int N, int DynamicKey> struct cleanup_index_type<FixedInt<N> (*)(), DynamicKey> { typedef FixedInt<N> type; };
 #endif
diff --git a/Eigen/src/Core/util/Macros.h b/Eigen/src/Core/util/Macros.h
index fd79c14..ff3ed17 100644
--- a/Eigen/src/Core/util/Macros.h
+++ b/Eigen/src/Core/util/Macros.h
@@ -16,7 +16,7 @@
 //------------------------------------------------------------------------------------------
 
 #define EIGEN_WORLD_VERSION 3
-#define EIGEN_MAJOR_VERSION 3
+#define EIGEN_MAJOR_VERSION 4
 #define EIGEN_MINOR_VERSION 90
 
 #define EIGEN_VERSION_AT_LEAST(x,y,z) (EIGEN_WORLD_VERSION>x || (EIGEN_WORLD_VERSION>=x && \
@@ -1135,7 +1135,16 @@
       #define EIGEN_OPTIMIZATION_BARRIER(X)  __asm__  ("" : "+r,v,wa" (X));
     #elif EIGEN_ARCH_ARM_OR_ARM64
       // General, NEON.
-      #define EIGEN_OPTIMIZATION_BARRIER(X)  __asm__  ("" : "+g,w" (X));
+      // Clang doesn't like "r",
+      //    error: non-trivial scalar-to-vector conversion, possible invalid
+      //           constraint for vector type
+      // GCC < 5 doesn't like "g",
+      //    error: 'asm' operand requires impossible reload
+      #if EIGEN_COMP_GNUC_STRICT && EIGEN_GNUC_AT_MOST(5, 0)
+        #define EIGEN_OPTIMIZATION_BARRIER(X)  __asm__  ("" : "+r,w" (X));
+      #else
+        #define EIGEN_OPTIMIZATION_BARRIER(X)  __asm__  ("" : "+g,w" (X));
+      #endif
     #elif EIGEN_ARCH_i386_OR_x86_64
       // General, SSE.
       #define EIGEN_OPTIMIZATION_BARRIER(X)  __asm__  ("" : "+g,x" (X));
@@ -1220,7 +1229,7 @@
  * This is necessary, because the implicit definition is deprecated if the copy-assignment is overridden.
  */
 #if EIGEN_HAS_CXX11
-#define EIGEN_DEFAULT_COPY_CONSTRUCTOR(CLASS) CLASS(const CLASS&) = default;
+#define EIGEN_DEFAULT_COPY_CONSTRUCTOR(CLASS) EIGEN_DEVICE_FUNC CLASS(const CLASS&) = default;
 #else
 #define EIGEN_DEFAULT_COPY_CONSTRUCTOR(CLASS)
 #endif
@@ -1245,12 +1254,12 @@
  */
 #if EIGEN_HAS_CXX11
 #define EIGEN_DEFAULT_EMPTY_CONSTRUCTOR_AND_DESTRUCTOR(Derived)  \
-    Derived() = default; \
-    ~Derived() = default;
+    EIGEN_DEVICE_FUNC Derived() = default; \
+    EIGEN_DEVICE_FUNC ~Derived() = default;
 #else
 #define EIGEN_DEFAULT_EMPTY_CONSTRUCTOR_AND_DESTRUCTOR(Derived)  \
-    Derived() {}; \
-    /* ~Derived() {}; */
+    EIGEN_DEVICE_FUNC Derived() {}; \
+    /* EIGEN_DEVICE_FUNC ~Derived() {}; */
 #endif
 
 
diff --git a/Eigen/src/Core/util/Meta.h b/Eigen/src/Core/util/Meta.h
index 2429dda..81ae2a3 100755
--- a/Eigen/src/Core/util/Meta.h
+++ b/Eigen/src/Core/util/Meta.h
@@ -715,20 +715,25 @@
 
 
 /** \internal Computes the least common multiple of two positive integer A and B
-  * at compile-time. It implements a naive algorithm testing all multiples of A.
-  * It thus works better if A>=B.
+  * at compile-time. 
   */
-template<int A, int B, int K=1, bool Done = ((A*K)%B)==0>
+template<int A, int B, int K=1, bool Done = ((A*K)%B)==0, bool Big=(A>=B)>
 struct meta_least_common_multiple
 {
   enum { ret = meta_least_common_multiple<A,B,K+1>::ret };
 };
+template<int A, int B, int K, bool Done>
+struct meta_least_common_multiple<A,B,K,Done,false>
+{
+  enum { ret = meta_least_common_multiple<B,A,K>::ret };
+};
 template<int A, int B, int K>
-struct meta_least_common_multiple<A,B,K,true>
+struct meta_least_common_multiple<A,B,K,true,true>
 {
   enum { ret = A*K };
 };
 
+
 /** \internal determines whether the product of two numeric types is allowed and what the return type is */
 template<typename T, typename U> struct scalar_product_traits
 {
diff --git a/Eigen/src/Core/util/XprHelper.h b/Eigen/src/Core/util/XprHelper.h
index 71c32b8..63885bc 100644
--- a/Eigen/src/Core/util/XprHelper.h
+++ b/Eigen/src/Core/util/XprHelper.h
@@ -247,24 +247,24 @@
   enum { value = EIGEN_MAX_ALIGN_BYTES };
 };
 
-template<typename _Scalar, int _Rows, int _Cols,
-         int _Options = AutoAlign |
-                          ( (_Rows==1 && _Cols!=1) ? RowMajor
-                          : (_Cols==1 && _Rows!=1) ? ColMajor
+template<typename Scalar_, int Rows_, int Cols_,
+         int Options_ = AutoAlign |
+                          ( (Rows_==1 && Cols_!=1) ? RowMajor
+                          : (Cols_==1 && Rows_!=1) ? ColMajor
                           : EIGEN_DEFAULT_MATRIX_STORAGE_ORDER_OPTION ),
-         int _MaxRows = _Rows,
-         int _MaxCols = _Cols
+         int MaxRows_ = Rows_,
+         int MaxCols_ = Cols_
 > class make_proper_matrix_type
 {
     enum {
-      IsColVector = _Cols==1 && _Rows!=1,
-      IsRowVector = _Rows==1 && _Cols!=1,
-      Options = IsColVector ? (_Options | ColMajor) & ~RowMajor
-              : IsRowVector ? (_Options | RowMajor) & ~ColMajor
-              : _Options
+      IsColVector = Cols_==1 && Rows_!=1,
+      IsRowVector = Rows_==1 && Cols_!=1,
+      Options = IsColVector ? (Options_ | ColMajor) & ~RowMajor
+              : IsRowVector ? (Options_ | RowMajor) & ~ColMajor
+              : Options_
     };
   public:
-    typedef Matrix<_Scalar, _Rows, _Cols, Options, _MaxRows, _MaxCols> type;
+    typedef Matrix<Scalar_, Rows_, Cols_, Options, MaxRows_, MaxCols_> type;
 };
 
 template<typename Scalar, int Rows, int Cols, int Options, int MaxRows, int MaxCols>
@@ -278,9 +278,9 @@
     enum { ret = DirectAccessBit | LvalueBit | NestByRefBit | row_major_bit };
 };
 
-template<int _Rows, int _Cols> struct size_at_compile_time
+template<int Rows_, int Cols_> struct size_at_compile_time
 {
-  enum { ret = (_Rows==Dynamic || _Cols==Dynamic) ? Dynamic : _Rows * _Cols };
+  enum { ret = (Rows_==Dynamic || Cols_==Dynamic) ? Dynamic : Rows_ * Cols_ };
 };
 
 template<typename XprType> struct size_of_xpr_at_compile_time
@@ -350,16 +350,16 @@
 };
 
 // for matrices, no need to evaluate, just use a const reference to avoid a useless copy
-template<typename _Scalar, int _Rows, int _Cols, int _Options, int _MaxRows, int _MaxCols>
-struct eval<Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols>, Dense>
+template<typename Scalar_, int Rows_, int Cols_, int Options_, int MaxRows_, int MaxCols_>
+struct eval<Matrix<Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_>, Dense>
 {
-  typedef const Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols>& type;
+  typedef const Matrix<Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_>& type;
 };
 
-template<typename _Scalar, int _Rows, int _Cols, int _Options, int _MaxRows, int _MaxCols>
-struct eval<Array<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols>, Dense>
+template<typename Scalar_, int Rows_, int Cols_, int Options_, int MaxRows_, int MaxCols_>
+struct eval<Array<Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_>, Dense>
 {
-  typedef const Array<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols>& type;
+  typedef const Array<Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_>& type;
 };
 
 
diff --git a/Eigen/src/Eigenvalues/ComplexEigenSolver.h b/Eigen/src/Eigenvalues/ComplexEigenSolver.h
index 081e918..f658e4e 100644
--- a/Eigen/src/Eigenvalues/ComplexEigenSolver.h
+++ b/Eigen/src/Eigenvalues/ComplexEigenSolver.h
@@ -23,7 +23,7 @@
   *
   * \brief Computes eigenvalues and eigenvectors of general complex matrices
   *
-  * \tparam _MatrixType the type of the matrix of which we are
+  * \tparam MatrixType_ the type of the matrix of which we are
   * computing the eigendecomposition; this is expected to be an
   * instantiation of the Matrix class template.
   *
@@ -42,12 +42,12 @@
   *
   * \sa class EigenSolver, class SelfAdjointEigenSolver
   */
-template<typename _MatrixType> class ComplexEigenSolver
+template<typename MatrixType_> class ComplexEigenSolver
 {
   public:
 
-    /** \brief Synonym for the template parameter \p _MatrixType. */
-    typedef _MatrixType MatrixType;
+    /** \brief Synonym for the template parameter \p MatrixType_. */
+    typedef MatrixType_ MatrixType;
 
     enum {
       RowsAtCompileTime = MatrixType::RowsAtCompileTime,
diff --git a/Eigen/src/Eigenvalues/ComplexSchur.h b/Eigen/src/Eigenvalues/ComplexSchur.h
index fc71468..5beaa36 100644
--- a/Eigen/src/Eigenvalues/ComplexSchur.h
+++ b/Eigen/src/Eigenvalues/ComplexSchur.h
@@ -27,7 +27,7 @@
   *
   * \brief Performs a complex Schur decomposition of a real or complex square matrix
   *
-  * \tparam _MatrixType the type of the matrix of which we are
+  * \tparam MatrixType_ the type of the matrix of which we are
   * computing the Schur decomposition; this is expected to be an
   * instantiation of the Matrix class template.
   *
@@ -48,10 +48,10 @@
   *
   * \sa class RealSchur, class EigenSolver, class ComplexEigenSolver
   */
-template<typename _MatrixType> class ComplexSchur
+template<typename MatrixType_> class ComplexSchur
 {
   public:
-    typedef _MatrixType MatrixType;
+    typedef MatrixType_ MatrixType;
     enum {
       RowsAtCompileTime = MatrixType::RowsAtCompileTime,
       ColsAtCompileTime = MatrixType::ColsAtCompileTime,
@@ -60,12 +60,12 @@
       MaxColsAtCompileTime = MatrixType::MaxColsAtCompileTime
     };
 
-    /** \brief Scalar type for matrices of type \p _MatrixType. */
+    /** \brief Scalar type for matrices of type \p MatrixType_. */
     typedef typename MatrixType::Scalar Scalar;
     typedef typename NumTraits<Scalar>::Real RealScalar;
     typedef Eigen::Index Index; ///< \deprecated since Eigen 3.3
 
-    /** \brief Complex scalar type for \p _MatrixType. 
+    /** \brief Complex scalar type for \p MatrixType_.
       *
       * This is \c std::complex<Scalar> if #Scalar is real (e.g.,
       * \c float or \c double) and just \c Scalar if #Scalar is
@@ -76,7 +76,7 @@
     /** \brief Type for the matrices in the Schur decomposition.
       *
       * This is a square matrix with entries of type #ComplexScalar. 
-      * The size is the same as the size of \p _MatrixType.
+      * The size is the same as the size of \p MatrixType_.
       */
     typedef Matrix<ComplexScalar, RowsAtCompileTime, ColsAtCompileTime, Options, MaxRowsAtCompileTime, MaxColsAtCompileTime> ComplexMatrixType;
 
diff --git a/Eigen/src/Eigenvalues/EigenSolver.h b/Eigen/src/Eigenvalues/EigenSolver.h
index 572b29e..d412601 100644
--- a/Eigen/src/Eigenvalues/EigenSolver.h
+++ b/Eigen/src/Eigenvalues/EigenSolver.h
@@ -22,7 +22,7 @@
   *
   * \brief Computes eigenvalues and eigenvectors of general matrices
   *
-  * \tparam _MatrixType the type of the matrix of which we are computing the
+  * \tparam MatrixType_ the type of the matrix of which we are computing the
   * eigendecomposition; this is expected to be an instantiation of the Matrix
   * class template. Currently, only real matrices are supported.
   *
@@ -61,12 +61,12 @@
   *
   * \sa MatrixBase::eigenvalues(), class ComplexEigenSolver, class SelfAdjointEigenSolver
   */
-template<typename _MatrixType> class EigenSolver
+template<typename MatrixType_> class EigenSolver
 {
   public:
 
-    /** \brief Synonym for the template parameter \p _MatrixType. */
-    typedef _MatrixType MatrixType;
+    /** \brief Synonym for the template parameter \p MatrixType_. */
+    typedef MatrixType_ MatrixType;
 
     enum {
       RowsAtCompileTime = MatrixType::RowsAtCompileTime,
diff --git a/Eigen/src/Eigenvalues/GeneralizedEigenSolver.h b/Eigen/src/Eigenvalues/GeneralizedEigenSolver.h
index 87d789b..fbc7679 100644
--- a/Eigen/src/Eigenvalues/GeneralizedEigenSolver.h
+++ b/Eigen/src/Eigenvalues/GeneralizedEigenSolver.h
@@ -23,7 +23,7 @@
   *
   * \brief Computes the generalized eigenvalues and eigenvectors of a pair of general matrices
   *
-  * \tparam _MatrixType the type of the matrices of which we are computing the
+  * \tparam MatrixType_ the type of the matrices of which we are computing the
   * eigen-decomposition; this is expected to be an instantiation of the Matrix
   * class template. Currently, only real matrices are supported.
   *
@@ -55,12 +55,12 @@
   *
   * \sa MatrixBase::eigenvalues(), class ComplexEigenSolver, class SelfAdjointEigenSolver
   */
-template<typename _MatrixType> class GeneralizedEigenSolver
+template<typename MatrixType_> class GeneralizedEigenSolver
 {
   public:
 
-    /** \brief Synonym for the template parameter \p _MatrixType. */
-    typedef _MatrixType MatrixType;
+    /** \brief Synonym for the template parameter \p MatrixType_. */
+    typedef MatrixType_ MatrixType;
 
     enum {
       RowsAtCompileTime = MatrixType::RowsAtCompileTime,
diff --git a/Eigen/src/Eigenvalues/GeneralizedSelfAdjointEigenSolver.h b/Eigen/src/Eigenvalues/GeneralizedSelfAdjointEigenSolver.h
index d0f9091..fd1105b 100644
--- a/Eigen/src/Eigenvalues/GeneralizedSelfAdjointEigenSolver.h
+++ b/Eigen/src/Eigenvalues/GeneralizedSelfAdjointEigenSolver.h
@@ -22,7 +22,7 @@
   *
   * \brief Computes eigenvalues and eigenvectors of the generalized selfadjoint eigen problem
   *
-  * \tparam _MatrixType the type of the matrix of which we are computing the
+  * \tparam MatrixType_ the type of the matrix of which we are computing the
   * eigendecomposition; this is expected to be an instantiation of the Matrix
   * class template.
   *
@@ -44,19 +44,19 @@
   *
   * \sa class SelfAdjointEigenSolver, class EigenSolver, class ComplexEigenSolver
   */
-template<typename _MatrixType>
-class GeneralizedSelfAdjointEigenSolver : public SelfAdjointEigenSolver<_MatrixType>
+template<typename MatrixType_>
+class GeneralizedSelfAdjointEigenSolver : public SelfAdjointEigenSolver<MatrixType_>
 {
-    typedef SelfAdjointEigenSolver<_MatrixType> Base;
+    typedef SelfAdjointEigenSolver<MatrixType_> Base;
   public:
 
-    typedef _MatrixType MatrixType;
+    typedef MatrixType_ MatrixType;
 
     /** \brief Default constructor for fixed-size matrices.
       *
       * The default constructor is useful in cases in which the user intends to
       * perform decompositions via compute(). This constructor
-      * can only be used if \p _MatrixType is a fixed-size matrix; use
+      * can only be used if \p MatrixType_ is a fixed-size matrix; use
       * GeneralizedSelfAdjointEigenSolver(Index) for dynamic-size matrices.
       */
     GeneralizedSelfAdjointEigenSolver() : Base() {}
diff --git a/Eigen/src/Eigenvalues/HessenbergDecomposition.h b/Eigen/src/Eigenvalues/HessenbergDecomposition.h
index 1f21139..ae855b9 100644
--- a/Eigen/src/Eigenvalues/HessenbergDecomposition.h
+++ b/Eigen/src/Eigenvalues/HessenbergDecomposition.h
@@ -31,7 +31,7 @@
   *
   * \brief Reduces a square matrix to Hessenberg form by an orthogonal similarity transformation
   *
-  * \tparam _MatrixType the type of the matrix of which we are computing the Hessenberg decomposition
+  * \tparam MatrixType_ the type of the matrix of which we are computing the Hessenberg decomposition
   *
   * This class performs an Hessenberg decomposition of a matrix \f$ A \f$. In
   * the real case, the Hessenberg decomposition consists of an orthogonal
@@ -54,12 +54,12 @@
   *
   * \sa class ComplexSchur, class Tridiagonalization, \ref QR_Module "QR Module"
   */
-template<typename _MatrixType> class HessenbergDecomposition
+template<typename MatrixType_> class HessenbergDecomposition
 {
   public:
 
-    /** \brief Synonym for the template parameter \p _MatrixType. */
-    typedef _MatrixType MatrixType;
+    /** \brief Synonym for the template parameter \p MatrixType_. */
+    typedef MatrixType_ MatrixType;
 
     enum {
       Size = MatrixType::RowsAtCompileTime,
diff --git a/Eigen/src/Eigenvalues/RealQZ.h b/Eigen/src/Eigenvalues/RealQZ.h
index 5091301..0fe8543 100644
--- a/Eigen/src/Eigenvalues/RealQZ.h
+++ b/Eigen/src/Eigenvalues/RealQZ.h
@@ -19,7 +19,7 @@
    *
    * \brief Performs a real QZ decomposition of a pair of square matrices
    *
-   * \tparam _MatrixType the type of the matrix of which we are computing the
+   * \tparam MatrixType_ the type of the matrix of which we are computing the
    * real QZ decomposition; this is expected to be an instantiation of the
    * Matrix class template.
    *
@@ -54,10 +54,10 @@
    * \sa class RealSchur, class ComplexSchur, class EigenSolver, class ComplexEigenSolver
    */
 
-  template<typename _MatrixType> class RealQZ
+  template<typename MatrixType_> class RealQZ
   {
     public:
-      typedef _MatrixType MatrixType;
+      typedef MatrixType_ MatrixType;
       enum {
         RowsAtCompileTime = MatrixType::RowsAtCompileTime,
         ColsAtCompileTime = MatrixType::ColsAtCompileTime,
diff --git a/Eigen/src/Eigenvalues/RealSchur.h b/Eigen/src/Eigenvalues/RealSchur.h
index 7304ef3..5b7d38c 100644
--- a/Eigen/src/Eigenvalues/RealSchur.h
+++ b/Eigen/src/Eigenvalues/RealSchur.h
@@ -22,7 +22,7 @@
   *
   * \brief Performs a real Schur decomposition of a square matrix
   *
-  * \tparam _MatrixType the type of the matrix of which we are computing the
+  * \tparam MatrixType_ the type of the matrix of which we are computing the
   * real Schur decomposition; this is expected to be an instantiation of the
   * Matrix class template.
   *
@@ -51,10 +51,10 @@
   *
   * \sa class ComplexSchur, class EigenSolver, class ComplexEigenSolver
   */
-template<typename _MatrixType> class RealSchur
+template<typename MatrixType_> class RealSchur
 {
   public:
-    typedef _MatrixType MatrixType;
+    typedef MatrixType_ MatrixType;
     enum {
       RowsAtCompileTime = MatrixType::RowsAtCompileTime,
       ColsAtCompileTime = MatrixType::ColsAtCompileTime,
diff --git a/Eigen/src/Eigenvalues/SelfAdjointEigenSolver.h b/Eigen/src/Eigenvalues/SelfAdjointEigenSolver.h
index 59e5964..e6073cd 100644
--- a/Eigen/src/Eigenvalues/SelfAdjointEigenSolver.h
+++ b/Eigen/src/Eigenvalues/SelfAdjointEigenSolver.h
@@ -15,7 +15,7 @@
 
 namespace Eigen { 
 
-template<typename _MatrixType>
+template<typename MatrixType_>
 class GeneralizedSelfAdjointEigenSolver;
 
 namespace internal {
@@ -33,7 +33,7 @@
   *
   * \brief Computes eigenvalues and eigenvectors of selfadjoint matrices
   *
-  * \tparam _MatrixType the type of the matrix of which we are computing the
+  * \tparam MatrixType_ the type of the matrix of which we are computing the
   * eigendecomposition; this is expected to be an instantiation of the Matrix
   * class template.
   *
@@ -73,11 +73,11 @@
   *
   * \sa MatrixBase::eigenvalues(), class EigenSolver, class ComplexEigenSolver
   */
-template<typename _MatrixType> class SelfAdjointEigenSolver
+template<typename MatrixType_> class SelfAdjointEigenSolver
 {
   public:
 
-    typedef _MatrixType MatrixType;
+    typedef MatrixType_ MatrixType;
     enum {
       Size = MatrixType::RowsAtCompileTime,
       ColsAtCompileTime = MatrixType::ColsAtCompileTime,
@@ -85,13 +85,13 @@
       MaxColsAtCompileTime = MatrixType::MaxColsAtCompileTime
     };
     
-    /** \brief Scalar type for matrices of type \p _MatrixType. */
+    /** \brief Scalar type for matrices of type \p MatrixType_. */
     typedef typename MatrixType::Scalar Scalar;
     typedef Eigen::Index Index; ///< \deprecated since Eigen 3.3
     
     typedef Matrix<Scalar,Size,Size,ColMajor,MaxColsAtCompileTime,MaxColsAtCompileTime> EigenvectorsType;
 
-    /** \brief Real scalar type for \p _MatrixType.
+    /** \brief Real scalar type for \p MatrixType_.
       *
       * This is just \c Scalar if #Scalar is real (e.g., \c float or
       * \c double), and the type of the real part of \c Scalar if #Scalar is
@@ -104,7 +104,7 @@
     /** \brief Type for vector of eigenvalues as returned by eigenvalues().
       *
       * This is a column vector with entries of type #RealScalar.
-      * The length of the vector is the size of \p _MatrixType.
+      * The length of the vector is the size of \p MatrixType_.
       */
     typedef typename internal::plain_col_type<MatrixType, RealScalar>::type RealVectorType;
     typedef Tridiagonalization<MatrixType> TridiagonalizationType;
@@ -114,7 +114,7 @@
       *
       * The default constructor is useful in cases in which the user intends to
       * perform decompositions via compute(). This constructor
-      * can only be used if \p _MatrixType is a fixed-size matrix; use
+      * can only be used if \p MatrixType_ is a fixed-size matrix; use
       * SelfAdjointEigenSolver(Index) for dynamic-size matrices.
       *
       * Example: \include SelfAdjointEigenSolver_SelfAdjointEigenSolver.cpp
@@ -125,6 +125,7 @@
         : m_eivec(),
           m_eivalues(),
           m_subdiag(),
+          m_hcoeffs(),
           m_info(InvalidInput),
           m_isInitialized(false),
           m_eigenvectorsOk(false)
@@ -147,6 +148,7 @@
         : m_eivec(size, size),
           m_eivalues(size),
           m_subdiag(size > 1 ? size - 1 : 1),
+          m_hcoeffs(size > 1 ? size - 1 : 1),
           m_isInitialized(false),
           m_eigenvectorsOk(false)
     {}
@@ -172,6 +174,7 @@
       : m_eivec(matrix.rows(), matrix.cols()),
         m_eivalues(matrix.cols()),
         m_subdiag(matrix.rows() > 1 ? matrix.rows() - 1 : 1),
+        m_hcoeffs(matrix.cols() > 1 ? matrix.cols() - 1 : 1),
         m_isInitialized(false),
         m_eigenvectorsOk(false)
     {
@@ -378,6 +381,7 @@
     EigenvectorsType m_eivec;
     RealVectorType m_eivalues;
     typename TridiagonalizationType::SubDiagonalType m_subdiag;
+    typename TridiagonalizationType::CoeffVectorType m_hcoeffs;
     ComputationInfo m_info;
     bool m_isInitialized;
     bool m_eigenvectorsOk;
@@ -450,7 +454,8 @@
   if(scale==RealScalar(0)) scale = RealScalar(1);
   mat.template triangularView<Lower>() /= scale;
   m_subdiag.resize(n-1);
-  internal::tridiagonalization_inplace(mat, diag, m_subdiag, computeEigenvectors);
+  m_hcoeffs.resize(n-1);
+  internal::tridiagonalization_inplace(mat, diag, m_subdiag, m_hcoeffs, computeEigenvectors);
 
   m_info = internal::computeFromTridiagonal_impl(diag, m_subdiag, m_maxIterations, computeEigenvectors, m_eivec);
   
diff --git a/Eigen/src/Eigenvalues/Tridiagonalization.h b/Eigen/src/Eigenvalues/Tridiagonalization.h
index 6c8084f..e82cbe3 100644
--- a/Eigen/src/Eigenvalues/Tridiagonalization.h
+++ b/Eigen/src/Eigenvalues/Tridiagonalization.h
@@ -36,7 +36,7 @@
   *
   * \brief Tridiagonal decomposition of a selfadjoint matrix
   *
-  * \tparam _MatrixType the type of the matrix of which we are computing the
+  * \tparam MatrixType_ the type of the matrix of which we are computing the
   * tridiagonal decomposition; this is expected to be an instantiation of the
   * Matrix class template.
   *
@@ -61,12 +61,12 @@
   *
   * \sa class HessenbergDecomposition, class SelfAdjointEigenSolver
   */
-template<typename _MatrixType> class Tridiagonalization
+template<typename MatrixType_> class Tridiagonalization
 {
   public:
 
-    /** \brief Synonym for the template parameter \p _MatrixType. */
-    typedef _MatrixType MatrixType;
+    /** \brief Synonym for the template parameter \p MatrixType_. */
+    typedef MatrixType_ MatrixType;
 
     typedef typename MatrixType::Scalar Scalar;
     typedef typename NumTraits<Scalar>::Real RealScalar;
@@ -425,12 +425,13 @@
   *
   * \sa class Tridiagonalization
   */
-template<typename MatrixType, typename DiagonalType, typename SubDiagonalType>
+template<typename MatrixType, typename DiagonalType, typename SubDiagonalType, typename CoeffVectorType>
 EIGEN_DEVICE_FUNC
-void tridiagonalization_inplace(MatrixType& mat, DiagonalType& diag, SubDiagonalType& subdiag, bool extractQ)
+void tridiagonalization_inplace(MatrixType& mat, DiagonalType& diag, SubDiagonalType& subdiag,
+                                CoeffVectorType& hcoeffs, bool extractQ)
 {
   eigen_assert(mat.cols()==mat.rows() && diag.size()==mat.rows() && subdiag.size()==mat.rows()-1);
-  tridiagonalization_inplace_selector<MatrixType>::run(mat, diag, subdiag, extractQ);
+  tridiagonalization_inplace_selector<MatrixType>::run(mat, diag, subdiag, hcoeffs, extractQ);
 }
 
 /** \internal
@@ -439,14 +440,12 @@
 template<typename MatrixType, int Size, bool IsComplex>
 struct tridiagonalization_inplace_selector
 {
-  typedef typename Tridiagonalization<MatrixType>::CoeffVectorType CoeffVectorType;
   typedef typename Tridiagonalization<MatrixType>::HouseholderSequenceType HouseholderSequenceType;
-  template<typename DiagonalType, typename SubDiagonalType>
+  template<typename DiagonalType, typename SubDiagonalType, typename CoeffVectorType>
   static EIGEN_DEVICE_FUNC
-  void run(MatrixType& mat, DiagonalType& diag, SubDiagonalType& subdiag, bool extractQ)
+      void run(MatrixType& mat, DiagonalType& diag, SubDiagonalType& subdiag, CoeffVectorType& hCoeffs, bool extractQ)
   {
-    CoeffVectorType hCoeffs(mat.cols()-1);
-    tridiagonalization_inplace(mat,hCoeffs);
+    tridiagonalization_inplace(mat, hCoeffs);
     diag = mat.diagonal().real();
     subdiag = mat.template diagonal<-1>().real();
     if(extractQ)
@@ -466,8 +465,8 @@
   typedef typename MatrixType::Scalar Scalar;
   typedef typename MatrixType::RealScalar RealScalar;
 
-  template<typename DiagonalType, typename SubDiagonalType>
-  static void run(MatrixType& mat, DiagonalType& diag, SubDiagonalType& subdiag, bool extractQ)
+  template<typename DiagonalType, typename SubDiagonalType, typename CoeffVectorType>
+  static void run(MatrixType& mat, DiagonalType& diag, SubDiagonalType& subdiag, CoeffVectorType&, bool extractQ)
   {
     using std::sqrt;
     const RealScalar tol = (std::numeric_limits<RealScalar>::min)();
@@ -511,9 +510,9 @@
 {
   typedef typename MatrixType::Scalar Scalar;
 
-  template<typename DiagonalType, typename SubDiagonalType>
+  template<typename DiagonalType, typename SubDiagonalType, typename CoeffVectorType>
   static EIGEN_DEVICE_FUNC
-  void run(MatrixType& mat, DiagonalType& diag, SubDiagonalType&, bool extractQ)
+  void run(MatrixType& mat, DiagonalType& diag, SubDiagonalType&, CoeffVectorType&, bool extractQ)
   {
     diag(0,0) = numext::real(mat(0,0));
     if(extractQ)
diff --git a/Eigen/src/Geometry/AlignedBox.h b/Eigen/src/Geometry/AlignedBox.h
index 55a9d0a..7481ea3 100644
--- a/Eigen/src/Geometry/AlignedBox.h
+++ b/Eigen/src/Geometry/AlignedBox.h
@@ -55,20 +55,20 @@
   *
   * \brief An axis aligned box
   *
-  * \tparam _Scalar the type of the scalar coefficients
+  * \tparam Scalar_ the type of the scalar coefficients
   * \tparam _AmbientDim the dimension of the ambient space, can be a compile time value or Dynamic.
   *
   * This class represents an axis aligned box as a pair of the minimal and maximal corners.
   * \warning The result of most methods is undefined when applied to an empty box. You can check for empty boxes using isEmpty().
   * \sa alignedboxtypedefs
   */
-template <typename _Scalar, int _AmbientDim>
+template <typename Scalar_, int _AmbientDim>
 class AlignedBox
 {
 public:
-EIGEN_MAKE_ALIGNED_OPERATOR_NEW_IF_VECTORIZABLE_FIXED_SIZE(_Scalar,_AmbientDim)
+EIGEN_MAKE_ALIGNED_OPERATOR_NEW_IF_VECTORIZABLE_FIXED_SIZE(Scalar_,_AmbientDim)
   enum { AmbientDimAtCompileTime = _AmbientDim };
-  typedef _Scalar                                   Scalar;
+  typedef Scalar_                                   Scalar;
   typedef NumTraits<Scalar>                         ScalarTraits;
   typedef Eigen::Index                              Index; ///< \deprecated since Eigen 3.3
   typedef typename ScalarTraits::Real               RealScalar;
diff --git a/Eigen/src/Geometry/AngleAxis.h b/Eigen/src/Geometry/AngleAxis.h
index 78328b6..d23fd59 100644
--- a/Eigen/src/Geometry/AngleAxis.h
+++ b/Eigen/src/Geometry/AngleAxis.h
@@ -18,7 +18,7 @@
   *
   * \brief Represents a 3D rotation as a rotation angle around an arbitrary 3D axis
   *
-  * \param _Scalar the scalar type, i.e., the type of the coefficients.
+  * \param Scalar_ the scalar type, i.e., the type of the coefficients.
   *
   * \warning When setting up an AngleAxis object, the axis vector \b must \b be \b normalized.
   *
@@ -39,16 +39,16 @@
   */
 
 namespace internal {
-template<typename _Scalar> struct traits<AngleAxis<_Scalar> >
+template<typename Scalar_> struct traits<AngleAxis<Scalar_> >
 {
-  typedef _Scalar Scalar;
+  typedef Scalar_ Scalar;
 };
 }
 
-template<typename _Scalar>
-class AngleAxis : public RotationBase<AngleAxis<_Scalar>,3>
+template<typename Scalar_>
+class AngleAxis : public RotationBase<AngleAxis<Scalar_>,3>
 {
-  typedef RotationBase<AngleAxis<_Scalar>,3> Base;
+  typedef RotationBase<AngleAxis<Scalar_>,3> Base;
 
 public:
 
@@ -56,7 +56,7 @@
 
   enum { Dim = 3 };
   /** the scalar type of the coefficients */
-  typedef _Scalar Scalar;
+  typedef Scalar_ Scalar;
   typedef Matrix<Scalar,3,3> Matrix3;
   typedef Matrix<Scalar,3,1> Vector3;
   typedef Quaternion<Scalar> QuaternionType;
diff --git a/Eigen/src/Geometry/Homogeneous.h b/Eigen/src/Geometry/Homogeneous.h
index 94083ac..e909984 100644
--- a/Eigen/src/Geometry/Homogeneous.h
+++ b/Eigen/src/Geometry/Homogeneous.h
@@ -57,13 +57,13 @@
 
 } // end namespace internal
 
-template<typename MatrixType,int _Direction> class Homogeneous
-  : public MatrixBase<Homogeneous<MatrixType,_Direction> >, internal::no_assignment_operator
+template<typename MatrixType,int Direction_> class Homogeneous
+  : public MatrixBase<Homogeneous<MatrixType,Direction_> >, internal::no_assignment_operator
 {
   public:
 
     typedef MatrixType NestedExpression;
-    enum { Direction = _Direction };
+    enum { Direction = Direction_ };
 
     typedef MatrixBase<Homogeneous> Base;
     EIGEN_DENSE_PUBLIC_INTERFACE(Homogeneous)
diff --git a/Eigen/src/Geometry/Hyperplane.h b/Eigen/src/Geometry/Hyperplane.h
index cebe035..268c9dd 100644
--- a/Eigen/src/Geometry/Hyperplane.h
+++ b/Eigen/src/Geometry/Hyperplane.h
@@ -22,7 +22,7 @@
   * A hyperplane is an affine subspace of dimension n-1 in a space of dimension n.
   * For example, a hyperplane in a plane is a line; a hyperplane in 3-space is a plane.
   *
-  * \tparam _Scalar the scalar type, i.e., the type of the coefficients
+  * \tparam Scalar_ the scalar type, i.e., the type of the coefficients
   * \tparam _AmbientDim the dimension of the ambient space, can be a compile time value or Dynamic.
   *             Notice that the dimension of the hyperplane is _AmbientDim-1.
   *
@@ -30,16 +30,16 @@
   * \f$ n \cdot x + d = 0 \f$ where \f$ n \f$ is a unit normal vector of the plane (linear part)
   * and \f$ d \f$ is the distance (offset) to the origin.
   */
-template <typename _Scalar, int _AmbientDim, int _Options>
+template <typename Scalar_, int _AmbientDim, int Options_>
 class Hyperplane
 {
 public:
-  EIGEN_MAKE_ALIGNED_OPERATOR_NEW_IF_VECTORIZABLE_FIXED_SIZE(_Scalar,_AmbientDim==Dynamic ? Dynamic : _AmbientDim+1)
+  EIGEN_MAKE_ALIGNED_OPERATOR_NEW_IF_VECTORIZABLE_FIXED_SIZE(Scalar_,_AmbientDim==Dynamic ? Dynamic : _AmbientDim+1)
   enum {
     AmbientDimAtCompileTime = _AmbientDim,
-    Options = _Options
+    Options = Options_
   };
-  typedef _Scalar Scalar;
+  typedef Scalar_ Scalar;
   typedef typename NumTraits<Scalar>::Real RealScalar;
   typedef Eigen::Index Index; ///< \deprecated since Eigen 3.3
   typedef Matrix<Scalar,AmbientDimAtCompileTime,1> VectorType;
diff --git a/Eigen/src/Geometry/ParametrizedLine.h b/Eigen/src/Geometry/ParametrizedLine.h
index 584f500..9ade8dc 100644
--- a/Eigen/src/Geometry/ParametrizedLine.h
+++ b/Eigen/src/Geometry/ParametrizedLine.h
@@ -23,19 +23,19 @@
   * direction vector \f$ \mathbf{d} \f$ such that the line corresponds to
   * the set \f$ l(t) = \mathbf{o} + t \mathbf{d} \f$, \f$ t \in \mathbf{R} \f$.
   *
-  * \tparam _Scalar the scalar type, i.e., the type of the coefficients
+  * \tparam Scalar_ the scalar type, i.e., the type of the coefficients
   * \tparam _AmbientDim the dimension of the ambient space, can be a compile time value or Dynamic.
   */
-template <typename _Scalar, int _AmbientDim, int _Options>
+template <typename Scalar_, int _AmbientDim, int Options_>
 class ParametrizedLine
 {
 public:
-  EIGEN_MAKE_ALIGNED_OPERATOR_NEW_IF_VECTORIZABLE_FIXED_SIZE(_Scalar,_AmbientDim)
+  EIGEN_MAKE_ALIGNED_OPERATOR_NEW_IF_VECTORIZABLE_FIXED_SIZE(Scalar_,_AmbientDim)
   enum {
     AmbientDimAtCompileTime = _AmbientDim,
-    Options = _Options
+    Options = Options_
   };
-  typedef _Scalar Scalar;
+  typedef Scalar_ Scalar;
   typedef typename NumTraits<Scalar>::Real RealScalar;
   typedef Eigen::Index Index; ///< \deprecated since Eigen 3.3
   typedef Matrix<Scalar,AmbientDimAtCompileTime,1,Options> VectorType;
@@ -59,7 +59,7 @@
     : m_origin(origin), m_direction(direction) {}
 
   template <int OtherOptions>
-  EIGEN_DEVICE_FUNC explicit ParametrizedLine(const Hyperplane<_Scalar, _AmbientDim, OtherOptions>& hyperplane);
+  EIGEN_DEVICE_FUNC explicit ParametrizedLine(const Hyperplane<Scalar_, _AmbientDim, OtherOptions>& hyperplane);
 
   /** Constructs a parametrized line going from \a p0 to \a p1. */
   EIGEN_DEVICE_FUNC static inline ParametrizedLine Through(const VectorType& p0, const VectorType& p1)
@@ -96,13 +96,13 @@
   EIGEN_DEVICE_FUNC VectorType pointAt(const Scalar& t) const;
   
   template <int OtherOptions>
-  EIGEN_DEVICE_FUNC Scalar intersectionParameter(const Hyperplane<_Scalar, _AmbientDim, OtherOptions>& hyperplane) const;
+  EIGEN_DEVICE_FUNC Scalar intersectionParameter(const Hyperplane<Scalar_, _AmbientDim, OtherOptions>& hyperplane) const;
  
   template <int OtherOptions>
-  EIGEN_DEVICE_FUNC Scalar intersection(const Hyperplane<_Scalar, _AmbientDim, OtherOptions>& hyperplane) const;
+  EIGEN_DEVICE_FUNC Scalar intersection(const Hyperplane<Scalar_, _AmbientDim, OtherOptions>& hyperplane) const;
   
   template <int OtherOptions>
-  EIGEN_DEVICE_FUNC VectorType intersectionPoint(const Hyperplane<_Scalar, _AmbientDim, OtherOptions>& hyperplane) const;
+  EIGEN_DEVICE_FUNC VectorType intersectionPoint(const Hyperplane<Scalar_, _AmbientDim, OtherOptions>& hyperplane) const;
 
   /** Applies the transformation matrix \a mat to \c *this and returns a reference to \c *this.
     *
@@ -178,9 +178,9 @@
   *
   * \warning the ambient space must have dimension 2 such that the hyperplane actually describes a line
   */
-template <typename _Scalar, int _AmbientDim, int _Options>
+template <typename Scalar_, int _AmbientDim, int Options_>
 template <int OtherOptions>
-EIGEN_DEVICE_FUNC inline ParametrizedLine<_Scalar, _AmbientDim,_Options>::ParametrizedLine(const Hyperplane<_Scalar, _AmbientDim,OtherOptions>& hyperplane)
+EIGEN_DEVICE_FUNC inline ParametrizedLine<Scalar_, _AmbientDim,Options_>::ParametrizedLine(const Hyperplane<Scalar_, _AmbientDim,OtherOptions>& hyperplane)
 {
   EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(VectorType, 2)
   direction() = hyperplane.normal().unitOrthogonal();
@@ -189,18 +189,18 @@
 
 /** \returns the point at \a t along this line
   */
-template <typename _Scalar, int _AmbientDim, int _Options>
-EIGEN_DEVICE_FUNC inline typename ParametrizedLine<_Scalar, _AmbientDim,_Options>::VectorType
-ParametrizedLine<_Scalar, _AmbientDim,_Options>::pointAt(const _Scalar& t) const
+template <typename Scalar_, int _AmbientDim, int Options_>
+EIGEN_DEVICE_FUNC inline typename ParametrizedLine<Scalar_, _AmbientDim,Options_>::VectorType
+ParametrizedLine<Scalar_, _AmbientDim,Options_>::pointAt(const Scalar_& t) const
 {
   return origin() + (direction()*t); 
 }
 
 /** \returns the parameter value of the intersection between \c *this and the given \a hyperplane
   */
-template <typename _Scalar, int _AmbientDim, int _Options>
+template <typename Scalar_, int _AmbientDim, int Options_>
 template <int OtherOptions>
-EIGEN_DEVICE_FUNC inline _Scalar ParametrizedLine<_Scalar, _AmbientDim,_Options>::intersectionParameter(const Hyperplane<_Scalar, _AmbientDim, OtherOptions>& hyperplane) const
+EIGEN_DEVICE_FUNC inline Scalar_ ParametrizedLine<Scalar_, _AmbientDim,Options_>::intersectionParameter(const Hyperplane<Scalar_, _AmbientDim, OtherOptions>& hyperplane) const
 {
   return -(hyperplane.offset()+hyperplane.normal().dot(origin()))
           / hyperplane.normal().dot(direction());
@@ -210,19 +210,19 @@
 /** \deprecated use intersectionParameter()
   * \returns the parameter value of the intersection between \c *this and the given \a hyperplane
   */
-template <typename _Scalar, int _AmbientDim, int _Options>
+template <typename Scalar_, int _AmbientDim, int Options_>
 template <int OtherOptions>
-EIGEN_DEVICE_FUNC inline _Scalar ParametrizedLine<_Scalar, _AmbientDim,_Options>::intersection(const Hyperplane<_Scalar, _AmbientDim, OtherOptions>& hyperplane) const
+EIGEN_DEVICE_FUNC inline Scalar_ ParametrizedLine<Scalar_, _AmbientDim,Options_>::intersection(const Hyperplane<Scalar_, _AmbientDim, OtherOptions>& hyperplane) const
 {
   return intersectionParameter(hyperplane);
 }
 
 /** \returns the point of the intersection between \c *this and the given hyperplane
   */
-template <typename _Scalar, int _AmbientDim, int _Options>
+template <typename Scalar_, int _AmbientDim, int Options_>
 template <int OtherOptions>
-EIGEN_DEVICE_FUNC inline typename ParametrizedLine<_Scalar, _AmbientDim,_Options>::VectorType
-ParametrizedLine<_Scalar, _AmbientDim,_Options>::intersectionPoint(const Hyperplane<_Scalar, _AmbientDim, OtherOptions>& hyperplane) const
+EIGEN_DEVICE_FUNC inline typename ParametrizedLine<Scalar_, _AmbientDim,Options_>::VectorType
+ParametrizedLine<Scalar_, _AmbientDim,Options_>::intersectionPoint(const Hyperplane<Scalar_, _AmbientDim, OtherOptions>& hyperplane) const
 {
   return pointAt(intersectionParameter(hyperplane));
 }
diff --git a/Eigen/src/Geometry/Quaternion.h b/Eigen/src/Geometry/Quaternion.h
index 3259e59..4c929c5 100644
--- a/Eigen/src/Geometry/Quaternion.h
+++ b/Eigen/src/Geometry/Quaternion.h
@@ -236,8 +236,8 @@
   *
   * \brief The quaternion class used to represent 3D orientations and rotations
   *
-  * \tparam _Scalar the scalar type, i.e., the type of the coefficients
-  * \tparam _Options controls the memory alignment of the coefficients. Can be \# AutoAlign or \# DontAlign. Default is AutoAlign.
+  * \tparam Scalar_ the scalar type, i.e., the type of the coefficients
+  * \tparam Options_ controls the memory alignment of the coefficients. Can be \# AutoAlign or \# DontAlign. Default is AutoAlign.
   *
   * This class represents a quaternion \f$ w+xi+yj+zk \f$ that is a convenient representation of
   * orientations and rotations of objects in three dimensions. Compared to other representations
@@ -256,12 +256,12 @@
   */
 
 namespace internal {
-template<typename _Scalar,int _Options>
-struct traits<Quaternion<_Scalar,_Options> >
+template<typename Scalar_,int Options_>
+struct traits<Quaternion<Scalar_,Options_> >
 {
-  typedef Quaternion<_Scalar,_Options> PlainObject;
-  typedef _Scalar Scalar;
-  typedef Matrix<_Scalar,4,1,_Options> Coefficients;
+  typedef Quaternion<Scalar_,Options_> PlainObject;
+  typedef Scalar_ Scalar;
+  typedef Matrix<Scalar_,4,1,Options_> Coefficients;
   enum{
     Alignment = internal::traits<Coefficients>::Alignment,
     Flags = LvalueBit
@@ -269,14 +269,14 @@
 };
 }
 
-template<typename _Scalar, int _Options>
-class Quaternion : public QuaternionBase<Quaternion<_Scalar,_Options> >
+template<typename Scalar_, int Options_>
+class Quaternion : public QuaternionBase<Quaternion<Scalar_,Options_> >
 {
 public:
-  typedef QuaternionBase<Quaternion<_Scalar,_Options> > Base;
+  typedef QuaternionBase<Quaternion<Scalar_,Options_> > Base;
   enum { NeedsAlignment = internal::traits<Quaternion>::Alignment>0 };
 
-  typedef _Scalar Scalar;
+  typedef Scalar_ Scalar;
 
   EIGEN_INHERIT_ASSIGNMENT_OPERATORS(Quaternion)
   using Base::operator*=;
@@ -352,7 +352,7 @@
 #ifndef EIGEN_PARSED_BY_DOXYGEN
     static EIGEN_STRONG_INLINE void _check_template_params()
     {
-      EIGEN_STATIC_ASSERT( (_Options & DontAlign) == _Options,
+      EIGEN_STATIC_ASSERT( (Options_ & DontAlign) == Options_,
         INVALID_MATRIX_TEMPLATE_PARAMETERS)
     }
 #endif
@@ -370,19 +370,19 @@
 ***************************************************************************/
 
 namespace internal {
-  template<typename _Scalar, int _Options>
-  struct traits<Map<Quaternion<_Scalar>, _Options> > : traits<Quaternion<_Scalar, (int(_Options)&Aligned)==Aligned ? AutoAlign : DontAlign> >
+  template<typename Scalar_, int Options_>
+  struct traits<Map<Quaternion<Scalar_>, Options_> > : traits<Quaternion<Scalar_, (int(Options_)&Aligned)==Aligned ? AutoAlign : DontAlign> >
   {
-    typedef Map<Matrix<_Scalar,4,1>, _Options> Coefficients;
+    typedef Map<Matrix<Scalar_,4,1>, Options_> Coefficients;
   };
 }
 
 namespace internal {
-  template<typename _Scalar, int _Options>
-  struct traits<Map<const Quaternion<_Scalar>, _Options> > : traits<Quaternion<_Scalar, (int(_Options)&Aligned)==Aligned ? AutoAlign : DontAlign> >
+  template<typename Scalar_, int Options_>
+  struct traits<Map<const Quaternion<Scalar_>, Options_> > : traits<Quaternion<Scalar_, (int(Options_)&Aligned)==Aligned ? AutoAlign : DontAlign> >
   {
-    typedef Map<const Matrix<_Scalar,4,1>, _Options> Coefficients;
-    typedef traits<Quaternion<_Scalar, (int(_Options)&Aligned)==Aligned ? AutoAlign : DontAlign> > TraitsBase;
+    typedef Map<const Matrix<Scalar_,4,1>, Options_> Coefficients;
+    typedef traits<Quaternion<Scalar_, (int(Options_)&Aligned)==Aligned ? AutoAlign : DontAlign> > TraitsBase;
     enum {
       Flags = TraitsBase::Flags & ~LvalueBit
     };
@@ -392,22 +392,22 @@
 /** \ingroup Geometry_Module
   * \brief Quaternion expression mapping a constant memory buffer
   *
-  * \tparam _Scalar the type of the Quaternion coefficients
-  * \tparam _Options see class Map
+  * \tparam Scalar_ the type of the Quaternion coefficients
+  * \tparam Options_ see class Map
   *
   * This is a specialization of class Map for Quaternion. This class allows to view
   * a 4 scalar memory buffer as an Eigen's Quaternion object.
   *
   * \sa class Map, class Quaternion, class QuaternionBase
   */
-template<typename _Scalar, int _Options>
-class Map<const Quaternion<_Scalar>, _Options >
-  : public QuaternionBase<Map<const Quaternion<_Scalar>, _Options> >
+template<typename Scalar_, int Options_>
+class Map<const Quaternion<Scalar_>, Options_ >
+  : public QuaternionBase<Map<const Quaternion<Scalar_>, Options_> >
 {
   public:
-    typedef QuaternionBase<Map<const Quaternion<_Scalar>, _Options> > Base;
+    typedef QuaternionBase<Map<const Quaternion<Scalar_>, Options_> > Base;
 
-    typedef _Scalar Scalar;
+    typedef Scalar_ Scalar;
     typedef typename internal::traits<Map>::Coefficients Coefficients;
     EIGEN_INHERIT_ASSIGNMENT_OPERATORS(Map)
     using Base::operator*=;
@@ -417,7 +417,7 @@
       * The pointer \a coeffs must reference the four coefficients of Quaternion in the following order:
       * \code *coeffs == {x, y, z, w} \endcode
       *
-      * If the template parameter _Options is set to #Aligned, then the pointer coeffs must be aligned. */
+      * If the template parameter Options_ is set to #Aligned, then the pointer coeffs must be aligned. */
     EIGEN_DEVICE_FUNC explicit EIGEN_STRONG_INLINE Map(const Scalar* coeffs) : m_coeffs(coeffs) {}
 
     EIGEN_DEVICE_FUNC inline const Coefficients& coeffs() const { return m_coeffs;}
@@ -429,22 +429,22 @@
 /** \ingroup Geometry_Module
   * \brief Expression of a quaternion from a memory buffer
   *
-  * \tparam _Scalar the type of the Quaternion coefficients
-  * \tparam _Options see class Map
+  * \tparam Scalar_ the type of the Quaternion coefficients
+  * \tparam Options_ see class Map
   *
   * This is a specialization of class Map for Quaternion. This class allows to view
   * a 4 scalar memory buffer as an Eigen's  Quaternion object.
   *
   * \sa class Map, class Quaternion, class QuaternionBase
   */
-template<typename _Scalar, int _Options>
-class Map<Quaternion<_Scalar>, _Options >
-  : public QuaternionBase<Map<Quaternion<_Scalar>, _Options> >
+template<typename Scalar_, int Options_>
+class Map<Quaternion<Scalar_>, Options_ >
+  : public QuaternionBase<Map<Quaternion<Scalar_>, Options_> >
 {
   public:
-    typedef QuaternionBase<Map<Quaternion<_Scalar>, _Options> > Base;
+    typedef QuaternionBase<Map<Quaternion<Scalar_>, Options_> > Base;
 
-    typedef _Scalar Scalar;
+    typedef Scalar_ Scalar;
     typedef typename internal::traits<Map>::Coefficients Coefficients;
     EIGEN_INHERIT_ASSIGNMENT_OPERATORS(Map)
     using Base::operator*=;
@@ -454,7 +454,7 @@
       * The pointer \a coeffs must reference the four coefficients of Quaternion in the following order:
       * \code *coeffs == {x, y, z, w} \endcode
       *
-      * If the template parameter _Options is set to #Aligned, then the pointer coeffs must be aligned. */
+      * If the template parameter Options_ is set to #Aligned, then the pointer coeffs must be aligned. */
     EIGEN_DEVICE_FUNC explicit EIGEN_STRONG_INLINE Map(Scalar* coeffs) : m_coeffs(coeffs) {}
 
     EIGEN_DEVICE_FUNC inline Coefficients& coeffs() { return m_coeffs; }
diff --git a/Eigen/src/Geometry/Rotation2D.h b/Eigen/src/Geometry/Rotation2D.h
index d0bd575..74d9f87 100644
--- a/Eigen/src/Geometry/Rotation2D.h
+++ b/Eigen/src/Geometry/Rotation2D.h
@@ -18,7 +18,7 @@
   *
   * \brief Represents a rotation/orientation in a 2 dimensional space.
   *
-  * \tparam _Scalar the scalar type, i.e., the type of the coefficients
+  * \tparam Scalar_ the scalar type, i.e., the type of the coefficients
   *
   * This class is equivalent to a single scalar representing a counter clock wise rotation
   * as a single angle in radian. It provides some additional features such as the automatic
@@ -31,16 +31,16 @@
 
 namespace internal {
 
-template<typename _Scalar> struct traits<Rotation2D<_Scalar> >
+template<typename Scalar_> struct traits<Rotation2D<Scalar_> >
 {
-  typedef _Scalar Scalar;
+  typedef Scalar_ Scalar;
 };
 } // end namespace internal
 
-template<typename _Scalar>
-class Rotation2D : public RotationBase<Rotation2D<_Scalar>,2>
+template<typename Scalar_>
+class Rotation2D : public RotationBase<Rotation2D<Scalar_>,2>
 {
-  typedef RotationBase<Rotation2D<_Scalar>,2> Base;
+  typedef RotationBase<Rotation2D<Scalar_>,2> Base;
 
 public:
 
@@ -48,7 +48,7 @@
 
   enum { Dim = 2 };
   /** the scalar type of the coefficients */
-  typedef _Scalar Scalar;
+  typedef Scalar_ Scalar;
   typedef Matrix<Scalar,2,1> Vector2;
   typedef Matrix<Scalar,2,2> Matrix2;
 
diff --git a/Eigen/src/Geometry/RotationBase.h b/Eigen/src/Geometry/RotationBase.h
index f0ee0bd..bdbec1e 100644
--- a/Eigen/src/Geometry/RotationBase.h
+++ b/Eigen/src/Geometry/RotationBase.h
@@ -23,13 +23,13 @@
   * \brief Common base class for compact rotation representations
   *
   * \tparam Derived is the derived type, i.e., a rotation type
-  * \tparam _Dim the dimension of the space
+  * \tparam Dim_ the dimension of the space
   */
-template<typename Derived, int _Dim>
+template<typename Derived, int Dim_>
 class RotationBase
 {
   public:
-    enum { Dim = _Dim };
+    enum { Dim = Dim_ };
     /** the scalar type of the coefficients */
     typedef typename internal::traits<Derived>::Scalar Scalar;
 
@@ -135,9 +135,9 @@
   *
   * \brief Constructs a Dim x Dim rotation matrix from the rotation \a r
   */
-template<typename _Scalar, int _Rows, int _Cols, int _Storage, int _MaxRows, int _MaxCols>
+template<typename Scalar_, int Rows_, int Cols_, int _Storage, int MaxRows_, int MaxCols_>
 template<typename OtherDerived>
-EIGEN_DEVICE_FUNC Matrix<_Scalar, _Rows, _Cols, _Storage, _MaxRows, _MaxCols>
+EIGEN_DEVICE_FUNC Matrix<Scalar_, Rows_, Cols_, _Storage, MaxRows_, MaxCols_>
 ::Matrix(const RotationBase<OtherDerived,ColsAtCompileTime>& r)
 {
   EIGEN_STATIC_ASSERT_MATRIX_SPECIFIC_SIZE(Matrix,int(OtherDerived::Dim),int(OtherDerived::Dim))
@@ -148,10 +148,10 @@
   *
   * \brief Set a Dim x Dim rotation matrix from the rotation \a r
   */
-template<typename _Scalar, int _Rows, int _Cols, int _Storage, int _MaxRows, int _MaxCols>
+template<typename Scalar_, int Rows_, int Cols_, int _Storage, int MaxRows_, int MaxCols_>
 template<typename OtherDerived>
-EIGEN_DEVICE_FUNC Matrix<_Scalar, _Rows, _Cols, _Storage, _MaxRows, _MaxCols>&
-Matrix<_Scalar, _Rows, _Cols, _Storage, _MaxRows, _MaxCols>
+EIGEN_DEVICE_FUNC Matrix<Scalar_, Rows_, Cols_, _Storage, MaxRows_, MaxCols_>&
+Matrix<Scalar_, Rows_, Cols_, _Storage, MaxRows_, MaxCols_>
 ::operator=(const RotationBase<OtherDerived,ColsAtCompileTime>& r)
 {
   EIGEN_STATIC_ASSERT_MATRIX_SPECIFIC_SIZE(Matrix,int(OtherDerived::Dim),int(OtherDerived::Dim))
diff --git a/Eigen/src/Geometry/Scaling.h b/Eigen/src/Geometry/Scaling.h
index d352f1f..4e75753 100644
--- a/Eigen/src/Geometry/Scaling.h
+++ b/Eigen/src/Geometry/Scaling.h
@@ -18,7 +18,7 @@
   *
   * \brief Represents a generic uniform scaling transformation
   *
-  * \tparam _Scalar the scalar type, i.e., the type of the coefficients.
+  * \tparam Scalar_ the scalar type, i.e., the type of the coefficients.
   *
   * This class represent a uniform scaling transformation. It is the return
   * type of Scaling(Scalar), and most of the time this is the only way it
@@ -45,12 +45,12 @@
   };
 }
 
-template<typename _Scalar>
+template<typename Scalar_>
 class UniformScaling
 {
 public:
   /** the scalar type of the coefficients */
-  typedef _Scalar Scalar;
+  typedef Scalar_ Scalar;
 
 protected:
 
diff --git a/Eigen/src/Geometry/Transform.h b/Eigen/src/Geometry/Transform.h
index 52b8c2a..56b10e6 100644
--- a/Eigen/src/Geometry/Transform.h
+++ b/Eigen/src/Geometry/Transform.h
@@ -63,15 +63,15 @@
 
 template<typename TransformType> struct transform_take_affine_part;
 
-template<typename _Scalar, int _Dim, int _Mode, int _Options>
-struct traits<Transform<_Scalar,_Dim,_Mode,_Options> >
+template<typename Scalar_, int Dim_, int _Mode, int Options_>
+struct traits<Transform<Scalar_,Dim_,_Mode,Options_> >
 {
-  typedef _Scalar Scalar;
+  typedef Scalar_ Scalar;
   typedef Eigen::Index StorageIndex;
   typedef Dense StorageKind;
   enum {
-    Dim1 = _Dim==Dynamic ? _Dim : _Dim + 1,
-    RowsAtCompileTime = _Mode==Projective ? Dim1 : _Dim,
+    Dim1 = Dim_==Dynamic ? Dim_ : Dim_ + 1,
+    RowsAtCompileTime = _Mode==Projective ? Dim1 : Dim_,
     ColsAtCompileTime = Dim1,
     MaxRowsAtCompileTime = RowsAtCompileTime,
     MaxColsAtCompileTime = ColsAtCompileTime,
@@ -89,8 +89,8 @@
   *
   * \brief Represents an homogeneous transformation in a N dimensional space
   *
-  * \tparam _Scalar the scalar type, i.e., the type of the coefficients
-  * \tparam _Dim the dimension of the space
+  * \tparam Scalar_ the scalar type, i.e., the type of the coefficients
+  * \tparam Dim_ the dimension of the space
   * \tparam _Mode the type of the transformation. Can be:
   *              - #Affine: the transformation is stored as a (Dim+1)^2 matrix,
   *                         where the last row is assumed to be [0 ... 0 1].
@@ -100,7 +100,7 @@
   *              - #Isometry: same as #Affine with the additional assumption that
   *                           the linear part represents a rotation. This assumption is exploited
   *                           to speed up some functions such as inverse() and rotation().
-  * \tparam _Options has the same meaning as in class Matrix. It allows to specify DontAlign and/or RowMajor.
+  * \tparam Options_ has the same meaning as in class Matrix. It allows to specify DontAlign and/or RowMajor.
   *                  These Options are passed directly to the underlying matrix type.
   *
   * The homography is internally represented and stored by a matrix which
@@ -200,20 +200,20 @@
   *
   * \sa class Matrix, class Quaternion
   */
-template<typename _Scalar, int _Dim, int _Mode, int _Options>
+template<typename Scalar_, int Dim_, int _Mode, int Options_>
 class Transform
 {
 public:
-  EIGEN_MAKE_ALIGNED_OPERATOR_NEW_IF_VECTORIZABLE_FIXED_SIZE(_Scalar,_Dim==Dynamic ? Dynamic : (_Dim+1)*(_Dim+1))
+  EIGEN_MAKE_ALIGNED_OPERATOR_NEW_IF_VECTORIZABLE_FIXED_SIZE(Scalar_,Dim_==Dynamic ? Dynamic : (Dim_+1)*(Dim_+1))
   enum {
     Mode = _Mode,
-    Options = _Options,
-    Dim = _Dim,     ///< space dimension in which the transformation holds
-    HDim = _Dim+1,  ///< size of a respective homogeneous vector
+    Options = Options_,
+    Dim = Dim_,     ///< space dimension in which the transformation holds
+    HDim = Dim_+1,  ///< size of a respective homogeneous vector
     Rows = int(Mode)==(AffineCompact) ? Dim : HDim
   };
   /** the scalar type of the coefficients */
-  typedef _Scalar Scalar;
+  typedef Scalar_ Scalar;
   typedef Eigen::Index StorageIndex;
   typedef Eigen::Index Index; ///< \deprecated since Eigen 3.3
   /** type of the matrix used to represent the transformation */
@@ -443,7 +443,7 @@
     * \li a general transformation matrix of size Dim+1 x Dim+1.
     */
   template<typename OtherDerived> friend
-  EIGEN_DEVICE_FUNC inline const typename internal::transform_left_product_impl<OtherDerived,Mode,Options,_Dim,_Dim+1>::ResultType
+  EIGEN_DEVICE_FUNC inline const typename internal::transform_left_product_impl<OtherDerived,Mode,Options,Dim_,Dim_+1>::ResultType
     operator * (const EigenBase<OtherDerived> &a, const Transform &b)
   { return internal::transform_left_product_impl<OtherDerived,Mode,Options,Dim,HDim>::run(a.derived(),b); }
 
diff --git a/Eigen/src/Geometry/Translation.h b/Eigen/src/Geometry/Translation.h
index 8c22901..cad623b 100644
--- a/Eigen/src/Geometry/Translation.h
+++ b/Eigen/src/Geometry/Translation.h
@@ -18,23 +18,23 @@
   *
   * \brief Represents a translation transformation
   *
-  * \tparam _Scalar the scalar type, i.e., the type of the coefficients.
-  * \tparam _Dim the  dimension of the space, can be a compile time value or Dynamic
+  * \tparam Scalar_ the scalar type, i.e., the type of the coefficients.
+  * \tparam Dim_ the  dimension of the space, can be a compile time value or Dynamic
   *
   * \note This class is not aimed to be used to store a translation transformation,
   * but rather to make easier the constructions and updates of Transform objects.
   *
   * \sa class Scaling, class Transform
   */
-template<typename _Scalar, int _Dim>
+template<typename Scalar_, int Dim_>
 class Translation
 {
 public:
-  EIGEN_MAKE_ALIGNED_OPERATOR_NEW_IF_VECTORIZABLE_FIXED_SIZE(_Scalar,_Dim)
+  EIGEN_MAKE_ALIGNED_OPERATOR_NEW_IF_VECTORIZABLE_FIXED_SIZE(Scalar_,Dim_)
   /** dimension of the space */
-  enum { Dim = _Dim };
+  enum { Dim = Dim_ };
   /** the scalar type of the coefficients */
-  typedef _Scalar Scalar;
+  typedef Scalar_ Scalar;
   /** corresponding vector type */
   typedef Matrix<Scalar,Dim,1> VectorType;
   /** corresponding linear transformation matrix type */
diff --git a/Eigen/src/Householder/HouseholderSequence.h b/Eigen/src/Householder/HouseholderSequence.h
index 022f6c3..984b236 100644
--- a/Eigen/src/Householder/HouseholderSequence.h
+++ b/Eigen/src/Householder/HouseholderSequence.h
@@ -428,7 +428,7 @@
       return res;
     }
 
-    template<typename _VectorsType, typename _CoeffsType, int _Side> friend struct internal::hseq_side_dependent_impl;
+    template<typename VectorsType_, typename CoeffsType_, int Side_> friend struct internal::hseq_side_dependent_impl;
 
     /** \brief Sets the length of the Householder sequence.
       * \param [in]  length  New value for the length.
diff --git a/Eigen/src/IterativeLinearSolvers/BasicPreconditioners.h b/Eigen/src/IterativeLinearSolvers/BasicPreconditioners.h
index a117fc1..3adfe4f 100644
--- a/Eigen/src/IterativeLinearSolvers/BasicPreconditioners.h
+++ b/Eigen/src/IterativeLinearSolvers/BasicPreconditioners.h
@@ -21,7 +21,7 @@
     A.diagonal().asDiagonal() . x = b
     \endcode
   *
-  * \tparam _Scalar the type of the scalar.
+  * \tparam Scalar_ the type of the scalar.
   *
   * \implsparsesolverconcept
   *
@@ -32,10 +32,10 @@
   *
   * \sa class LeastSquareDiagonalPreconditioner, class ConjugateGradient
   */
-template <typename _Scalar>
+template <typename Scalar_>
 class DiagonalPreconditioner
 {
-    typedef _Scalar Scalar;
+    typedef Scalar_ Scalar;
     typedef Matrix<Scalar,Dynamic,1> Vector;
   public:
     typedef typename Vector::StorageIndex StorageIndex;
@@ -116,7 +116,7 @@
     (A.adjoint() * A).diagonal().asDiagonal() * x = b
     \endcode
   *
-  * \tparam _Scalar the type of the scalar.
+  * \tparam Scalar_ the type of the scalar.
   *
   * \implsparsesolverconcept
   *
@@ -124,12 +124,12 @@
   *
   * \sa class LeastSquaresConjugateGradient, class DiagonalPreconditioner
   */
-template <typename _Scalar>
-class LeastSquareDiagonalPreconditioner : public DiagonalPreconditioner<_Scalar>
+template <typename Scalar_>
+class LeastSquareDiagonalPreconditioner : public DiagonalPreconditioner<Scalar_>
 {
-    typedef _Scalar Scalar;
+    typedef Scalar_ Scalar;
     typedef typename NumTraits<Scalar>::Real RealScalar;
-    typedef DiagonalPreconditioner<_Scalar> Base;
+    typedef DiagonalPreconditioner<Scalar_> Base;
     using Base::m_invdiag;
   public:
 
diff --git a/Eigen/src/IterativeLinearSolvers/BiCGSTAB.h b/Eigen/src/IterativeLinearSolvers/BiCGSTAB.h
index 153acef..22ad539 100644
--- a/Eigen/src/IterativeLinearSolvers/BiCGSTAB.h
+++ b/Eigen/src/IterativeLinearSolvers/BiCGSTAB.h
@@ -108,17 +108,17 @@
 
 }
 
-template< typename _MatrixType,
-          typename _Preconditioner = DiagonalPreconditioner<typename _MatrixType::Scalar> >
+template< typename MatrixType_,
+          typename Preconditioner_ = DiagonalPreconditioner<typename MatrixType_::Scalar> >
 class BiCGSTAB;
 
 namespace internal {
 
-template< typename _MatrixType, typename _Preconditioner>
-struct traits<BiCGSTAB<_MatrixType,_Preconditioner> >
+template< typename MatrixType_, typename Preconditioner_>
+struct traits<BiCGSTAB<MatrixType_,Preconditioner_> >
 {
-  typedef _MatrixType MatrixType;
-  typedef _Preconditioner Preconditioner;
+  typedef MatrixType_ MatrixType;
+  typedef Preconditioner_ Preconditioner;
 };
 
 }
@@ -129,8 +129,8 @@
   * This class allows to solve for A.x = b sparse linear problems using a bi conjugate gradient
   * stabilized algorithm. The vectors x and b can be either dense or sparse.
   *
-  * \tparam _MatrixType the type of the sparse matrix A, can be a dense or a sparse matrix.
-  * \tparam _Preconditioner the type of the preconditioner. Default is DiagonalPreconditioner
+  * \tparam MatrixType_ the type of the sparse matrix A, can be a dense or a sparse matrix.
+  * \tparam Preconditioner_ the type of the preconditioner. Default is DiagonalPreconditioner
   *
   * \implsparsesolverconcept
   *
@@ -154,8 +154,8 @@
   *
   * \sa class SimplicialCholesky, DiagonalPreconditioner, IdentityPreconditioner
   */
-template< typename _MatrixType, typename _Preconditioner>
-class BiCGSTAB : public IterativeSolverBase<BiCGSTAB<_MatrixType,_Preconditioner> >
+template< typename MatrixType_, typename Preconditioner_>
+class BiCGSTAB : public IterativeSolverBase<BiCGSTAB<MatrixType_,Preconditioner_> >
 {
   typedef IterativeSolverBase<BiCGSTAB> Base;
   using Base::matrix;
@@ -164,10 +164,10 @@
   using Base::m_info;
   using Base::m_isInitialized;
 public:
-  typedef _MatrixType MatrixType;
+  typedef MatrixType_ MatrixType;
   typedef typename MatrixType::Scalar Scalar;
   typedef typename MatrixType::RealScalar RealScalar;
-  typedef _Preconditioner Preconditioner;
+  typedef Preconditioner_ Preconditioner;
 
 public:
 
diff --git a/Eigen/src/IterativeLinearSolvers/ConjugateGradient.h b/Eigen/src/IterativeLinearSolvers/ConjugateGradient.h
index 5d8c6b4..6cc6532 100644
--- a/Eigen/src/IterativeLinearSolvers/ConjugateGradient.h
+++ b/Eigen/src/IterativeLinearSolvers/ConjugateGradient.h
@@ -92,17 +92,17 @@
 
 }
 
-template< typename _MatrixType, int _UpLo=Lower,
-          typename _Preconditioner = DiagonalPreconditioner<typename _MatrixType::Scalar> >
+template< typename MatrixType_, int UpLo_=Lower,
+          typename Preconditioner_ = DiagonalPreconditioner<typename MatrixType_::Scalar> >
 class ConjugateGradient;
 
 namespace internal {
 
-template< typename _MatrixType, int _UpLo, typename _Preconditioner>
-struct traits<ConjugateGradient<_MatrixType,_UpLo,_Preconditioner> >
+template< typename MatrixType_, int UpLo_, typename Preconditioner_>
+struct traits<ConjugateGradient<MatrixType_,UpLo_,Preconditioner_> >
 {
-  typedef _MatrixType MatrixType;
-  typedef _Preconditioner Preconditioner;
+  typedef MatrixType_ MatrixType;
+  typedef Preconditioner_ Preconditioner;
 };
 
 }
@@ -113,11 +113,11 @@
   * This class allows to solve for A.x = b linear problems using an iterative conjugate gradient algorithm.
   * The matrix A must be selfadjoint. The matrix A and the vectors x and b can be either dense or sparse.
   *
-  * \tparam _MatrixType the type of the matrix A, can be a dense or a sparse matrix.
-  * \tparam _UpLo the triangular part that will be used for the computations. It can be Lower,
+  * \tparam MatrixType_ the type of the matrix A, can be a dense or a sparse matrix.
+  * \tparam UpLo_ the triangular part that will be used for the computations. It can be Lower,
   *               \c Upper, or \c Lower|Upper in which the full matrix entries will be considered.
   *               Default is \c Lower, best performance is \c Lower|Upper.
-  * \tparam _Preconditioner the type of the preconditioner. Default is DiagonalPreconditioner
+  * \tparam Preconditioner_ the type of the preconditioner. Default is DiagonalPreconditioner
   *
   * \implsparsesolverconcept
   *
@@ -127,8 +127,8 @@
   * 
   * The tolerance corresponds to the relative residual error: |Ax-b|/|b|
   * 
-  * \b Performance: Even though the default value of \c _UpLo is \c Lower, significantly higher performance is
-  * achieved when using a complete matrix and \b Lower|Upper as the \a _UpLo template parameter. Moreover, in this
+  * \b Performance: Even though the default value of \c UpLo_ is \c Lower, significantly higher performance is
+  * achieved when using a complete matrix and \b Lower|Upper as the \a UpLo_ template parameter. Moreover, in this
   * case multi-threading can be exploited if the user code is compiled with OpenMP enabled.
   * See \ref TopicMultiThreading for details.
   * 
@@ -154,8 +154,8 @@
   *
   * \sa class LeastSquaresConjugateGradient, class SimplicialCholesky, DiagonalPreconditioner, IdentityPreconditioner
   */
-template< typename _MatrixType, int _UpLo, typename _Preconditioner>
-class ConjugateGradient : public IterativeSolverBase<ConjugateGradient<_MatrixType,_UpLo,_Preconditioner> >
+template< typename MatrixType_, int UpLo_, typename Preconditioner_>
+class ConjugateGradient : public IterativeSolverBase<ConjugateGradient<MatrixType_,UpLo_,Preconditioner_> >
 {
   typedef IterativeSolverBase<ConjugateGradient> Base;
   using Base::matrix;
@@ -164,13 +164,13 @@
   using Base::m_info;
   using Base::m_isInitialized;
 public:
-  typedef _MatrixType MatrixType;
+  typedef MatrixType_ MatrixType;
   typedef typename MatrixType::Scalar Scalar;
   typedef typename MatrixType::RealScalar RealScalar;
-  typedef _Preconditioner Preconditioner;
+  typedef Preconditioner_ Preconditioner;
 
   enum {
-    UpLo = _UpLo
+    UpLo = UpLo_
   };
 
 public:
diff --git a/Eigen/src/IterativeLinearSolvers/IncompleteCholesky.h b/Eigen/src/IterativeLinearSolvers/IncompleteCholesky.h
index 7803fd8..d4f7155 100644
--- a/Eigen/src/IterativeLinearSolvers/IncompleteCholesky.h
+++ b/Eigen/src/IterativeLinearSolvers/IncompleteCholesky.h
@@ -22,9 +22,9 @@
   *              Limited memory, SIAM J. Sci. Comput.  21(1), pp. 24-45, 1999
   *
   * \tparam Scalar the scalar type of the input matrices
-  * \tparam _UpLo The triangular part that will be used for the computations. It can be Lower
+  * \tparam UpLo_ The triangular part that will be used for the computations. It can be Lower
     *               or Upper. Default is Lower.
-  * \tparam _OrderingType The ordering method to use, either AMDOrdering<> or NaturalOrdering<>. Default is AMDOrdering<int>,
+  * \tparam OrderingType_ The ordering method to use, either AMDOrdering<> or NaturalOrdering<>. Default is AMDOrdering<int>,
   *                       unless EIGEN_MPL2_ONLY is defined, in which case the default is NaturalOrdering<int>.
   *
   * \implsparsesolverconcept
@@ -41,15 +41,15 @@
   * the info() method, then you can either increase the initial shift, or better use another preconditioning technique.
   *
   */
-template <typename Scalar, int _UpLo = Lower, typename _OrderingType = AMDOrdering<int> >
-class IncompleteCholesky : public SparseSolverBase<IncompleteCholesky<Scalar,_UpLo,_OrderingType> >
+template <typename Scalar, int UpLo_ = Lower, typename OrderingType_ = AMDOrdering<int> >
+class IncompleteCholesky : public SparseSolverBase<IncompleteCholesky<Scalar,UpLo_,OrderingType_> >
 {
   protected:
-    typedef SparseSolverBase<IncompleteCholesky<Scalar,_UpLo,_OrderingType> > Base;
+    typedef SparseSolverBase<IncompleteCholesky<Scalar,UpLo_,OrderingType_> > Base;
     using Base::m_isInitialized;
   public:
     typedef typename NumTraits<Scalar>::Real RealScalar;
-    typedef _OrderingType OrderingType;
+    typedef OrderingType_ OrderingType;
     typedef typename OrderingType::PermutationType PermutationType;
     typedef typename PermutationType::StorageIndex StorageIndex;
     typedef SparseMatrix<Scalar,ColMajor,StorageIndex> FactorType;
@@ -57,7 +57,7 @@
     typedef Matrix<RealScalar,Dynamic,1> VectorRx;
     typedef Matrix<StorageIndex,Dynamic, 1> VectorIx;
     typedef std::vector<std::list<StorageIndex> > VectorList;
-    enum { UpLo = _UpLo };
+    enum { UpLo = UpLo_ };
     enum {
       ColsAtCompileTime = Dynamic,
       MaxColsAtCompileTime = Dynamic
@@ -185,9 +185,9 @@
 //   C-J. Lin and J. J. Moré, Incomplete Cholesky Factorizations with
 //   Limited memory, SIAM J. Sci. Comput.  21(1), pp. 24-45, 1999
 //   http://ftp.mcs.anl.gov/pub/tech_reports/reports/P682.pdf
-template<typename Scalar, int _UpLo, typename OrderingType>
-template<typename _MatrixType>
-void IncompleteCholesky<Scalar,_UpLo, OrderingType>::factorize(const _MatrixType& mat)
+template<typename Scalar, int UpLo_, typename OrderingType>
+template<typename MatrixType_>
+void IncompleteCholesky<Scalar,UpLo_, OrderingType>::factorize(const MatrixType_& mat)
 {
   using std::sqrt;
   eigen_assert(m_analysisIsOk && "analyzePattern() should be called first");
@@ -199,12 +199,12 @@
   {
     // The temporary is needed to make sure that the diagonal entry is properly sorted
     FactorType tmp(mat.rows(), mat.cols());
-    tmp = mat.template selfadjointView<_UpLo>().twistedBy(m_perm);
+    tmp = mat.template selfadjointView<UpLo_>().twistedBy(m_perm);
     m_L.template selfadjointView<Lower>() = tmp.template selfadjointView<Lower>();
   }
   else
   {
-    m_L.template selfadjointView<Lower>() = mat.template selfadjointView<_UpLo>();
+    m_L.template selfadjointView<Lower>() = mat.template selfadjointView<UpLo_>();
   }
 
   Index n = m_L.cols();
@@ -369,8 +369,8 @@
   } while(m_info!=Success);
 }
 
-template<typename Scalar, int _UpLo, typename OrderingType>
-inline void IncompleteCholesky<Scalar,_UpLo, OrderingType>::updateList(Ref<const VectorIx> colPtr, Ref<VectorIx> rowIdx, Ref<VectorSx> vals, const Index& col, const Index& jk, VectorIx& firstElt, VectorList& listCol)
+template<typename Scalar, int UpLo_, typename OrderingType>
+inline void IncompleteCholesky<Scalar,UpLo_, OrderingType>::updateList(Ref<const VectorIx> colPtr, Ref<VectorIx> rowIdx, Ref<VectorSx> vals, const Index& col, const Index& jk, VectorIx& firstElt, VectorList& listCol)
 {
   if (jk < colPtr(col+1) )
   {
diff --git a/Eigen/src/IterativeLinearSolvers/IncompleteLUT.h b/Eigen/src/IterativeLinearSolvers/IncompleteLUT.h
index cdcf709..6637a8e 100644
--- a/Eigen/src/IterativeLinearSolvers/IncompleteLUT.h
+++ b/Eigen/src/IterativeLinearSolvers/IncompleteLUT.h
@@ -95,15 +95,15 @@
   * alternatively, on GMANE:
   *   http://comments.gmane.org/gmane.comp.lib.eigen/3302
   */
-template <typename _Scalar, typename _StorageIndex = int>
-class IncompleteLUT : public SparseSolverBase<IncompleteLUT<_Scalar, _StorageIndex> >
+template <typename Scalar_, typename StorageIndex_ = int>
+class IncompleteLUT : public SparseSolverBase<IncompleteLUT<Scalar_, StorageIndex_> >
 {
   protected:
     typedef SparseSolverBase<IncompleteLUT> Base;
     using Base::m_isInitialized;
   public:
-    typedef _Scalar Scalar;
-    typedef _StorageIndex StorageIndex;
+    typedef Scalar_ Scalar;
+    typedef StorageIndex_ StorageIndex;
     typedef typename NumTraits<Scalar>::Real RealScalar;
     typedef Matrix<Scalar,Dynamic,1> Vector;
     typedef Matrix<StorageIndex,Dynamic,1> VectorI;
@@ -219,8 +219,8 @@
 }
 
 template <typename Scalar, typename StorageIndex>
-template<typename _MatrixType>
-void IncompleteLUT<Scalar,StorageIndex>::analyzePattern(const _MatrixType& amat)
+template<typename MatrixType_>
+void IncompleteLUT<Scalar,StorageIndex>::analyzePattern(const MatrixType_& amat)
 {
   // Compute the Fill-reducing permutation
   // Since ILUT does not perform any numerical pivoting,
@@ -240,8 +240,8 @@
 }
 
 template <typename Scalar, typename StorageIndex>
-template<typename _MatrixType>
-void IncompleteLUT<Scalar,StorageIndex>::factorize(const _MatrixType& amat)
+template<typename MatrixType_>
+void IncompleteLUT<Scalar,StorageIndex>::factorize(const MatrixType_& amat)
 {
   using std::sqrt;
   using std::swap;
diff --git a/Eigen/src/IterativeLinearSolvers/LeastSquareConjugateGradient.h b/Eigen/src/IterativeLinearSolvers/LeastSquareConjugateGradient.h
index 203fd0e..be816e4 100644
--- a/Eigen/src/IterativeLinearSolvers/LeastSquareConjugateGradient.h
+++ b/Eigen/src/IterativeLinearSolvers/LeastSquareConjugateGradient.h
@@ -93,17 +93,17 @@
 
 }
 
-template< typename _MatrixType,
-          typename _Preconditioner = LeastSquareDiagonalPreconditioner<typename _MatrixType::Scalar> >
+template< typename MatrixType_,
+          typename Preconditioner_ = LeastSquareDiagonalPreconditioner<typename MatrixType_::Scalar> >
 class LeastSquaresConjugateGradient;
 
 namespace internal {
 
-template< typename _MatrixType, typename _Preconditioner>
-struct traits<LeastSquaresConjugateGradient<_MatrixType,_Preconditioner> >
+template< typename MatrixType_, typename Preconditioner_>
+struct traits<LeastSquaresConjugateGradient<MatrixType_,Preconditioner_> >
 {
-  typedef _MatrixType MatrixType;
-  typedef _Preconditioner Preconditioner;
+  typedef MatrixType_ MatrixType;
+  typedef Preconditioner_ Preconditioner;
 };
 
 }
@@ -116,8 +116,8 @@
   * Otherwise, the SparseLU or SparseQR classes might be preferable.
   * The matrix A and the vectors x and b can be either dense or sparse.
   *
-  * \tparam _MatrixType the type of the matrix A, can be a dense or a sparse matrix.
-  * \tparam _Preconditioner the type of the preconditioner. Default is LeastSquareDiagonalPreconditioner
+  * \tparam MatrixType_ the type of the matrix A, can be a dense or a sparse matrix.
+  * \tparam Preconditioner_ the type of the preconditioner. Default is LeastSquareDiagonalPreconditioner
   *
   * \implsparsesolverconcept
   * 
@@ -145,8 +145,8 @@
   * 
   * \sa class ConjugateGradient, SparseLU, SparseQR
   */
-template< typename _MatrixType, typename _Preconditioner>
-class LeastSquaresConjugateGradient : public IterativeSolverBase<LeastSquaresConjugateGradient<_MatrixType,_Preconditioner> >
+template< typename MatrixType_, typename Preconditioner_>
+class LeastSquaresConjugateGradient : public IterativeSolverBase<LeastSquaresConjugateGradient<MatrixType_,Preconditioner_> >
 {
   typedef IterativeSolverBase<LeastSquaresConjugateGradient> Base;
   using Base::matrix;
@@ -155,10 +155,10 @@
   using Base::m_info;
   using Base::m_isInitialized;
 public:
-  typedef _MatrixType MatrixType;
+  typedef MatrixType_ MatrixType;
   typedef typename MatrixType::Scalar Scalar;
   typedef typename MatrixType::RealScalar RealScalar;
-  typedef _Preconditioner Preconditioner;
+  typedef Preconditioner_ Preconditioner;
 
 public:
 
diff --git a/Eigen/src/KLUSupport/KLUSupport.h b/Eigen/src/KLUSupport/KLUSupport.h
index 215db35..c13a332 100644
--- a/Eigen/src/KLUSupport/KLUSupport.h
+++ b/Eigen/src/KLUSupport/KLUSupport.h
@@ -23,7 +23,7 @@
   *
   * \warning The input matrix A should be in a \b compressed and \b column-major form.
   * Otherwise an expensive copy will be made. You can call the inexpensive makeCompressed() to get a compressed matrix.
-  * \tparam _MatrixType the type of the sparse matrix A, it must be a SparseMatrix<>
+  * \tparam MatrixType_ the type of the sparse matrix A, it must be a SparseMatrix<>
   *
   * \implsparsesolverconcept
   *
@@ -56,15 +56,15 @@
 }
 
 
-template<typename _MatrixType>
-class KLU : public SparseSolverBase<KLU<_MatrixType> >
+template<typename MatrixType_>
+class KLU : public SparseSolverBase<KLU<MatrixType_> >
 {
   protected:
-    typedef SparseSolverBase<KLU<_MatrixType> > Base;
+    typedef SparseSolverBase<KLU<MatrixType_> > Base;
     using Base::m_isInitialized;
   public:
     using Base::_solve_impl;
-    typedef _MatrixType MatrixType;
+    typedef MatrixType_ MatrixType;
     typedef typename MatrixType::Scalar Scalar;
     typedef typename MatrixType::RealScalar RealScalar;
     typedef typename MatrixType::StorageIndex StorageIndex;
diff --git a/Eigen/src/LU/FullPivLU.h b/Eigen/src/LU/FullPivLU.h
index ba1749f..c45b258 100644
--- a/Eigen/src/LU/FullPivLU.h
+++ b/Eigen/src/LU/FullPivLU.h
@@ -13,8 +13,8 @@
 namespace Eigen {
 
 namespace internal {
-template<typename _MatrixType> struct traits<FullPivLU<_MatrixType> >
- : traits<_MatrixType>
+template<typename MatrixType_> struct traits<FullPivLU<MatrixType_> >
+ : traits<MatrixType_>
 {
   typedef MatrixXpr XprKind;
   typedef SolverStorage StorageKind;
@@ -30,7 +30,7 @@
   *
   * \brief LU decomposition of a matrix with complete pivoting, and related features
   *
-  * \tparam _MatrixType the type of the matrix of which we are computing the LU decomposition
+  * \tparam MatrixType_ the type of the matrix of which we are computing the LU decomposition
   *
   * This class represents a LU decomposition of any matrix, with complete pivoting: the matrix A is
   * decomposed as \f$ A = P^{-1} L U Q^{-1} \f$ where L is unit-lower-triangular, U is
@@ -57,11 +57,11 @@
   *
   * \sa MatrixBase::fullPivLu(), MatrixBase::determinant(), MatrixBase::inverse()
   */
-template<typename _MatrixType> class FullPivLU
-  : public SolverBase<FullPivLU<_MatrixType> >
+template<typename MatrixType_> class FullPivLU
+  : public SolverBase<FullPivLU<MatrixType_> >
 {
   public:
-    typedef _MatrixType MatrixType;
+    typedef MatrixType_ MatrixType;
     typedef SolverBase<FullPivLU> Base;
     friend class SolverBase<FullPivLU>;
 
@@ -613,11 +613,11 @@
 /********* Implementation of kernel() **************************************************/
 
 namespace internal {
-template<typename _MatrixType>
-struct kernel_retval<FullPivLU<_MatrixType> >
-  : kernel_retval_base<FullPivLU<_MatrixType> >
+template<typename MatrixType_>
+struct kernel_retval<FullPivLU<MatrixType_> >
+  : kernel_retval_base<FullPivLU<MatrixType_> >
 {
-  EIGEN_MAKE_KERNEL_HELPERS(FullPivLU<_MatrixType>)
+  EIGEN_MAKE_KERNEL_HELPERS(FullPivLU<MatrixType_>)
 
   enum { MaxSmallDimAtCompileTime = EIGEN_SIZE_MIN_PREFER_FIXED(
             MatrixType::MaxColsAtCompileTime,
@@ -699,11 +699,11 @@
 
 /***** Implementation of image() *****************************************************/
 
-template<typename _MatrixType>
-struct image_retval<FullPivLU<_MatrixType> >
-  : image_retval_base<FullPivLU<_MatrixType> >
+template<typename MatrixType_>
+struct image_retval<FullPivLU<MatrixType_> >
+  : image_retval_base<FullPivLU<MatrixType_> >
 {
-  EIGEN_MAKE_IMAGE_HELPERS(FullPivLU<_MatrixType>)
+  EIGEN_MAKE_IMAGE_HELPERS(FullPivLU<MatrixType_>)
 
   enum { MaxSmallDimAtCompileTime = EIGEN_SIZE_MIN_PREFER_FIXED(
             MatrixType::MaxColsAtCompileTime,
@@ -740,9 +740,9 @@
 } // end namespace internal
 
 #ifndef EIGEN_PARSED_BY_DOXYGEN
-template<typename _MatrixType>
+template<typename MatrixType_>
 template<typename RhsType, typename DstType>
-void FullPivLU<_MatrixType>::_solve_impl(const RhsType &rhs, DstType &dst) const
+void FullPivLU<MatrixType_>::_solve_impl(const RhsType &rhs, DstType &dst) const
 {
   /* The decomposition PAQ = LU can be rewritten as A = P^{-1} L U Q^{-1}.
   * So we proceed as follows:
@@ -787,9 +787,9 @@
     dst.row(permutationQ().indices().coeff(i)).setZero();
 }
 
-template<typename _MatrixType>
+template<typename MatrixType_>
 template<bool Conjugate, typename RhsType, typename DstType>
-void FullPivLU<_MatrixType>::_solve_impl_transposed(const RhsType &rhs, DstType &dst) const
+void FullPivLU<MatrixType_>::_solve_impl_transposed(const RhsType &rhs, DstType &dst) const
 {
   /* The decomposition PAQ = LU can be rewritten as A = P^{-1} L U Q^{-1},
    * and since permutations are real and unitary, we can write this
diff --git a/Eigen/src/LU/PartialPivLU.h b/Eigen/src/LU/PartialPivLU.h
index 34aed72..52e4bcc 100644
--- a/Eigen/src/LU/PartialPivLU.h
+++ b/Eigen/src/LU/PartialPivLU.h
@@ -14,13 +14,13 @@
 namespace Eigen {
 
 namespace internal {
-template<typename _MatrixType> struct traits<PartialPivLU<_MatrixType> >
- : traits<_MatrixType>
+template<typename MatrixType_> struct traits<PartialPivLU<MatrixType_> >
+ : traits<MatrixType_>
 {
   typedef MatrixXpr XprKind;
   typedef SolverStorage StorageKind;
   typedef int StorageIndex;
-  typedef traits<_MatrixType> BaseTraits;
+  typedef traits<MatrixType_> BaseTraits;
   enum {
     Flags = BaseTraits::Flags & RowMajorBit,
     CoeffReadCost = Dynamic
@@ -46,7 +46,7 @@
   *
   * \brief LU decomposition of a matrix with partial pivoting, and related features
   *
-  * \tparam _MatrixType the type of the matrix of which we are computing the LU decomposition
+  * \tparam MatrixType_ the type of the matrix of which we are computing the LU decomposition
   *
   * This class represents a LU decomposition of a \b square \b invertible matrix, with partial pivoting: the matrix A
   * is decomposed as A = PLU where L is unit-lower-triangular, U is upper-triangular, and P
@@ -73,12 +73,12 @@
   *
   * \sa MatrixBase::partialPivLu(), MatrixBase::determinant(), MatrixBase::inverse(), MatrixBase::computeInverse(), class FullPivLU
   */
-template<typename _MatrixType> class PartialPivLU
-  : public SolverBase<PartialPivLU<_MatrixType> >
+template<typename MatrixType_> class PartialPivLU
+  : public SolverBase<PartialPivLU<MatrixType_> >
 {
   public:
 
-    typedef _MatrixType MatrixType;
+    typedef MatrixType_ MatrixType;
     typedef SolverBase<PartialPivLU> Base;
     friend class SolverBase<PartialPivLU>;
 
diff --git a/Eigen/src/PaStiXSupport/PaStiXSupport.h b/Eigen/src/PaStiXSupport/PaStiXSupport.h
index 3742687..cb133c5 100644
--- a/Eigen/src/PaStiXSupport/PaStiXSupport.h
+++ b/Eigen/src/PaStiXSupport/PaStiXSupport.h
@@ -28,40 +28,40 @@
   *
   * \sa TutorialSparseDirectSolvers
   */
-template<typename _MatrixType, bool IsStrSym = false> class PastixLU;
-template<typename _MatrixType, int Options> class PastixLLT;
-template<typename _MatrixType, int Options> class PastixLDLT;
+template<typename MatrixType_, bool IsStrSym = false> class PastixLU;
+template<typename MatrixType_, int Options> class PastixLLT;
+template<typename MatrixType_, int Options> class PastixLDLT;
 
 namespace internal
 {
     
   template<class Pastix> struct pastix_traits;
 
-  template<typename _MatrixType>
-  struct pastix_traits< PastixLU<_MatrixType> >
+  template<typename MatrixType_>
+  struct pastix_traits< PastixLU<MatrixType_> >
   {
-    typedef _MatrixType MatrixType;
-    typedef typename _MatrixType::Scalar Scalar;
-    typedef typename _MatrixType::RealScalar RealScalar;
-    typedef typename _MatrixType::StorageIndex StorageIndex;
+    typedef MatrixType_ MatrixType;
+    typedef typename MatrixType_::Scalar Scalar;
+    typedef typename MatrixType_::RealScalar RealScalar;
+    typedef typename MatrixType_::StorageIndex StorageIndex;
   };
 
-  template<typename _MatrixType, int Options>
-  struct pastix_traits< PastixLLT<_MatrixType,Options> >
+  template<typename MatrixType_, int Options>
+  struct pastix_traits< PastixLLT<MatrixType_,Options> >
   {
-    typedef _MatrixType MatrixType;
-    typedef typename _MatrixType::Scalar Scalar;
-    typedef typename _MatrixType::RealScalar RealScalar;
-    typedef typename _MatrixType::StorageIndex StorageIndex;
+    typedef MatrixType_ MatrixType;
+    typedef typename MatrixType_::Scalar Scalar;
+    typedef typename MatrixType_::RealScalar RealScalar;
+    typedef typename MatrixType_::StorageIndex StorageIndex;
   };
 
-  template<typename _MatrixType, int Options>
-  struct pastix_traits< PastixLDLT<_MatrixType,Options> >
+  template<typename MatrixType_, int Options>
+  struct pastix_traits< PastixLDLT<MatrixType_,Options> >
   {
-    typedef _MatrixType MatrixType;
-    typedef typename _MatrixType::Scalar Scalar;
-    typedef typename _MatrixType::RealScalar RealScalar;
-    typedef typename _MatrixType::StorageIndex StorageIndex;
+    typedef MatrixType_ MatrixType;
+    typedef typename MatrixType_::Scalar Scalar;
+    typedef typename MatrixType_::RealScalar RealScalar;
+    typedef typename MatrixType_::StorageIndex StorageIndex;
   };
   
   inline void eigen_pastix(pastix_data_t **pastix_data, int pastix_comm, int n, int *ptr, int *idx, float *vals, int *perm, int * invp, float *x, int nbrhs, int *iparm, double *dparm)
@@ -134,8 +134,8 @@
   public:
     using Base::_solve_impl;
     
-    typedef typename internal::pastix_traits<Derived>::MatrixType _MatrixType;
-    typedef _MatrixType MatrixType;
+    typedef typename internal::pastix_traits<Derived>::MatrixType MatrixType_;
+    typedef MatrixType_ MatrixType;
     typedef typename MatrixType::Scalar Scalar;
     typedef typename MatrixType::RealScalar RealScalar;
     typedef typename MatrixType::StorageIndex StorageIndex;
@@ -397,7 +397,7 @@
   * This interface can symmetrize the input matrix otherwise. 
   * The vectors or matrices X and B can be either dense or sparse.
   * 
-  * \tparam _MatrixType the type of the sparse matrix A, it must be a SparseMatrix<>
+  * \tparam MatrixType_ the type of the sparse matrix A, it must be a SparseMatrix<>
   * \tparam IsStrSym Indicates if the input matrix has a symmetric pattern, default is false
   * NOTE : Note that if the analysis and factorization phase are called separately, 
   * the input matrix will be symmetrized at each call, hence it is advised to 
@@ -408,11 +408,11 @@
   * \sa \ref TutorialSparseSolverConcept, class SparseLU
   * 
   */
-template<typename _MatrixType, bool IsStrSym>
-class PastixLU : public PastixBase< PastixLU<_MatrixType> >
+template<typename MatrixType_, bool IsStrSym>
+class PastixLU : public PastixBase< PastixLU<MatrixType_> >
 {
   public:
-    typedef _MatrixType MatrixType;
+    typedef MatrixType_ MatrixType;
     typedef PastixBase<PastixLU<MatrixType> > Base;
     typedef typename Base::ColSpMatrix ColSpMatrix;
     typedef typename MatrixType::StorageIndex StorageIndex;
@@ -520,16 +520,16 @@
   *
   * \sa \ref TutorialSparseSolverConcept, class SimplicialLLT
   */
-template<typename _MatrixType, int _UpLo>
-class PastixLLT : public PastixBase< PastixLLT<_MatrixType, _UpLo> >
+template<typename MatrixType_, int UpLo_>
+class PastixLLT : public PastixBase< PastixLLT<MatrixType_, UpLo_> >
 {
   public:
-    typedef _MatrixType MatrixType;
-    typedef PastixBase<PastixLLT<MatrixType, _UpLo> > Base;
+    typedef MatrixType_ MatrixType;
+    typedef PastixBase<PastixLLT<MatrixType, UpLo_> > Base;
     typedef typename Base::ColSpMatrix ColSpMatrix;
     
   public:
-    enum { UpLo = _UpLo };
+    enum { UpLo = UpLo_ };
     PastixLLT() : Base()
     {
       init();
@@ -604,16 +604,16 @@
   *
   * \sa \ref TutorialSparseSolverConcept, class SimplicialLDLT
   */
-template<typename _MatrixType, int _UpLo>
-class PastixLDLT : public PastixBase< PastixLDLT<_MatrixType, _UpLo> >
+template<typename MatrixType_, int UpLo_>
+class PastixLDLT : public PastixBase< PastixLDLT<MatrixType_, UpLo_> >
 {
   public:
-    typedef _MatrixType MatrixType;
-    typedef PastixBase<PastixLDLT<MatrixType, _UpLo> > Base; 
+    typedef MatrixType_ MatrixType;
+    typedef PastixBase<PastixLDLT<MatrixType, UpLo_> > Base;
     typedef typename Base::ColSpMatrix ColSpMatrix;
     
   public:
-    enum { UpLo = _UpLo };
+    enum { UpLo = UpLo_ };
     PastixLDLT():Base()
     {
       init();
diff --git a/Eigen/src/PardisoSupport/PardisoSupport.h b/Eigen/src/PardisoSupport/PardisoSupport.h
index f89b79b..f09856a 100644
--- a/Eigen/src/PardisoSupport/PardisoSupport.h
+++ b/Eigen/src/PardisoSupport/PardisoSupport.h
@@ -34,9 +34,9 @@
 
 namespace Eigen { 
 
-template<typename _MatrixType> class PardisoLU;
-template<typename _MatrixType, int Options=Upper> class PardisoLLT;
-template<typename _MatrixType, int Options=Upper> class PardisoLDLT;
+template<typename MatrixType_> class PardisoLU;
+template<typename MatrixType_, int Options=Upper> class PardisoLLT;
+template<typename MatrixType_, int Options=Upper> class PardisoLDLT;
 
 namespace internal
 {
@@ -66,31 +66,31 @@
 
   template<class Pardiso> struct pardiso_traits;
 
-  template<typename _MatrixType>
-  struct pardiso_traits< PardisoLU<_MatrixType> >
+  template<typename MatrixType_>
+  struct pardiso_traits< PardisoLU<MatrixType_> >
   {
-    typedef _MatrixType MatrixType;
-    typedef typename _MatrixType::Scalar Scalar;
-    typedef typename _MatrixType::RealScalar RealScalar;
-    typedef typename _MatrixType::StorageIndex StorageIndex;
+    typedef MatrixType_ MatrixType;
+    typedef typename MatrixType_::Scalar Scalar;
+    typedef typename MatrixType_::RealScalar RealScalar;
+    typedef typename MatrixType_::StorageIndex StorageIndex;
   };
 
-  template<typename _MatrixType, int Options>
-  struct pardiso_traits< PardisoLLT<_MatrixType, Options> >
+  template<typename MatrixType_, int Options>
+  struct pardiso_traits< PardisoLLT<MatrixType_, Options> >
   {
-    typedef _MatrixType MatrixType;
-    typedef typename _MatrixType::Scalar Scalar;
-    typedef typename _MatrixType::RealScalar RealScalar;
-    typedef typename _MatrixType::StorageIndex StorageIndex;
+    typedef MatrixType_ MatrixType;
+    typedef typename MatrixType_::Scalar Scalar;
+    typedef typename MatrixType_::RealScalar RealScalar;
+    typedef typename MatrixType_::StorageIndex StorageIndex;
   };
 
-  template<typename _MatrixType, int Options>
-  struct pardiso_traits< PardisoLDLT<_MatrixType, Options> >
+  template<typename MatrixType_, int Options>
+  struct pardiso_traits< PardisoLDLT<MatrixType_, Options> >
   {
-    typedef _MatrixType MatrixType;
-    typedef typename _MatrixType::Scalar Scalar;
-    typedef typename _MatrixType::RealScalar RealScalar;
-    typedef typename _MatrixType::StorageIndex StorageIndex;    
+    typedef MatrixType_ MatrixType;
+    typedef typename MatrixType_::Scalar Scalar;
+    typedef typename MatrixType_::RealScalar RealScalar;
+    typedef typename MatrixType_::StorageIndex StorageIndex;
   };
 
 } // end namespace internal
@@ -375,7 +375,7 @@
   * By default, it runs in in-core mode. To enable PARDISO's out-of-core feature, set:
   * \code solver.pardisoParameterArray()[59] = 1; \endcode
   *
-  * \tparam _MatrixType the type of the sparse matrix A, it must be a SparseMatrix<>
+  * \tparam MatrixType_ the type of the sparse matrix A, it must be a SparseMatrix<>
   *
   * \implsparsesolverconcept
   *
@@ -437,21 +437,21 @@
   *
   * \sa \ref TutorialSparseSolverConcept, class SimplicialLLT
   */
-template<typename MatrixType, int _UpLo>
-class PardisoLLT : public PardisoImpl< PardisoLLT<MatrixType,_UpLo> >
+template<typename MatrixType, int UpLo_>
+class PardisoLLT : public PardisoImpl< PardisoLLT<MatrixType,UpLo_> >
 {
   protected:
-    typedef PardisoImpl< PardisoLLT<MatrixType,_UpLo> > Base;
+    typedef PardisoImpl< PardisoLLT<MatrixType,UpLo_> > Base;
     using Base::pardisoInit;
     using Base::m_matrix;
-    friend class PardisoImpl< PardisoLLT<MatrixType,_UpLo> >;
+    friend class PardisoImpl< PardisoLLT<MatrixType,UpLo_> >;
 
   public:
 
     typedef typename Base::Scalar Scalar;
     typedef typename Base::RealScalar RealScalar;
     typedef typename Base::StorageIndex StorageIndex;
-    enum { UpLo = _UpLo };
+    enum { UpLo = UpLo_ };
     using Base::compute;
 
     PardisoLLT()
diff --git a/Eigen/src/QR/ColPivHouseholderQR.h b/Eigen/src/QR/ColPivHouseholderQR.h
index 9b677e9..3c884e7 100644
--- a/Eigen/src/QR/ColPivHouseholderQR.h
+++ b/Eigen/src/QR/ColPivHouseholderQR.h
@@ -14,8 +14,8 @@
 namespace Eigen {
 
 namespace internal {
-template<typename _MatrixType> struct traits<ColPivHouseholderQR<_MatrixType> >
- : traits<_MatrixType>
+template<typename MatrixType_> struct traits<ColPivHouseholderQR<MatrixType_> >
+ : traits<MatrixType_>
 {
   typedef MatrixXpr XprKind;
   typedef SolverStorage StorageKind;
@@ -31,7 +31,7 @@
   *
   * \brief Householder rank-revealing QR decomposition of a matrix with column-pivoting
   *
-  * \tparam _MatrixType the type of the matrix of which we are computing the QR decomposition
+  * \tparam MatrixType_ the type of the matrix of which we are computing the QR decomposition
   *
   * This class performs a rank-revealing QR decomposition of a matrix \b A into matrices \b P, \b Q and \b R
   * such that
@@ -48,12 +48,12 @@
   * 
   * \sa MatrixBase::colPivHouseholderQr()
   */
-template<typename _MatrixType> class ColPivHouseholderQR
-        : public SolverBase<ColPivHouseholderQR<_MatrixType> >
+template<typename MatrixType_> class ColPivHouseholderQR
+        : public SolverBase<ColPivHouseholderQR<MatrixType_> >
 {
   public:
 
-    typedef _MatrixType MatrixType;
+    typedef MatrixType_ MatrixType;
     typedef SolverBase<ColPivHouseholderQR> Base;
     friend class SolverBase<ColPivHouseholderQR>;
 
@@ -582,9 +582,9 @@
 }
 
 #ifndef EIGEN_PARSED_BY_DOXYGEN
-template<typename _MatrixType>
+template<typename MatrixType_>
 template<typename RhsType, typename DstType>
-void ColPivHouseholderQR<_MatrixType>::_solve_impl(const RhsType &rhs, DstType &dst) const
+void ColPivHouseholderQR<MatrixType_>::_solve_impl(const RhsType &rhs, DstType &dst) const
 {
   const Index nonzero_pivots = nonzeroPivots();
 
@@ -606,9 +606,9 @@
   for(Index i = nonzero_pivots; i < cols(); ++i) dst.row(m_colsPermutation.indices().coeff(i)).setZero();
 }
 
-template<typename _MatrixType>
+template<typename MatrixType_>
 template<bool Conjugate, typename RhsType, typename DstType>
-void ColPivHouseholderQR<_MatrixType>::_solve_impl_transposed(const RhsType &rhs, DstType &dst) const
+void ColPivHouseholderQR<MatrixType_>::_solve_impl_transposed(const RhsType &rhs, DstType &dst) const
 {
   const Index nonzero_pivots = nonzeroPivots();
 
diff --git a/Eigen/src/QR/CompleteOrthogonalDecomposition.h b/Eigen/src/QR/CompleteOrthogonalDecomposition.h
index 486d337..0445edb 100644
--- a/Eigen/src/QR/CompleteOrthogonalDecomposition.h
+++ b/Eigen/src/QR/CompleteOrthogonalDecomposition.h
@@ -13,9 +13,9 @@
 namespace Eigen {
 
 namespace internal {
-template <typename _MatrixType>
-struct traits<CompleteOrthogonalDecomposition<_MatrixType> >
-    : traits<_MatrixType> {
+template <typename MatrixType_>
+struct traits<CompleteOrthogonalDecomposition<MatrixType_> >
+    : traits<MatrixType_> {
   typedef MatrixXpr XprKind;
   typedef SolverStorage StorageKind;
   typedef int StorageIndex;
@@ -47,11 +47,11 @@
   * 
   * \sa MatrixBase::completeOrthogonalDecomposition()
   */
-template <typename _MatrixType> class CompleteOrthogonalDecomposition
-          : public SolverBase<CompleteOrthogonalDecomposition<_MatrixType> >
+template <typename MatrixType_> class CompleteOrthogonalDecomposition
+          : public SolverBase<CompleteOrthogonalDecomposition<MatrixType_> >
 {
  public:
-  typedef _MatrixType MatrixType;
+  typedef MatrixType_ MatrixType;
   typedef SolverBase<CompleteOrthogonalDecomposition> Base;
 
   template<typename Derived>
@@ -529,9 +529,9 @@
 }
 
 #ifndef EIGEN_PARSED_BY_DOXYGEN
-template <typename _MatrixType>
+template <typename MatrixType_>
 template <typename RhsType, typename DstType>
-void CompleteOrthogonalDecomposition<_MatrixType>::_solve_impl(
+void CompleteOrthogonalDecomposition<MatrixType_>::_solve_impl(
     const RhsType& rhs, DstType& dst) const {
   const Index rank = this->rank();
   if (rank == 0) {
@@ -561,9 +561,9 @@
   dst = colsPermutation() * dst;
 }
 
-template<typename _MatrixType>
+template<typename MatrixType_>
 template<bool Conjugate, typename RhsType, typename DstType>
-void CompleteOrthogonalDecomposition<_MatrixType>::_solve_impl_transposed(const RhsType &rhs, DstType &dst) const
+void CompleteOrthogonalDecomposition<MatrixType_>::_solve_impl_transposed(const RhsType &rhs, DstType &dst) const
 {
   const Index rank = this->rank();
 
diff --git a/Eigen/src/QR/FullPivHouseholderQR.h b/Eigen/src/QR/FullPivHouseholderQR.h
index d0664a1..68585df 100644
--- a/Eigen/src/QR/FullPivHouseholderQR.h
+++ b/Eigen/src/QR/FullPivHouseholderQR.h
@@ -15,8 +15,8 @@
 
 namespace internal {
 
-template<typename _MatrixType> struct traits<FullPivHouseholderQR<_MatrixType> >
- : traits<_MatrixType>
+template<typename MatrixType_> struct traits<FullPivHouseholderQR<MatrixType_> >
+ : traits<MatrixType_>
 {
   typedef MatrixXpr XprKind;
   typedef SolverStorage StorageKind;
@@ -40,7 +40,7 @@
   *
   * \brief Householder rank-revealing QR decomposition of a matrix with full pivoting
   *
-  * \tparam _MatrixType the type of the matrix of which we are computing the QR decomposition
+  * \tparam MatrixType_ the type of the matrix of which we are computing the QR decomposition
   *
   * This class performs a rank-revealing QR decomposition of a matrix \b A into matrices \b P, \b P', \b Q and \b R
   * such that 
@@ -57,12 +57,12 @@
   * 
   * \sa MatrixBase::fullPivHouseholderQr()
   */
-template<typename _MatrixType> class FullPivHouseholderQR
-        : public SolverBase<FullPivHouseholderQR<_MatrixType> >
+template<typename MatrixType_> class FullPivHouseholderQR
+        : public SolverBase<FullPivHouseholderQR<MatrixType_> >
 {
   public:
 
-    typedef _MatrixType MatrixType;
+    typedef MatrixType_ MatrixType;
     typedef SolverBase<FullPivHouseholderQR> Base;
     friend class SolverBase<FullPivHouseholderQR>;
 
@@ -539,9 +539,9 @@
 }
 
 #ifndef EIGEN_PARSED_BY_DOXYGEN
-template<typename _MatrixType>
+template<typename MatrixType_>
 template<typename RhsType, typename DstType>
-void FullPivHouseholderQR<_MatrixType>::_solve_impl(const RhsType &rhs, DstType &dst) const
+void FullPivHouseholderQR<MatrixType_>::_solve_impl(const RhsType &rhs, DstType &dst) const
 {
   const Index l_rank = rank();
 
@@ -573,9 +573,9 @@
   for(Index i = l_rank; i < cols(); ++i) dst.row(m_cols_permutation.indices().coeff(i)).setZero();
 }
 
-template<typename _MatrixType>
+template<typename MatrixType_>
 template<bool Conjugate, typename RhsType, typename DstType>
-void FullPivHouseholderQR<_MatrixType>::_solve_impl_transposed(const RhsType &rhs, DstType &dst) const
+void FullPivHouseholderQR<MatrixType_>::_solve_impl_transposed(const RhsType &rhs, DstType &dst) const
 {
   const Index l_rank = rank();
 
diff --git a/Eigen/src/QR/HouseholderQR.h b/Eigen/src/QR/HouseholderQR.h
index 801739f..d2216c5 100644
--- a/Eigen/src/QR/HouseholderQR.h
+++ b/Eigen/src/QR/HouseholderQR.h
@@ -15,8 +15,8 @@
 namespace Eigen { 
 
 namespace internal {
-template<typename _MatrixType> struct traits<HouseholderQR<_MatrixType> >
- : traits<_MatrixType>
+template<typename MatrixType_> struct traits<HouseholderQR<MatrixType_> >
+ : traits<MatrixType_>
 {
   typedef MatrixXpr XprKind;
   typedef SolverStorage StorageKind;
@@ -33,7 +33,7 @@
   *
   * \brief Householder QR decomposition of a matrix
   *
-  * \tparam _MatrixType the type of the matrix of which we are computing the QR decomposition
+  * \tparam MatrixType_ the type of the matrix of which we are computing the QR decomposition
   *
   * This class performs a QR decomposition of a matrix \b A into matrices \b Q and \b R
   * such that 
@@ -53,12 +53,12 @@
   *
   * \sa MatrixBase::householderQr()
   */
-template<typename _MatrixType> class HouseholderQR
-        : public SolverBase<HouseholderQR<_MatrixType> >
+template<typename MatrixType_> class HouseholderQR
+        : public SolverBase<HouseholderQR<MatrixType_> >
 {
   public:
 
-    typedef _MatrixType MatrixType;
+    typedef MatrixType_ MatrixType;
     typedef SolverBase<HouseholderQR> Base;
     friend class SolverBase<HouseholderQR>;
 
@@ -356,9 +356,9 @@
 } // end namespace internal
 
 #ifndef EIGEN_PARSED_BY_DOXYGEN
-template<typename _MatrixType>
+template<typename MatrixType_>
 template<typename RhsType, typename DstType>
-void HouseholderQR<_MatrixType>::_solve_impl(const RhsType &rhs, DstType &dst) const
+void HouseholderQR<MatrixType_>::_solve_impl(const RhsType &rhs, DstType &dst) const
 {
   const Index rank = (std::min)(rows(), cols());
 
@@ -374,9 +374,9 @@
   dst.bottomRows(cols()-rank).setZero();
 }
 
-template<typename _MatrixType>
+template<typename MatrixType_>
 template<bool Conjugate, typename RhsType, typename DstType>
-void HouseholderQR<_MatrixType>::_solve_impl_transposed(const RhsType &rhs, DstType &dst) const
+void HouseholderQR<MatrixType_>::_solve_impl_transposed(const RhsType &rhs, DstType &dst) const
 {
   const Index rank = (std::min)(rows(), cols());
 
diff --git a/Eigen/src/SPQRSupport/SuiteSparseQRSupport.h b/Eigen/src/SPQRSupport/SuiteSparseQRSupport.h
index 013c7ae..0826c4d 100644
--- a/Eigen/src/SPQRSupport/SuiteSparseQRSupport.h
+++ b/Eigen/src/SPQRSupport/SuiteSparseQRSupport.h
@@ -50,21 +50,21 @@
   * R is the sparse triangular factor. Use matrixQR() to get it as SparseMatrix.
   * NOTE : The Index type of R is always SuiteSparse_long. You can get it with SPQR::Index
   *
-  * \tparam _MatrixType The type of the sparse matrix A, must be a column-major SparseMatrix<>
+  * \tparam MatrixType_ The type of the sparse matrix A, must be a column-major SparseMatrix<>
   *
   * \implsparsesolverconcept
   *
   *
   */
-template<typename _MatrixType>
-class SPQR : public SparseSolverBase<SPQR<_MatrixType> >
+template<typename MatrixType_>
+class SPQR : public SparseSolverBase<SPQR<MatrixType_> >
 {
   protected:
-    typedef SparseSolverBase<SPQR<_MatrixType> > Base;
+    typedef SparseSolverBase<SPQR<MatrixType_> > Base;
     using Base::m_isInitialized;
   public:
-    typedef typename _MatrixType::Scalar Scalar;
-    typedef typename _MatrixType::RealScalar RealScalar;
+    typedef typename MatrixType_::Scalar Scalar;
+    typedef typename MatrixType_::RealScalar RealScalar;
     typedef SuiteSparse_long StorageIndex ;
     typedef SparseMatrix<Scalar, ColMajor, StorageIndex> MatrixType;
     typedef Map<PermutationMatrix<Dynamic, Dynamic, StorageIndex> > PermutationType;
@@ -90,7 +90,7 @@
       cholmod_l_start(&m_cc);
     }
     
-    explicit SPQR(const _MatrixType& matrix)
+    explicit SPQR(const MatrixType_& matrix)
       : m_analysisIsOk(false),
         m_factorizationIsOk(false),
         m_isRUpToDate(false),
@@ -122,7 +122,7 @@
       std::free(m_HPinv);
     }
 
-    void compute(const _MatrixType& matrix)
+    void compute(const MatrixType_& matrix)
     {
       if(m_isInitialized) SPQR_free();
 
diff --git a/Eigen/src/SVD/BDCSVD.h b/Eigen/src/SVD/BDCSVD.h
index 17f8e44..31a766d 100644
--- a/Eigen/src/SVD/BDCSVD.h
+++ b/Eigen/src/SVD/BDCSVD.h
@@ -33,15 +33,15 @@
 IOFormat bdcsvdfmt(8, 0, ", ", "\n", "  [", "]");
 #endif
   
-template<typename _MatrixType> class BDCSVD;
+template<typename MatrixType_> class BDCSVD;
 
 namespace internal {
 
-template<typename _MatrixType> 
-struct traits<BDCSVD<_MatrixType> >
-        : traits<_MatrixType>
+template<typename MatrixType_>
+struct traits<BDCSVD<MatrixType_> >
+        : traits<MatrixType_>
 {
-  typedef _MatrixType MatrixType;
+  typedef MatrixType_ MatrixType;
 };  
 
 } // end namespace internal
@@ -54,7 +54,7 @@
  *
  * \brief class Bidiagonal Divide and Conquer SVD
  *
- * \tparam _MatrixType the type of the matrix of which we are computing the SVD decomposition
+ * \tparam MatrixType_ the type of the matrix of which we are computing the SVD decomposition
  *
  * This class first reduces the input matrix to bi-diagonal form using class UpperBidiagonalization,
  * and then performs a divide-and-conquer diagonalization. Small blocks are diagonalized using class JacobiSVD.
@@ -69,8 +69,8 @@
  *
  * \sa class JacobiSVD
  */
-template<typename _MatrixType> 
-class BDCSVD : public SVDBase<BDCSVD<_MatrixType> >
+template<typename MatrixType_>
+class BDCSVD : public SVDBase<BDCSVD<MatrixType_> >
 {
   typedef SVDBase<BDCSVD> Base;
     
@@ -80,7 +80,7 @@
   using Base::computeU;
   using Base::computeV;
   
-  typedef _MatrixType MatrixType;
+  typedef MatrixType_ MatrixType;
   typedef typename MatrixType::Scalar Scalar;
   typedef typename NumTraits<typename MatrixType::Scalar>::Real RealScalar;
   typedef typename NumTraits<RealScalar>::Literal Literal;
diff --git a/Eigen/src/SVD/JacobiSVD.h b/Eigen/src/SVD/JacobiSVD.h
index 9d95acd..b135fb0 100644
--- a/Eigen/src/SVD/JacobiSVD.h
+++ b/Eigen/src/SVD/JacobiSVD.h
@@ -423,11 +423,11 @@
   }
 };
 
-template<typename _MatrixType, int QRPreconditioner> 
-struct traits<JacobiSVD<_MatrixType,QRPreconditioner> >
-        : traits<_MatrixType>
+template<typename MatrixType_, int QRPreconditioner>
+struct traits<JacobiSVD<MatrixType_,QRPreconditioner> >
+        : traits<MatrixType_>
 {
-  typedef _MatrixType MatrixType;
+  typedef MatrixType_ MatrixType;
 };
 
 } // end namespace internal
@@ -439,7 +439,7 @@
   *
   * \brief Two-sided Jacobi SVD decomposition of a rectangular matrix
   *
-  * \tparam _MatrixType the type of the matrix of which we are computing the SVD decomposition
+  * \tparam MatrixType_ the type of the matrix of which we are computing the SVD decomposition
   * \tparam QRPreconditioner this optional parameter allows to specify the type of QR decomposition that will be used internally
   *                        for the R-SVD step for non-square matrices. See discussion of possible values below.
   *
@@ -485,13 +485,13 @@
   *
   * \sa MatrixBase::jacobiSvd()
   */
-template<typename _MatrixType, int QRPreconditioner> class JacobiSVD
- : public SVDBase<JacobiSVD<_MatrixType,QRPreconditioner> >
+template<typename MatrixType_, int QRPreconditioner> class JacobiSVD
+ : public SVDBase<JacobiSVD<MatrixType_,QRPreconditioner> >
 {
     typedef SVDBase<JacobiSVD> Base;
   public:
 
-    typedef _MatrixType MatrixType;
+    typedef MatrixType_ MatrixType;
     typedef typename MatrixType::Scalar Scalar;
     typedef typename NumTraits<typename MatrixType::Scalar>::Real RealScalar;
     enum {
@@ -601,9 +601,9 @@
     using Base::m_prescribedThreshold;
     WorkMatrixType m_workMatrix;
 
-    template<typename __MatrixType, int _QRPreconditioner, bool _IsComplex>
+    template<typename MatrixType__, int QRPreconditioner_, bool IsComplex_>
     friend struct internal::svd_precondition_2x2_block_to_be_real;
-    template<typename __MatrixType, int _QRPreconditioner, int _Case, bool _DoAnything>
+    template<typename MatrixType__, int QRPreconditioner_, int Case_, bool DoAnything_>
     friend struct internal::qr_preconditioner_impl;
 
     internal::qr_preconditioner_impl<MatrixType, QRPreconditioner, internal::PreconditionIfMoreColsThanRows> m_qr_precond_morecols;
diff --git a/Eigen/src/SVD/UpperBidiagonalization.h b/Eigen/src/SVD/UpperBidiagonalization.h
index 997defc..48d6385 100644
--- a/Eigen/src/SVD/UpperBidiagonalization.h
+++ b/Eigen/src/SVD/UpperBidiagonalization.h
@@ -17,11 +17,11 @@
 // UpperBidiagonalization will probably be replaced by a Bidiagonalization class, don't want to make it stable API.
 // At the same time, it's useful to keep for now as it's about the only thing that is testing the BandMatrix class.
 
-template<typename _MatrixType> class UpperBidiagonalization
+template<typename MatrixType_> class UpperBidiagonalization
 {
   public:
 
-    typedef _MatrixType MatrixType;
+    typedef MatrixType_ MatrixType;
     enum {
       RowsAtCompileTime = MatrixType::RowsAtCompileTime,
       ColsAtCompileTime = MatrixType::ColsAtCompileTime,
@@ -355,8 +355,8 @@
   }
 }
 
-template<typename _MatrixType>
-UpperBidiagonalization<_MatrixType>& UpperBidiagonalization<_MatrixType>::computeUnblocked(const _MatrixType& matrix)
+template<typename MatrixType_>
+UpperBidiagonalization<MatrixType_>& UpperBidiagonalization<MatrixType_>::computeUnblocked(const MatrixType_& matrix)
 {
   Index rows = matrix.rows();
   Index cols = matrix.cols();
@@ -377,8 +377,8 @@
   return *this;
 }
 
-template<typename _MatrixType>
-UpperBidiagonalization<_MatrixType>& UpperBidiagonalization<_MatrixType>::compute(const _MatrixType& matrix)
+template<typename MatrixType_>
+UpperBidiagonalization<MatrixType_>& UpperBidiagonalization<MatrixType_>::compute(const MatrixType_& matrix)
 {
   Index rows = matrix.rows();
   Index cols = matrix.cols();
diff --git a/Eigen/src/SparseCholesky/SimplicialCholesky.h b/Eigen/src/SparseCholesky/SimplicialCholesky.h
index 9f93e32..cbd3089 100644
--- a/Eigen/src/SparseCholesky/SimplicialCholesky.h
+++ b/Eigen/src/SparseCholesky/SimplicialCholesky.h
@@ -271,17 +271,17 @@
     RealScalar m_shiftScale;
 };
 
-template<typename _MatrixType, int _UpLo = Lower, typename _Ordering = AMDOrdering<typename _MatrixType::StorageIndex> > class SimplicialLLT;
-template<typename _MatrixType, int _UpLo = Lower, typename _Ordering = AMDOrdering<typename _MatrixType::StorageIndex> > class SimplicialLDLT;
-template<typename _MatrixType, int _UpLo = Lower, typename _Ordering = AMDOrdering<typename _MatrixType::StorageIndex> > class SimplicialCholesky;
+template<typename MatrixType_, int UpLo_ = Lower, typename Ordering_ = AMDOrdering<typename MatrixType_::StorageIndex> > class SimplicialLLT;
+template<typename MatrixType_, int UpLo_ = Lower, typename Ordering_ = AMDOrdering<typename MatrixType_::StorageIndex> > class SimplicialLDLT;
+template<typename MatrixType_, int UpLo_ = Lower, typename Ordering_ = AMDOrdering<typename MatrixType_::StorageIndex> > class SimplicialCholesky;
 
 namespace internal {
 
-template<typename _MatrixType, int _UpLo, typename _Ordering> struct traits<SimplicialLLT<_MatrixType,_UpLo,_Ordering> >
+template<typename MatrixType_, int UpLo_, typename Ordering_> struct traits<SimplicialLLT<MatrixType_,UpLo_,Ordering_> >
 {
-  typedef _MatrixType MatrixType;
-  typedef _Ordering OrderingType;
-  enum { UpLo = _UpLo };
+  typedef MatrixType_ MatrixType;
+  typedef Ordering_ OrderingType;
+  enum { UpLo = UpLo_ };
   typedef typename MatrixType::Scalar                         Scalar;
   typedef typename MatrixType::StorageIndex                   StorageIndex;
   typedef SparseMatrix<Scalar, ColMajor, StorageIndex>        CholMatrixType;
@@ -291,11 +291,11 @@
   static inline MatrixU getU(const CholMatrixType& m) { return MatrixU(m.adjoint()); }
 };
 
-template<typename _MatrixType,int _UpLo, typename _Ordering> struct traits<SimplicialLDLT<_MatrixType,_UpLo,_Ordering> >
+template<typename MatrixType_,int UpLo_, typename Ordering_> struct traits<SimplicialLDLT<MatrixType_,UpLo_,Ordering_> >
 {
-  typedef _MatrixType MatrixType;
-  typedef _Ordering OrderingType;
-  enum { UpLo = _UpLo };
+  typedef MatrixType_ MatrixType;
+  typedef Ordering_ OrderingType;
+  enum { UpLo = UpLo_ };
   typedef typename MatrixType::Scalar                             Scalar;
   typedef typename MatrixType::StorageIndex                       StorageIndex;
   typedef SparseMatrix<Scalar, ColMajor, StorageIndex>            CholMatrixType;
@@ -305,11 +305,11 @@
   static inline MatrixU getU(const CholMatrixType& m) { return MatrixU(m.adjoint()); }
 };
 
-template<typename _MatrixType, int _UpLo, typename _Ordering> struct traits<SimplicialCholesky<_MatrixType,_UpLo,_Ordering> >
+template<typename MatrixType_, int UpLo_, typename Ordering_> struct traits<SimplicialCholesky<MatrixType_,UpLo_,Ordering_> >
 {
-  typedef _MatrixType MatrixType;
-  typedef _Ordering OrderingType;
-  enum { UpLo = _UpLo };
+  typedef MatrixType_ MatrixType;
+  typedef Ordering_ OrderingType;
+  enum { UpLo = UpLo_ };
 };
 
 }
@@ -325,21 +325,21 @@
   * In order to reduce the fill-in, a symmetric permutation P is applied prior to the factorization
   * such that the factorized matrix is P A P^-1.
   *
-  * \tparam _MatrixType the type of the sparse matrix A, it must be a SparseMatrix<>
-  * \tparam _UpLo the triangular part that will be used for the computations. It can be Lower
+  * \tparam MatrixType_ the type of the sparse matrix A, it must be a SparseMatrix<>
+  * \tparam UpLo_ the triangular part that will be used for the computations. It can be Lower
   *               or Upper. Default is Lower.
-  * \tparam _Ordering The ordering method to use, either AMDOrdering<> or NaturalOrdering<>. Default is AMDOrdering<>
+  * \tparam Ordering_ The ordering method to use, either AMDOrdering<> or NaturalOrdering<>. Default is AMDOrdering<>
   *
   * \implsparsesolverconcept
   *
   * \sa class SimplicialLDLT, class AMDOrdering, class NaturalOrdering
   */
-template<typename _MatrixType, int _UpLo, typename _Ordering>
-    class SimplicialLLT : public SimplicialCholeskyBase<SimplicialLLT<_MatrixType,_UpLo,_Ordering> >
+template<typename MatrixType_, int UpLo_, typename Ordering_>
+    class SimplicialLLT : public SimplicialCholeskyBase<SimplicialLLT<MatrixType_,UpLo_,Ordering_> >
 {
 public:
-    typedef _MatrixType MatrixType;
-    enum { UpLo = _UpLo };
+    typedef MatrixType_ MatrixType;
+    enum { UpLo = UpLo_ };
     typedef SimplicialCholeskyBase<SimplicialLLT> Base;
     typedef typename MatrixType::Scalar Scalar;
     typedef typename MatrixType::RealScalar RealScalar;
@@ -416,21 +416,21 @@
   * In order to reduce the fill-in, a symmetric permutation P is applied prior to the factorization
   * such that the factorized matrix is P A P^-1.
   *
-  * \tparam _MatrixType the type of the sparse matrix A, it must be a SparseMatrix<>
-  * \tparam _UpLo the triangular part that will be used for the computations. It can be Lower
+  * \tparam MatrixType_ the type of the sparse matrix A, it must be a SparseMatrix<>
+  * \tparam UpLo_ the triangular part that will be used for the computations. It can be Lower
   *               or Upper. Default is Lower.
-  * \tparam _Ordering The ordering method to use, either AMDOrdering<> or NaturalOrdering<>. Default is AMDOrdering<>
+  * \tparam Ordering_ The ordering method to use, either AMDOrdering<> or NaturalOrdering<>. Default is AMDOrdering<>
   *
   * \implsparsesolverconcept
   *
   * \sa class SimplicialLLT, class AMDOrdering, class NaturalOrdering
   */
-template<typename _MatrixType, int _UpLo, typename _Ordering>
-    class SimplicialLDLT : public SimplicialCholeskyBase<SimplicialLDLT<_MatrixType,_UpLo,_Ordering> >
+template<typename MatrixType_, int UpLo_, typename Ordering_>
+    class SimplicialLDLT : public SimplicialCholeskyBase<SimplicialLDLT<MatrixType_,UpLo_,Ordering_> >
 {
 public:
-    typedef _MatrixType MatrixType;
-    enum { UpLo = _UpLo };
+    typedef MatrixType_ MatrixType;
+    enum { UpLo = UpLo_ };
     typedef SimplicialCholeskyBase<SimplicialLDLT> Base;
     typedef typename MatrixType::Scalar Scalar;
     typedef typename MatrixType::RealScalar RealScalar;
@@ -507,12 +507,12 @@
   *
   * \sa class SimplicialLDLT, class SimplicialLLT
   */
-template<typename _MatrixType, int _UpLo, typename _Ordering>
-    class SimplicialCholesky : public SimplicialCholeskyBase<SimplicialCholesky<_MatrixType,_UpLo,_Ordering> >
+template<typename MatrixType_, int UpLo_, typename Ordering_>
+    class SimplicialCholesky : public SimplicialCholeskyBase<SimplicialCholesky<MatrixType_,UpLo_,Ordering_> >
 {
 public:
-    typedef _MatrixType MatrixType;
-    enum { UpLo = _UpLo };
+    typedef MatrixType_ MatrixType;
+    enum { UpLo = UpLo_ };
     typedef SimplicialCholeskyBase<SimplicialCholesky> Base;
     typedef typename MatrixType::Scalar Scalar;
     typedef typename MatrixType::RealScalar RealScalar;
diff --git a/Eigen/src/SparseCore/AmbiVector.h b/Eigen/src/SparseCore/AmbiVector.h
index 2cb7747..212389b 100644
--- a/Eigen/src/SparseCore/AmbiVector.h
+++ b/Eigen/src/SparseCore/AmbiVector.h
@@ -19,12 +19,12 @@
   *
   * See BasicSparseLLT and SparseProduct for usage examples.
   */
-template<typename _Scalar, typename _StorageIndex>
+template<typename Scalar_, typename StorageIndex_>
 class AmbiVector
 {
   public:
-    typedef _Scalar Scalar;
-    typedef _StorageIndex StorageIndex;
+    typedef Scalar_ Scalar;
+    typedef StorageIndex_ StorageIndex;
     typedef typename NumTraits<Scalar>::Real RealScalar;
 
     explicit AmbiVector(Index size)
@@ -125,8 +125,8 @@
 };
 
 /** \returns the number of non zeros in the current sub vector */
-template<typename _Scalar,typename _StorageIndex>
-Index AmbiVector<_Scalar,_StorageIndex>::nonZeros() const
+template<typename Scalar_,typename StorageIndex_>
+Index AmbiVector<Scalar_,StorageIndex_>::nonZeros() const
 {
   if (m_mode==IsSparse)
     return m_llSize;
@@ -134,8 +134,8 @@
     return m_end - m_start;
 }
 
-template<typename _Scalar,typename _StorageIndex>
-void AmbiVector<_Scalar,_StorageIndex>::init(double estimatedDensity)
+template<typename Scalar_,typename StorageIndex_>
+void AmbiVector<Scalar_,StorageIndex_>::init(double estimatedDensity)
 {
   if (estimatedDensity>0.1)
     init(IsDense);
@@ -143,8 +143,8 @@
     init(IsSparse);
 }
 
-template<typename _Scalar,typename _StorageIndex>
-void AmbiVector<_Scalar,_StorageIndex>::init(int mode)
+template<typename Scalar_,typename StorageIndex_>
+void AmbiVector<Scalar_,StorageIndex_>::init(int mode)
 {
   m_mode = mode;
   // This is only necessary in sparse mode, but we set these unconditionally to avoid some maybe-uninitialized warnings
@@ -160,15 +160,15 @@
   *
   * Don't worry, this function is extremely cheap.
   */
-template<typename _Scalar,typename _StorageIndex>
-void AmbiVector<_Scalar,_StorageIndex>::restart()
+template<typename Scalar_,typename StorageIndex_>
+void AmbiVector<Scalar_,StorageIndex_>::restart()
 {
   m_llCurrent = m_llStart;
 }
 
 /** Set all coefficients of current subvector to zero */
-template<typename _Scalar,typename _StorageIndex>
-void AmbiVector<_Scalar,_StorageIndex>::setZero()
+template<typename Scalar_,typename StorageIndex_>
+void AmbiVector<Scalar_,StorageIndex_>::setZero()
 {
   if (m_mode==IsDense)
   {
@@ -183,8 +183,8 @@
   }
 }
 
-template<typename _Scalar,typename _StorageIndex>
-_Scalar& AmbiVector<_Scalar,_StorageIndex>::coeffRef(Index i)
+template<typename Scalar_,typename StorageIndex_>
+Scalar_& AmbiVector<Scalar_,StorageIndex_>::coeffRef(Index i)
 {
   if (m_mode==IsDense)
     return m_buffer[i];
@@ -252,8 +252,8 @@
   }
 }
 
-template<typename _Scalar,typename _StorageIndex>
-_Scalar& AmbiVector<_Scalar,_StorageIndex>::coeff(Index i)
+template<typename Scalar_,typename StorageIndex_>
+Scalar_& AmbiVector<Scalar_,StorageIndex_>::coeff(Index i)
 {
   if (m_mode==IsDense)
     return m_buffer[i];
@@ -280,11 +280,11 @@
 }
 
 /** Iterator over the nonzero coefficients */
-template<typename _Scalar,typename _StorageIndex>
-class AmbiVector<_Scalar,_StorageIndex>::Iterator
+template<typename Scalar_,typename StorageIndex_>
+class AmbiVector<Scalar_,StorageIndex_>::Iterator
 {
   public:
-    typedef _Scalar Scalar;
+    typedef Scalar_ Scalar;
     typedef typename NumTraits<Scalar>::Real RealScalar;
 
     /** Default constructor
diff --git a/Eigen/src/SparseCore/CompressedStorage.h b/Eigen/src/SparseCore/CompressedStorage.h
index acd986f..a5202c1 100644
--- a/Eigen/src/SparseCore/CompressedStorage.h
+++ b/Eigen/src/SparseCore/CompressedStorage.h
@@ -18,13 +18,13 @@
   * Stores a sparse set of values as a list of values and a list of indices.
   *
   */
-template<typename _Scalar,typename _StorageIndex>
+template<typename Scalar_,typename StorageIndex_>
 class CompressedStorage
 {
   public:
 
-    typedef _Scalar Scalar;
-    typedef _StorageIndex StorageIndex;
+    typedef Scalar_ Scalar;
+    typedef StorageIndex_ StorageIndex;
 
   protected:
 
diff --git a/Eigen/src/SparseCore/MappedSparseMatrix.h b/Eigen/src/SparseCore/MappedSparseMatrix.h
index 67718c8..e980277 100644
--- a/Eigen/src/SparseCore/MappedSparseMatrix.h
+++ b/Eigen/src/SparseCore/MappedSparseMatrix.h
@@ -17,22 +17,22 @@
   *
   * \brief Sparse matrix
   *
-  * \param _Scalar the scalar type, i.e. the type of the coefficients
+  * \param Scalar_ the scalar type, i.e. the type of the coefficients
   *
   * See http://www.netlib.org/linalg/html_templates/node91.html for details on the storage scheme.
   *
   */
 namespace internal {
-template<typename _Scalar, int _Flags, typename _StorageIndex>
-struct traits<MappedSparseMatrix<_Scalar, _Flags, _StorageIndex> > : traits<SparseMatrix<_Scalar, _Flags, _StorageIndex> >
+template<typename Scalar_, int _Flags, typename StorageIndex_>
+struct traits<MappedSparseMatrix<Scalar_, _Flags, StorageIndex_> > : traits<SparseMatrix<Scalar_, _Flags, StorageIndex_> >
 {};
 } // end namespace internal
 
-template<typename _Scalar, int _Flags, typename _StorageIndex>
+template<typename Scalar_, int _Flags, typename StorageIndex_>
 class MappedSparseMatrix
-  : public Map<SparseMatrix<_Scalar, _Flags, _StorageIndex> >
+  : public Map<SparseMatrix<Scalar_, _Flags, StorageIndex_> >
 {
-    typedef Map<SparseMatrix<_Scalar, _Flags, _StorageIndex> > Base;
+    typedef Map<SparseMatrix<Scalar_, _Flags, StorageIndex_> > Base;
 
   public:
     
@@ -49,11 +49,11 @@
 
 namespace internal {
 
-template<typename _Scalar, int _Options, typename _StorageIndex>
-struct evaluator<MappedSparseMatrix<_Scalar,_Options,_StorageIndex> >
-  : evaluator<SparseCompressedBase<MappedSparseMatrix<_Scalar,_Options,_StorageIndex> > >
+template<typename Scalar_, int Options_, typename StorageIndex_>
+struct evaluator<MappedSparseMatrix<Scalar_,Options_,StorageIndex_> >
+  : evaluator<SparseCompressedBase<MappedSparseMatrix<Scalar_,Options_,StorageIndex_> > >
 {
-  typedef MappedSparseMatrix<_Scalar,_Options,_StorageIndex> XprType;
+  typedef MappedSparseMatrix<Scalar_,Options_,StorageIndex_> XprType;
   typedef evaluator<SparseCompressedBase<XprType> > Base;
   
   evaluator() : Base() {}
diff --git a/Eigen/src/SparseCore/SparseBlock.h b/Eigen/src/SparseCore/SparseBlock.h
index 5b4f6cc..c7bbb9e 100644
--- a/Eigen/src/SparseCore/SparseBlock.h
+++ b/Eigen/src/SparseCore/SparseBlock.h
@@ -283,13 +283,13 @@
 
 } // namespace internal
 
-template<typename _Scalar, int _Options, typename _StorageIndex, int BlockRows, int BlockCols>
-class BlockImpl<SparseMatrix<_Scalar, _Options, _StorageIndex>,BlockRows,BlockCols,true,Sparse>
-  : public internal::sparse_matrix_block_impl<SparseMatrix<_Scalar, _Options, _StorageIndex>,BlockRows,BlockCols>
+template<typename Scalar_, int Options_, typename StorageIndex_, int BlockRows, int BlockCols>
+class BlockImpl<SparseMatrix<Scalar_, Options_, StorageIndex_>,BlockRows,BlockCols,true,Sparse>
+  : public internal::sparse_matrix_block_impl<SparseMatrix<Scalar_, Options_, StorageIndex_>,BlockRows,BlockCols>
 {
 public:
-  typedef _StorageIndex StorageIndex;
-  typedef SparseMatrix<_Scalar, _Options, _StorageIndex> SparseMatrixType;
+  typedef StorageIndex_ StorageIndex;
+  typedef SparseMatrix<Scalar_, Options_, StorageIndex_> SparseMatrixType;
   typedef internal::sparse_matrix_block_impl<SparseMatrixType,BlockRows,BlockCols> Base;
   inline BlockImpl(SparseMatrixType& xpr, Index i)
     : Base(xpr, i)
@@ -302,13 +302,13 @@
   using Base::operator=;
 };
 
-template<typename _Scalar, int _Options, typename _StorageIndex, int BlockRows, int BlockCols>
-class BlockImpl<const SparseMatrix<_Scalar, _Options, _StorageIndex>,BlockRows,BlockCols,true,Sparse>
-  : public internal::sparse_matrix_block_impl<const SparseMatrix<_Scalar, _Options, _StorageIndex>,BlockRows,BlockCols>
+template<typename Scalar_, int Options_, typename StorageIndex_, int BlockRows, int BlockCols>
+class BlockImpl<const SparseMatrix<Scalar_, Options_, StorageIndex_>,BlockRows,BlockCols,true,Sparse>
+  : public internal::sparse_matrix_block_impl<const SparseMatrix<Scalar_, Options_, StorageIndex_>,BlockRows,BlockCols>
 {
 public:
-  typedef _StorageIndex StorageIndex;
-  typedef const SparseMatrix<_Scalar, _Options, _StorageIndex> SparseMatrixType;
+  typedef StorageIndex_ StorageIndex;
+  typedef const SparseMatrix<Scalar_, Options_, StorageIndex_> SparseMatrixType;
   typedef internal::sparse_matrix_block_impl<SparseMatrixType,BlockRows,BlockCols> Base;
   inline BlockImpl(SparseMatrixType& xpr, Index i)
     : Base(xpr, i)
@@ -545,20 +545,20 @@
   inline operator bool() const { return m_outerPos < m_end; }
 };
 
-template<typename _Scalar, int _Options, typename _StorageIndex, int BlockRows, int BlockCols>
-struct unary_evaluator<Block<SparseMatrix<_Scalar, _Options, _StorageIndex>,BlockRows,BlockCols,true>, IteratorBased>
-  : evaluator<SparseCompressedBase<Block<SparseMatrix<_Scalar, _Options, _StorageIndex>,BlockRows,BlockCols,true> > >
+template<typename Scalar_, int Options_, typename StorageIndex_, int BlockRows, int BlockCols>
+struct unary_evaluator<Block<SparseMatrix<Scalar_, Options_, StorageIndex_>,BlockRows,BlockCols,true>, IteratorBased>
+  : evaluator<SparseCompressedBase<Block<SparseMatrix<Scalar_, Options_, StorageIndex_>,BlockRows,BlockCols,true> > >
 {
-  typedef Block<SparseMatrix<_Scalar, _Options, _StorageIndex>,BlockRows,BlockCols,true> XprType;
+  typedef Block<SparseMatrix<Scalar_, Options_, StorageIndex_>,BlockRows,BlockCols,true> XprType;
   typedef evaluator<SparseCompressedBase<XprType> > Base;
   explicit unary_evaluator(const XprType &xpr) : Base(xpr) {}
 };
 
-template<typename _Scalar, int _Options, typename _StorageIndex, int BlockRows, int BlockCols>
-struct unary_evaluator<Block<const SparseMatrix<_Scalar, _Options, _StorageIndex>,BlockRows,BlockCols,true>, IteratorBased>
-  : evaluator<SparseCompressedBase<Block<const SparseMatrix<_Scalar, _Options, _StorageIndex>,BlockRows,BlockCols,true> > >
+template<typename Scalar_, int Options_, typename StorageIndex_, int BlockRows, int BlockCols>
+struct unary_evaluator<Block<const SparseMatrix<Scalar_, Options_, StorageIndex_>,BlockRows,BlockCols,true>, IteratorBased>
+  : evaluator<SparseCompressedBase<Block<const SparseMatrix<Scalar_, Options_, StorageIndex_>,BlockRows,BlockCols,true> > >
 {
-  typedef Block<const SparseMatrix<_Scalar, _Options, _StorageIndex>,BlockRows,BlockCols,true> XprType;
+  typedef Block<const SparseMatrix<Scalar_, Options_, StorageIndex_>,BlockRows,BlockCols,true> XprType;
   typedef evaluator<SparseCompressedBase<XprType> > Base;
   explicit unary_evaluator(const XprType &xpr) : Base(xpr) {}
 };
diff --git a/Eigen/src/SparseCore/SparseDenseProduct.h b/Eigen/src/SparseCore/SparseDenseProduct.h
index f005a18..722e928 100644
--- a/Eigen/src/SparseCore/SparseDenseProduct.h
+++ b/Eigen/src/SparseCore/SparseDenseProduct.h
@@ -73,8 +73,8 @@
 
 // FIXME: what is the purpose of the following specialization? Is it for the BlockedSparse format?
 // -> let's disable it for now as it is conflicting with generic scalar*matrix and matrix*scalar operators
-// template<typename T1, typename T2/*, int _Options, typename _StrideType*/>
-// struct ScalarBinaryOpTraits<T1, Ref<T2/*, _Options, _StrideType*/> >
+// template<typename T1, typename T2/*, int Options_, typename _StrideType*/>
+// struct ScalarBinaryOpTraits<T1, Ref<T2/*, Options_, _StrideType*/> >
 // {
 //   enum {
 //     Defined = 1
diff --git a/Eigen/src/SparseCore/SparseMatrix.h b/Eigen/src/SparseCore/SparseMatrix.h
index 1db906d..75589e2 100644
--- a/Eigen/src/SparseCore/SparseMatrix.h
+++ b/Eigen/src/SparseCore/SparseMatrix.h
@@ -29,10 +29,10 @@
   *
   * More details on this storage sceheme are given in the \ref TutorialSparse "manual pages".
   *
-  * \tparam _Scalar the scalar type, i.e. the type of the coefficients
-  * \tparam _Options Union of bit flags controlling the storage scheme. Currently the only possibility
+  * \tparam Scalar_ the scalar type, i.e. the type of the coefficients
+  * \tparam Options_ Union of bit flags controlling the storage scheme. Currently the only possibility
   *                 is ColMajor or RowMajor. The default is 0 which means column-major.
-  * \tparam _StorageIndex the type of the indices. It has to be a \b signed type (e.g., short, int, std::ptrdiff_t). Default is \c int.
+  * \tparam StorageIndex_ the type of the indices. It has to be a \b signed type (e.g., short, int, std::ptrdiff_t). Default is \c int.
   *
   * \warning In %Eigen 3.2, the undocumented type \c SparseMatrix::Index was improperly defined as the storage index type (e.g., int),
   *          whereas it is now (starting from %Eigen 3.3) deprecated and always defined as Eigen::Index.
@@ -43,11 +43,11 @@
   */
 
 namespace internal {
-template<typename _Scalar, int _Options, typename _StorageIndex>
-struct traits<SparseMatrix<_Scalar, _Options, _StorageIndex> >
+template<typename Scalar_, int Options_, typename StorageIndex_>
+struct traits<SparseMatrix<Scalar_, Options_, StorageIndex_> >
 {
-  typedef _Scalar Scalar;
-  typedef _StorageIndex StorageIndex;
+  typedef Scalar_ Scalar;
+  typedef StorageIndex_ StorageIndex;
   typedef Sparse StorageKind;
   typedef MatrixXpr XprKind;
   enum {
@@ -55,21 +55,21 @@
     ColsAtCompileTime = Dynamic,
     MaxRowsAtCompileTime = Dynamic,
     MaxColsAtCompileTime = Dynamic,
-    Flags = _Options | NestByRefBit | LvalueBit | CompressedAccessBit,
+    Flags = Options_ | NestByRefBit | LvalueBit | CompressedAccessBit,
     SupportedAccessPatterns = InnerRandomAccessPattern
   };
 };
 
-template<typename _Scalar, int _Options, typename _StorageIndex, int DiagIndex>
-struct traits<Diagonal<SparseMatrix<_Scalar, _Options, _StorageIndex>, DiagIndex> >
+template<typename Scalar_, int Options_, typename StorageIndex_, int DiagIndex>
+struct traits<Diagonal<SparseMatrix<Scalar_, Options_, StorageIndex_>, DiagIndex> >
 {
-  typedef SparseMatrix<_Scalar, _Options, _StorageIndex> MatrixType;
+  typedef SparseMatrix<Scalar_, Options_, StorageIndex_> MatrixType;
   typedef typename ref_selector<MatrixType>::type MatrixTypeNested;
   typedef typename remove_reference<MatrixTypeNested>::type _MatrixTypeNested;
 
-  typedef _Scalar Scalar;
+  typedef Scalar_ Scalar;
   typedef Dense StorageKind;
-  typedef _StorageIndex StorageIndex;
+  typedef StorageIndex_ StorageIndex;
   typedef MatrixXpr XprKind;
 
   enum {
@@ -81,9 +81,9 @@
   };
 };
 
-template<typename _Scalar, int _Options, typename _StorageIndex, int DiagIndex>
-struct traits<Diagonal<const SparseMatrix<_Scalar, _Options, _StorageIndex>, DiagIndex> >
- : public traits<Diagonal<SparseMatrix<_Scalar, _Options, _StorageIndex>, DiagIndex> >
+template<typename Scalar_, int Options_, typename StorageIndex_, int DiagIndex>
+struct traits<Diagonal<const SparseMatrix<Scalar_, Options_, StorageIndex_>, DiagIndex> >
+ : public traits<Diagonal<SparseMatrix<Scalar_, Options_, StorageIndex_>, DiagIndex> >
 {
   enum {
     Flags = 0
@@ -92,13 +92,13 @@
 
 } // end namespace internal
 
-template<typename _Scalar, int _Options, typename _StorageIndex>
+template<typename Scalar_, int Options_, typename StorageIndex_>
 class SparseMatrix
-  : public SparseCompressedBase<SparseMatrix<_Scalar, _Options, _StorageIndex> >
+  : public SparseCompressedBase<SparseMatrix<Scalar_, Options_, StorageIndex_> >
 {
     typedef SparseCompressedBase<SparseMatrix> Base;
     using Base::convert_index;
-    friend class SparseVector<_Scalar,0,_StorageIndex>;
+    friend class SparseVector<Scalar_,0,StorageIndex_>;
     template<typename, typename, typename, typename, typename>
     friend struct internal::Assignment;
   public:
@@ -118,7 +118,7 @@
     using Base::IsRowMajor;
     typedef internal::CompressedStorage<Scalar,StorageIndex> Storage;
     enum {
-      Options = _Options
+      Options = Options_
     };
 
     typedef typename Base::IndexVector IndexVector;
@@ -1104,11 +1104,11 @@
   * an abstract iterator over a complex data-structure that would be expensive to evaluate. The triplets should rather
   * be explicitly stored into a std::vector for instance.
   */
-template<typename Scalar, int _Options, typename _StorageIndex>
+template<typename Scalar, int Options_, typename StorageIndex_>
 template<typename InputIterators>
-void SparseMatrix<Scalar,_Options,_StorageIndex>::setFromTriplets(const InputIterators& begin, const InputIterators& end)
+void SparseMatrix<Scalar,Options_,StorageIndex_>::setFromTriplets(const InputIterators& begin, const InputIterators& end)
 {
-  internal::set_from_triplets<InputIterators, SparseMatrix<Scalar,_Options,_StorageIndex> >(begin, end, *this, internal::scalar_sum_op<Scalar,Scalar>());
+  internal::set_from_triplets<InputIterators, SparseMatrix<Scalar,Options_,StorageIndex_> >(begin, end, *this, internal::scalar_sum_op<Scalar,Scalar>());
 }
 
 /** The same as setFromTriplets but when duplicates are met the functor \a dup_func is applied:
@@ -1120,17 +1120,17 @@
   * mat.setFromTriplets(triplets.begin(), triplets.end(), [] (const Scalar&,const Scalar &b) { return b; });
   * \endcode
   */
-template<typename Scalar, int _Options, typename _StorageIndex>
+template<typename Scalar, int Options_, typename StorageIndex_>
 template<typename InputIterators,typename DupFunctor>
-void SparseMatrix<Scalar,_Options,_StorageIndex>::setFromTriplets(const InputIterators& begin, const InputIterators& end, DupFunctor dup_func)
+void SparseMatrix<Scalar,Options_,StorageIndex_>::setFromTriplets(const InputIterators& begin, const InputIterators& end, DupFunctor dup_func)
 {
-  internal::set_from_triplets<InputIterators, SparseMatrix<Scalar,_Options,_StorageIndex>, DupFunctor>(begin, end, *this, dup_func);
+  internal::set_from_triplets<InputIterators, SparseMatrix<Scalar,Options_,StorageIndex_>, DupFunctor>(begin, end, *this, dup_func);
 }
 
 /** \internal */
-template<typename Scalar, int _Options, typename _StorageIndex>
+template<typename Scalar, int Options_, typename StorageIndex_>
 template<typename DupFunctor>
-void SparseMatrix<Scalar,_Options,_StorageIndex>::collapseDuplicates(DupFunctor dup_func)
+void SparseMatrix<Scalar,Options_,StorageIndex_>::collapseDuplicates(DupFunctor dup_func)
 {
   eigen_assert(!isCompressed());
   // TODO, in practice we should be able to use m_innerNonZeros for that task
@@ -1168,9 +1168,9 @@
   m_data.resize(m_outerIndex[m_outerSize]);
 }
 
-template<typename Scalar, int _Options, typename _StorageIndex>
+template<typename Scalar, int Options_, typename StorageIndex_>
 template<typename OtherDerived>
-EIGEN_DONT_INLINE SparseMatrix<Scalar,_Options,_StorageIndex>& SparseMatrix<Scalar,_Options,_StorageIndex>::operator=(const SparseMatrixBase<OtherDerived>& other)
+EIGEN_DONT_INLINE SparseMatrix<Scalar,Options_,StorageIndex_>& SparseMatrix<Scalar,Options_,StorageIndex_>::operator=(const SparseMatrixBase<OtherDerived>& other)
 {
   EIGEN_STATIC_ASSERT((internal::is_same<Scalar, typename OtherDerived::Scalar>::value),
         YOU_MIXED_DIFFERENT_NUMERIC_TYPES__YOU_NEED_TO_USE_THE_CAST_METHOD_OF_MATRIXBASE_TO_CAST_NUMERIC_TYPES_EXPLICITLY)
@@ -1241,8 +1241,8 @@
   }
 }
 
-template<typename _Scalar, int _Options, typename _StorageIndex>
-typename SparseMatrix<_Scalar,_Options,_StorageIndex>::Scalar& SparseMatrix<_Scalar,_Options,_StorageIndex>::insert(Index row, Index col)
+template<typename Scalar_, int Options_, typename StorageIndex_>
+typename SparseMatrix<Scalar_,Options_,StorageIndex_>::Scalar& SparseMatrix<Scalar_,Options_,StorageIndex_>::insert(Index row, Index col)
 {
   eigen_assert(row>=0 && row<rows() && col>=0 && col<cols());
   
@@ -1361,8 +1361,8 @@
   return insertUncompressed(row,col);
 }
     
-template<typename _Scalar, int _Options, typename _StorageIndex>
-EIGEN_DONT_INLINE typename SparseMatrix<_Scalar,_Options,_StorageIndex>::Scalar& SparseMatrix<_Scalar,_Options,_StorageIndex>::insertUncompressed(Index row, Index col)
+template<typename Scalar_, int Options_, typename StorageIndex_>
+EIGEN_DONT_INLINE typename SparseMatrix<Scalar_,Options_,StorageIndex_>::Scalar& SparseMatrix<Scalar_,Options_,StorageIndex_>::insertUncompressed(Index row, Index col)
 {
   eigen_assert(!isCompressed());
 
@@ -1393,8 +1393,8 @@
   return (m_data.value(p) = Scalar(0));
 }
 
-template<typename _Scalar, int _Options, typename _StorageIndex>
-EIGEN_DONT_INLINE typename SparseMatrix<_Scalar,_Options,_StorageIndex>::Scalar& SparseMatrix<_Scalar,_Options,_StorageIndex>::insertCompressed(Index row, Index col)
+template<typename Scalar_, int Options_, typename StorageIndex_>
+EIGEN_DONT_INLINE typename SparseMatrix<Scalar_,Options_,StorageIndex_>::Scalar& SparseMatrix<Scalar_,Options_,StorageIndex_>::insertCompressed(Index row, Index col)
 {
   eigen_assert(isCompressed());
 
@@ -1502,12 +1502,12 @@
 
 namespace internal {
 
-template<typename _Scalar, int _Options, typename _StorageIndex>
-struct evaluator<SparseMatrix<_Scalar,_Options,_StorageIndex> >
-  : evaluator<SparseCompressedBase<SparseMatrix<_Scalar,_Options,_StorageIndex> > >
+template<typename Scalar_, int Options_, typename StorageIndex_>
+struct evaluator<SparseMatrix<Scalar_,Options_,StorageIndex_> >
+  : evaluator<SparseCompressedBase<SparseMatrix<Scalar_,Options_,StorageIndex_> > >
 {
-  typedef evaluator<SparseCompressedBase<SparseMatrix<_Scalar,_Options,_StorageIndex> > > Base;
-  typedef SparseMatrix<_Scalar,_Options,_StorageIndex> SparseMatrixType;
+  typedef evaluator<SparseCompressedBase<SparseMatrix<Scalar_,Options_,StorageIndex_> > > Base;
+  typedef SparseMatrix<Scalar_,Options_,StorageIndex_> SparseMatrixType;
   evaluator() : Base() {}
   explicit evaluator(const SparseMatrixType &mat) : Base(mat) {}
 };
diff --git a/Eigen/src/SparseCore/SparseProduct.h b/Eigen/src/SparseCore/SparseProduct.h
index af8a774..78654d1 100644
--- a/Eigen/src/SparseCore/SparseProduct.h
+++ b/Eigen/src/SparseCore/SparseProduct.h
@@ -165,9 +165,9 @@
 } // end namespace internal
 
 // sparse matrix = sparse-product (can be sparse*sparse, sparse*perm, etc.)
-template<typename Scalar, int _Options, typename _StorageIndex>
+template<typename Scalar, int Options_, typename StorageIndex_>
 template<typename Lhs, typename Rhs>
-SparseMatrix<Scalar,_Options,_StorageIndex>& SparseMatrix<Scalar,_Options,_StorageIndex>::operator=(const Product<Lhs,Rhs,AliasFreeProduct>& src)
+SparseMatrix<Scalar,Options_,StorageIndex_>& SparseMatrix<Scalar,Options_,StorageIndex_>::operator=(const Product<Lhs,Rhs,AliasFreeProduct>& src)
 {
   // std::cout << "in Assignment : " << DstOptions << "\n";
   SparseMatrix dst(src.rows(),src.cols());
diff --git a/Eigen/src/SparseCore/SparseRedux.h b/Eigen/src/SparseCore/SparseRedux.h
index 4587749..0748d3b 100644
--- a/Eigen/src/SparseCore/SparseRedux.h
+++ b/Eigen/src/SparseCore/SparseRedux.h
@@ -25,9 +25,9 @@
   return res;
 }
 
-template<typename _Scalar, int _Options, typename _Index>
-typename internal::traits<SparseMatrix<_Scalar,_Options,_Index> >::Scalar
-SparseMatrix<_Scalar,_Options,_Index>::sum() const
+template<typename Scalar_, int Options_, typename Index_>
+typename internal::traits<SparseMatrix<Scalar_,Options_,Index_> >::Scalar
+SparseMatrix<Scalar_,Options_,Index_>::sum() const
 {
   eigen_assert(rows()>0 && cols()>0 && "you are using a non initialized matrix");
   if(this->isCompressed())
@@ -36,9 +36,9 @@
     return Base::sum();
 }
 
-template<typename _Scalar, int _Options, typename _Index>
-typename internal::traits<SparseVector<_Scalar,_Options, _Index> >::Scalar
-SparseVector<_Scalar,_Options,_Index>::sum() const
+template<typename Scalar_, int Options_, typename Index_>
+typename internal::traits<SparseVector<Scalar_,Options_, Index_> >::Scalar
+SparseVector<Scalar_,Options_,Index_>::sum() const
 {
   eigen_assert(rows()>0 && cols()>0 && "you are using a non initialized matrix");
   return Matrix<Scalar,1,Dynamic>::Map(m_data.valuePtr(), m_data.size()).sum();
diff --git a/Eigen/src/SparseCore/SparseRef.h b/Eigen/src/SparseCore/SparseRef.h
index 748f87d..f6e18aa 100644
--- a/Eigen/src/SparseCore/SparseRef.h
+++ b/Eigen/src/SparseCore/SparseRef.h
@@ -20,13 +20,13 @@
 
 template<typename Derived> class SparseRefBase;
 
-template<typename MatScalar, int MatOptions, typename MatIndex, int _Options, typename _StrideType>
-struct traits<Ref<SparseMatrix<MatScalar,MatOptions,MatIndex>, _Options, _StrideType> >
+template<typename MatScalar, int MatOptions, typename MatIndex, int Options_, typename _StrideType>
+struct traits<Ref<SparseMatrix<MatScalar,MatOptions,MatIndex>, Options_, _StrideType> >
   : public traits<SparseMatrix<MatScalar,MatOptions,MatIndex> >
 {
   typedef SparseMatrix<MatScalar,MatOptions,MatIndex> PlainObjectType;
   enum {
-    Options = _Options,
+    Options = Options_,
     Flags = traits<PlainObjectType>::Flags | CompressedAccessBit | NestByRefBit
   };
 
@@ -40,22 +40,22 @@
   
 };
 
-template<typename MatScalar, int MatOptions, typename MatIndex, int _Options, typename _StrideType>
-struct traits<Ref<const SparseMatrix<MatScalar,MatOptions,MatIndex>, _Options, _StrideType> >
-  : public traits<Ref<SparseMatrix<MatScalar,MatOptions,MatIndex>, _Options, _StrideType> >
+template<typename MatScalar, int MatOptions, typename MatIndex, int Options_, typename _StrideType>
+struct traits<Ref<const SparseMatrix<MatScalar,MatOptions,MatIndex>, Options_, _StrideType> >
+  : public traits<Ref<SparseMatrix<MatScalar,MatOptions,MatIndex>, Options_, _StrideType> >
 {
   enum {
     Flags = (traits<SparseMatrix<MatScalar,MatOptions,MatIndex> >::Flags | CompressedAccessBit | NestByRefBit) & ~LvalueBit
   };
 };
 
-template<typename MatScalar, int MatOptions, typename MatIndex, int _Options, typename _StrideType>
-struct traits<Ref<SparseVector<MatScalar,MatOptions,MatIndex>, _Options, _StrideType> >
+template<typename MatScalar, int MatOptions, typename MatIndex, int Options_, typename _StrideType>
+struct traits<Ref<SparseVector<MatScalar,MatOptions,MatIndex>, Options_, _StrideType> >
   : public traits<SparseVector<MatScalar,MatOptions,MatIndex> >
 {
   typedef SparseVector<MatScalar,MatOptions,MatIndex> PlainObjectType;
   enum {
-    Options = _Options,
+    Options = Options_,
     Flags = traits<PlainObjectType>::Flags | CompressedAccessBit | NestByRefBit
   };
 
@@ -68,9 +68,9 @@
 
 };
 
-template<typename MatScalar, int MatOptions, typename MatIndex, int _Options, typename _StrideType>
-struct traits<Ref<const SparseVector<MatScalar,MatOptions,MatIndex>, _Options, _StrideType> >
-  : public traits<Ref<SparseVector<MatScalar,MatOptions,MatIndex>, _Options, _StrideType> >
+template<typename MatScalar, int MatOptions, typename MatIndex, int Options_, typename _StrideType>
+struct traits<Ref<const SparseVector<MatScalar,MatOptions,MatIndex>, Options_, _StrideType> >
+  : public traits<Ref<SparseVector<MatScalar,MatOptions,MatIndex>, Options_, _StrideType> >
 {
   enum {
     Flags = (traits<SparseVector<MatScalar,MatOptions,MatIndex> >::Flags | CompressedAccessBit | NestByRefBit) & ~LvalueBit
diff --git a/Eigen/src/SparseCore/SparseSelfAdjointView.h b/Eigen/src/SparseCore/SparseSelfAdjointView.h
index 85b00e1..efad570 100644
--- a/Eigen/src/SparseCore/SparseSelfAdjointView.h
+++ b/Eigen/src/SparseCore/SparseSelfAdjointView.h
@@ -40,13 +40,13 @@
 
 }
 
-template<typename MatrixType, unsigned int _Mode> class SparseSelfAdjointView
-  : public EigenBase<SparseSelfAdjointView<MatrixType,_Mode> >
+template<typename MatrixType, unsigned int Mode_> class SparseSelfAdjointView
+  : public EigenBase<SparseSelfAdjointView<MatrixType,Mode_> >
 {
   public:
     
     enum {
-      Mode = _Mode,
+      Mode = Mode_,
       TransposeMode = ((Mode & Upper) ? Lower : 0) | ((Mode & Lower) ? Upper : 0),
       RowsAtCompileTime = internal::traits<SparseSelfAdjointView>::RowsAtCompileTime,
       ColsAtCompileTime = internal::traits<SparseSelfAdjointView>::ColsAtCompileTime
@@ -260,15 +260,6 @@
     run(tmp, src, AssignOpType());
     dst -= tmp;
   }
-  
-  template<typename DestScalar>
-  static void run(DynamicSparseMatrix<DestScalar,ColMajor,StorageIndex>& dst, const SrcXprType &src, const AssignOpType&/*func*/)
-  {
-    // TODO directly evaluate into dst;
-    SparseMatrix<DestScalar,ColMajor,StorageIndex> tmp(dst.rows(),dst.cols());
-    internal::permute_symm_to_fullsymm<SrcXprType::Mode>(src.matrix(), tmp);
-    dst = tmp;
-  }
 };
 
 } // end namespace internal
@@ -516,7 +507,7 @@
   }
 }
 
-template<int _SrcMode,int _DstMode,typename MatrixType,int DstOrder>
+template<int SrcMode_,int DstMode_,typename MatrixType,int DstOrder>
 void permute_symm_to_symm(const MatrixType& mat, SparseMatrix<typename MatrixType::Scalar,DstOrder,typename MatrixType::StorageIndex>& _dest, const typename MatrixType::StorageIndex* perm)
 {
   typedef typename MatrixType::StorageIndex StorageIndex;
@@ -529,8 +520,8 @@
   enum {
     SrcOrder = MatrixType::IsRowMajor ? RowMajor : ColMajor,
     StorageOrderMatch = int(SrcOrder) == int(DstOrder),
-    DstMode = DstOrder==RowMajor ? (_DstMode==Upper ? Lower : Upper) : _DstMode,
-    SrcMode = SrcOrder==RowMajor ? (_SrcMode==Upper ? Lower : Upper) : _SrcMode
+    DstMode = DstOrder==RowMajor ? (DstMode_==Upper ? Lower : Upper) : DstMode_,
+    SrcMode = SrcOrder==RowMajor ? (SrcMode_==Upper ? Lower : Upper) : SrcMode_
   };
 
   MatEval matEval(mat);
diff --git a/Eigen/src/SparseCore/SparseUtil.h b/Eigen/src/SparseCore/SparseUtil.h
index ceb9368..9ead5ae 100644
--- a/Eigen/src/SparseCore/SparseUtil.h
+++ b/Eigen/src/SparseCore/SparseUtil.h
@@ -49,10 +49,9 @@
 const int OuterRandomAccessPattern  = 0x4 | CoherentAccessPattern;
 const int RandomAccessPattern       = 0x8 | OuterRandomAccessPattern | InnerRandomAccessPattern;
 
-template<typename _Scalar, int _Flags = 0, typename _StorageIndex = int>  class SparseMatrix;
-template<typename _Scalar, int _Flags = 0, typename _StorageIndex = int>  class DynamicSparseMatrix;
-template<typename _Scalar, int _Flags = 0, typename _StorageIndex = int>  class SparseVector;
-template<typename _Scalar, int _Flags = 0, typename _StorageIndex = int>  class MappedSparseMatrix;
+template<typename Scalar_, int _Flags = 0, typename StorageIndex_ = int>  class SparseMatrix;
+template<typename Scalar_, int _Flags = 0, typename StorageIndex_ = int>  class SparseVector;
+template<typename Scalar_, int _Flags = 0, typename StorageIndex_ = int>  class MappedSparseMatrix;
 
 template<typename MatrixType, unsigned int UpLo>  class SparseSelfAdjointView;
 template<typename Lhs, typename Rhs>              class SparseDiagonalProduct;
@@ -80,41 +79,41 @@
 {};
 
 template<typename T,int Cols,int Flags> struct sparse_eval<T,1,Cols,Flags> {
-    typedef typename traits<T>::Scalar _Scalar;
-    typedef typename traits<T>::StorageIndex _StorageIndex;
+    typedef typename traits<T>::Scalar Scalar_;
+    typedef typename traits<T>::StorageIndex StorageIndex_;
   public:
-    typedef SparseVector<_Scalar, RowMajor, _StorageIndex> type;
+    typedef SparseVector<Scalar_, RowMajor, StorageIndex_> type;
 };
 
 template<typename T,int Rows,int Flags> struct sparse_eval<T,Rows,1,Flags> {
-    typedef typename traits<T>::Scalar _Scalar;
-    typedef typename traits<T>::StorageIndex _StorageIndex;
+    typedef typename traits<T>::Scalar Scalar_;
+    typedef typename traits<T>::StorageIndex StorageIndex_;
   public:
-    typedef SparseVector<_Scalar, ColMajor, _StorageIndex> type;
+    typedef SparseVector<Scalar_, ColMajor, StorageIndex_> type;
 };
 
 // TODO this seems almost identical to plain_matrix_type<T, Sparse>
 template<typename T,int Rows,int Cols,int Flags> struct sparse_eval {
-    typedef typename traits<T>::Scalar _Scalar;
-    typedef typename traits<T>::StorageIndex _StorageIndex;
-    enum { _Options = ((Flags&RowMajorBit)==RowMajorBit) ? RowMajor : ColMajor };
+    typedef typename traits<T>::Scalar Scalar_;
+    typedef typename traits<T>::StorageIndex StorageIndex_;
+    enum { Options_ = ((Flags&RowMajorBit)==RowMajorBit) ? RowMajor : ColMajor };
   public:
-    typedef SparseMatrix<_Scalar, _Options, _StorageIndex> type;
+    typedef SparseMatrix<Scalar_, Options_, StorageIndex_> type;
 };
 
 template<typename T,int Flags> struct sparse_eval<T,1,1,Flags> {
-    typedef typename traits<T>::Scalar _Scalar;
+    typedef typename traits<T>::Scalar Scalar_;
   public:
-    typedef Matrix<_Scalar, 1, 1> type;
+    typedef Matrix<Scalar_, 1, 1> type;
 };
 
 template<typename T> struct plain_matrix_type<T,Sparse>
 {
-  typedef typename traits<T>::Scalar _Scalar;
-  typedef typename traits<T>::StorageIndex _StorageIndex;
-  enum { _Options = ((evaluator<T>::Flags&RowMajorBit)==RowMajorBit) ? RowMajor : ColMajor };
+  typedef typename traits<T>::Scalar Scalar_;
+  typedef typename traits<T>::StorageIndex StorageIndex_;
+  enum { Options_ = ((evaluator<T>::Flags&RowMajorBit)==RowMajorBit) ? RowMajor : ColMajor };
   public:
-    typedef SparseMatrix<_Scalar, _Options, _StorageIndex> type;
+    typedef SparseMatrix<Scalar_, Options_, StorageIndex_> type;
 };
 
 template<typename T>
diff --git a/Eigen/src/SparseCore/SparseVector.h b/Eigen/src/SparseCore/SparseVector.h
index 05779be..c9d0127 100644
--- a/Eigen/src/SparseCore/SparseVector.h
+++ b/Eigen/src/SparseCore/SparseVector.h
@@ -17,7 +17,7 @@
   *
   * \brief a sparse vector class
   *
-  * \tparam _Scalar the scalar type, i.e. the type of the coefficients
+  * \tparam Scalar_ the scalar type, i.e. the type of the coefficients
   *
   * See http://www.netlib.org/linalg/html_templates/node91.html for details on the storage scheme.
   *
@@ -26,21 +26,21 @@
   */
 
 namespace internal {
-template<typename _Scalar, int _Options, typename _StorageIndex>
-struct traits<SparseVector<_Scalar, _Options, _StorageIndex> >
+template<typename Scalar_, int Options_, typename StorageIndex_>
+struct traits<SparseVector<Scalar_, Options_, StorageIndex_> >
 {
-  typedef _Scalar Scalar;
-  typedef _StorageIndex StorageIndex;
+  typedef Scalar_ Scalar;
+  typedef StorageIndex_ StorageIndex;
   typedef Sparse StorageKind;
   typedef MatrixXpr XprKind;
   enum {
-    IsColVector = (_Options & RowMajorBit) ? 0 : 1,
+    IsColVector = (Options_ & RowMajorBit) ? 0 : 1,
 
     RowsAtCompileTime = IsColVector ? Dynamic : 1,
     ColsAtCompileTime = IsColVector ? 1 : Dynamic,
     MaxRowsAtCompileTime = RowsAtCompileTime,
     MaxColsAtCompileTime = ColsAtCompileTime,
-    Flags = _Options | NestByRefBit | LvalueBit | (IsColVector ? 0 : RowMajorBit) | CompressedAccessBit,
+    Flags = Options_ | NestByRefBit | LvalueBit | (IsColVector ? 0 : RowMajorBit) | CompressedAccessBit,
     SupportedAccessPatterns = InnerRandomAccessPattern
   };
 };
@@ -60,9 +60,9 @@
 
 }
 
-template<typename _Scalar, int _Options, typename _StorageIndex>
+template<typename Scalar_, int Options_, typename StorageIndex_>
 class SparseVector
-  : public SparseCompressedBase<SparseVector<_Scalar, _Options, _StorageIndex> >
+  : public SparseCompressedBase<SparseVector<Scalar_, Options_, StorageIndex_> >
 {
     typedef SparseCompressedBase<SparseVector> Base;
     using Base::convert_index;
@@ -75,7 +75,7 @@
     enum { IsColVector = internal::traits<SparseVector>::IsColVector };
     
     enum {
-      Options = _Options
+      Options = Options_
     };
     
     EIGEN_STRONG_INLINE Index rows() const { return IsColVector ? m_size : 1; }
@@ -397,7 +397,7 @@
     static void check_template_parameters()
     {
       EIGEN_STATIC_ASSERT(NumTraits<StorageIndex>::IsSigned,THE_INDEX_TYPE_MUST_BE_A_SIGNED_TYPE);
-      EIGEN_STATIC_ASSERT((_Options&(ColMajor|RowMajor))==Options,INVALID_MATRIX_TEMPLATE_PARAMETERS);
+      EIGEN_STATIC_ASSERT((Options_&(ColMajor|RowMajor))==Options,INVALID_MATRIX_TEMPLATE_PARAMETERS);
     }
     
     Storage m_data;
@@ -406,17 +406,17 @@
 
 namespace internal {
 
-template<typename _Scalar, int _Options, typename _Index>
-struct evaluator<SparseVector<_Scalar,_Options,_Index> >
-  : evaluator_base<SparseVector<_Scalar,_Options,_Index> >
+template<typename Scalar_, int Options_, typename Index_>
+struct evaluator<SparseVector<Scalar_,Options_,Index_> >
+  : evaluator_base<SparseVector<Scalar_,Options_,Index_> >
 {
-  typedef SparseVector<_Scalar,_Options,_Index> SparseVectorType;
+  typedef SparseVector<Scalar_,Options_,Index_> SparseVectorType;
   typedef evaluator_base<SparseVectorType> Base;
   typedef typename SparseVectorType::InnerIterator InnerIterator;
   typedef typename SparseVectorType::ReverseInnerIterator ReverseInnerIterator;
   
   enum {
-    CoeffReadCost = NumTraits<_Scalar>::ReadCost,
+    CoeffReadCost = NumTraits<Scalar_>::ReadCost,
     Flags = SparseVectorType::Flags
   };
 
diff --git a/Eigen/src/SparseLU/SparseLU.h b/Eigen/src/SparseLU/SparseLU.h
index 0c8d893..9814565 100644
--- a/Eigen/src/SparseLU/SparseLU.h
+++ b/Eigen/src/SparseLU/SparseLU.h
@@ -14,7 +14,7 @@
 
 namespace Eigen {
 
-template <typename _MatrixType, typename _OrderingType = COLAMDOrdering<typename _MatrixType::StorageIndex> > class SparseLU;
+template <typename MatrixType_, typename OrderingType_ = COLAMDOrdering<typename MatrixType_::StorageIndex> > class SparseLU;
 template <typename MappedSparseMatrixType> struct SparseLUMatrixLReturnType;
 template <typename MatrixLType, typename MatrixUType> struct SparseLUMatrixUReturnType;
 
@@ -119,25 +119,25 @@
   * If this is the case for your matrices, you can try the basic scaling method at
   *  "unsupported/Eigen/src/IterativeSolvers/Scaling.h"
   * 
-  * \tparam _MatrixType The type of the sparse matrix. It must be a column-major SparseMatrix<>
-  * \tparam _OrderingType The ordering method to use, either AMD, COLAMD or METIS. Default is COLMAD
+  * \tparam MatrixType_ The type of the sparse matrix. It must be a column-major SparseMatrix<>
+  * \tparam OrderingType_ The ordering method to use, either AMD, COLAMD or METIS. Default is COLMAD
   *
   * \implsparsesolverconcept
   * 
   * \sa \ref TutorialSparseSolverConcept
   * \sa \ref OrderingMethods_Module
   */
-template <typename _MatrixType, typename _OrderingType>
-class SparseLU : public SparseSolverBase<SparseLU<_MatrixType,_OrderingType> >, public internal::SparseLUImpl<typename _MatrixType::Scalar, typename _MatrixType::StorageIndex>
+template <typename MatrixType_, typename OrderingType_>
+class SparseLU : public SparseSolverBase<SparseLU<MatrixType_,OrderingType_> >, public internal::SparseLUImpl<typename MatrixType_::Scalar, typename MatrixType_::StorageIndex>
 {
   protected:
-    typedef SparseSolverBase<SparseLU<_MatrixType,_OrderingType> > APIBase;
+    typedef SparseSolverBase<SparseLU<MatrixType_,OrderingType_> > APIBase;
     using APIBase::m_isInitialized;
   public:
     using APIBase::_solve_impl;
     
-    typedef _MatrixType MatrixType; 
-    typedef _OrderingType OrderingType;
+    typedef MatrixType_ MatrixType;
+    typedef OrderingType_ OrderingType;
     typedef typename MatrixType::Scalar Scalar; 
     typedef typename MatrixType::RealScalar RealScalar; 
     typedef typename MatrixType::StorageIndex StorageIndex;
@@ -197,9 +197,9 @@
       *
       * \sa adjoint(), solve()
       */
-    const SparseLUTransposeView<false,SparseLU<_MatrixType,_OrderingType> > transpose()
+    const SparseLUTransposeView<false,SparseLU<MatrixType_,OrderingType_> > transpose()
     {
-      SparseLUTransposeView<false,  SparseLU<_MatrixType,_OrderingType> > transposeView;
+      SparseLUTransposeView<false,  SparseLU<MatrixType_,OrderingType_> > transposeView;
       transposeView.setSparseLU(this);
       transposeView.setIsInitialized(this->m_isInitialized);
       return transposeView;
@@ -218,9 +218,9 @@
       *
       * \sa transpose(), solve()
       */
-    const SparseLUTransposeView<true, SparseLU<_MatrixType,_OrderingType> > adjoint()
+    const SparseLUTransposeView<true, SparseLU<MatrixType_,OrderingType_> > adjoint()
     {
-      SparseLUTransposeView<true,  SparseLU<_MatrixType,_OrderingType> > adjointView;
+      SparseLUTransposeView<true,  SparseLU<MatrixType_,OrderingType_> > adjointView;
       adjointView.setSparseLU(this);
       adjointView.setIsInitialized(this->m_isInitialized);
       return adjointView;
diff --git a/Eigen/src/SparseLU/SparseLU_SupernodalMatrix.h b/Eigen/src/SparseLU/SparseLU_SupernodalMatrix.h
index 0be293d..7eda565 100644
--- a/Eigen/src/SparseLU/SparseLU_SupernodalMatrix.h
+++ b/Eigen/src/SparseLU/SparseLU_SupernodalMatrix.h
@@ -29,12 +29,12 @@
  * SuperInnerIterator to iterate through all supernodes 
  * Function for triangular solve
  */
-template <typename _Scalar, typename _StorageIndex>
+template <typename Scalar_, typename StorageIndex_>
 class MappedSuperNodalMatrix
 {
   public:
-    typedef _Scalar Scalar; 
-    typedef _StorageIndex StorageIndex;
+    typedef Scalar_ Scalar;
+    typedef StorageIndex_ StorageIndex;
     typedef Matrix<StorageIndex,Dynamic,1> IndexVector;
     typedef Matrix<Scalar,Dynamic,1> ScalarVector;
   public:
diff --git a/Eigen/src/SparseQR/SparseQR.h b/Eigen/src/SparseQR/SparseQR.h
index d1fb96f..a19eacc 100644
--- a/Eigen/src/SparseQR/SparseQR.h
+++ b/Eigen/src/SparseQR/SparseQR.h
@@ -59,8 +59,8 @@
   * R is the sparse triangular or trapezoidal matrix. The later occurs when A is rank-deficient.
   * matrixR().topLeftCorner(rank(), rank()) always returns a triangular factor of full rank.
   * 
-  * \tparam _MatrixType The type of the sparse matrix A, must be a column-major SparseMatrix<>
-  * \tparam _OrderingType The fill-reducing ordering method. See the \link OrderingMethods_Module 
+  * \tparam MatrixType_ The type of the sparse matrix A, must be a column-major SparseMatrix<>
+  * \tparam OrderingType_ The fill-reducing ordering method. See the \link OrderingMethods_Module
   *  OrderingMethods \endlink module for the list of built-in and external ordering methods.
   * 
   * \implsparsesolverconcept
@@ -80,16 +80,16 @@
   * \warning For complex matrices matrixQ().transpose() will actually return the adjoint matrix.
   * 
   */
-template<typename _MatrixType, typename _OrderingType>
-class SparseQR : public SparseSolverBase<SparseQR<_MatrixType,_OrderingType> >
+template<typename MatrixType_, typename OrderingType_>
+class SparseQR : public SparseSolverBase<SparseQR<MatrixType_,OrderingType_> >
 {
   protected:
-    typedef SparseSolverBase<SparseQR<_MatrixType,_OrderingType> > Base;
+    typedef SparseSolverBase<SparseQR<MatrixType_,OrderingType_> > Base;
     using Base::m_isInitialized;
   public:
     using Base::_solve_impl;
-    typedef _MatrixType MatrixType;
-    typedef _OrderingType OrderingType;
+    typedef MatrixType_ MatrixType;
+    typedef OrderingType_ OrderingType;
     typedef typename MatrixType::Scalar Scalar;
     typedef typename MatrixType::RealScalar RealScalar;
     typedef typename MatrixType::StorageIndex StorageIndex;
diff --git a/Eigen/src/SuperLUSupport/SuperLUSupport.h b/Eigen/src/SuperLUSupport/SuperLUSupport.h
index d1d3ad7..825988d 100644
--- a/Eigen/src/SuperLUSupport/SuperLUSupport.h
+++ b/Eigen/src/SuperLUSupport/SuperLUSupport.h
@@ -313,7 +313,7 @@
   * \class SuperLUBase
   * \brief The base class for the direct and incomplete LU factorization of SuperLU
   */
-template<typename _MatrixType, typename Derived>
+template<typename MatrixType_, typename Derived>
 class SuperLUBase : public SparseSolverBase<Derived>
 {
   protected:
@@ -321,7 +321,7 @@
     using Base::derived;
     using Base::m_isInitialized;
   public:
-    typedef _MatrixType MatrixType;
+    typedef MatrixType_ MatrixType;
     typedef typename MatrixType::Scalar Scalar;
     typedef typename MatrixType::RealScalar RealScalar;
     typedef typename MatrixType::StorageIndex StorageIndex;
@@ -476,7 +476,7 @@
   * using the SuperLU library. The sparse matrix A must be squared and invertible. The vectors or matrices
   * X and B can be either dense or sparse.
   *
-  * \tparam _MatrixType the type of the sparse matrix A, it must be a SparseMatrix<>
+  * \tparam MatrixType_ the type of the sparse matrix A, it must be a SparseMatrix<>
   *
   * \warning This class is only for the 4.x versions of SuperLU. The 3.x and 5.x versions are not supported.
   *
@@ -484,12 +484,12 @@
   *
   * \sa \ref TutorialSparseSolverConcept, class SparseLU
   */
-template<typename _MatrixType>
-class SuperLU : public SuperLUBase<_MatrixType,SuperLU<_MatrixType> >
+template<typename MatrixType_>
+class SuperLU : public SuperLUBase<MatrixType_,SuperLU<MatrixType_> >
 {
   public:
-    typedef SuperLUBase<_MatrixType,SuperLU> Base;
-    typedef _MatrixType MatrixType;
+    typedef SuperLUBase<MatrixType_,SuperLU> Base;
+    typedef MatrixType_ MatrixType;
     typedef typename Base::Scalar Scalar;
     typedef typename Base::RealScalar RealScalar;
     typedef typename Base::StorageIndex StorageIndex;
@@ -830,19 +830,19 @@
   *
   * \warning This class is only for the 4.x versions of SuperLU. The 3.x and 5.x versions are not supported.
   *
-  * \tparam _MatrixType the type of the sparse matrix A, it must be a SparseMatrix<>
+  * \tparam MatrixType_ the type of the sparse matrix A, it must be a SparseMatrix<>
   *
   * \implsparsesolverconcept
   *
   * \sa \ref TutorialSparseSolverConcept, class IncompleteLUT, class ConjugateGradient, class BiCGSTAB
   */
 
-template<typename _MatrixType>
-class SuperILU : public SuperLUBase<_MatrixType,SuperILU<_MatrixType> >
+template<typename MatrixType_>
+class SuperILU : public SuperLUBase<MatrixType_,SuperILU<MatrixType_> >
 {
   public:
-    typedef SuperLUBase<_MatrixType,SuperILU> Base;
-    typedef _MatrixType MatrixType;
+    typedef SuperLUBase<MatrixType_,SuperILU> Base;
+    typedef MatrixType_ MatrixType;
     typedef typename Base::Scalar Scalar;
     typedef typename Base::RealScalar RealScalar;
 
diff --git a/Eigen/src/UmfPackSupport/UmfPackSupport.h b/Eigen/src/UmfPackSupport/UmfPackSupport.h
index e3a333f..07d1f8b 100644
--- a/Eigen/src/UmfPackSupport/UmfPackSupport.h
+++ b/Eigen/src/UmfPackSupport/UmfPackSupport.h
@@ -278,21 +278,21 @@
   *
   * \warning The input matrix A should be in a \b compressed and \b column-major form.
   * Otherwise an expensive copy will be made. You can call the inexpensive makeCompressed() to get a compressed matrix.
-  * \tparam _MatrixType the type of the sparse matrix A, it must be a SparseMatrix<>
+  * \tparam MatrixType_ the type of the sparse matrix A, it must be a SparseMatrix<>
   *
   * \implsparsesolverconcept
   *
   * \sa \ref TutorialSparseSolverConcept, class SparseLU
   */
-template<typename _MatrixType>
-class UmfPackLU : public SparseSolverBase<UmfPackLU<_MatrixType> >
+template<typename MatrixType_>
+class UmfPackLU : public SparseSolverBase<UmfPackLU<MatrixType_> >
 {
   protected:
-    typedef SparseSolverBase<UmfPackLU<_MatrixType> > Base;
+    typedef SparseSolverBase<UmfPackLU<MatrixType_> > Base;
     using Base::m_isInitialized;
   public:
     using Base::_solve_impl;
-    typedef _MatrixType MatrixType;
+    typedef MatrixType_ MatrixType;
     typedef typename MatrixType::Scalar Scalar;
     typedef typename MatrixType::RealScalar RealScalar;
     typedef typename MatrixType::StorageIndex StorageIndex;
diff --git a/Eigen/src/misc/Image.h b/Eigen/src/misc/Image.h
index b8b8a04..e99f2d5 100644
--- a/Eigen/src/misc/Image.h
+++ b/Eigen/src/misc/Image.h
@@ -32,10 +32,10 @@
   > ReturnType;
 };
 
-template<typename _DecompositionType> struct image_retval_base
- : public ReturnByValue<image_retval_base<_DecompositionType> >
+template<typename DecompositionType_> struct image_retval_base
+ : public ReturnByValue<image_retval_base<DecompositionType_> >
 {
-  typedef _DecompositionType DecompositionType;
+  typedef DecompositionType_ DecompositionType;
   typedef typename DecompositionType::MatrixType MatrixType;
   typedef ReturnByValue<image_retval_base> Base;
 
diff --git a/Eigen/src/misc/Kernel.h b/Eigen/src/misc/Kernel.h
index bef5d6f..377a8ce 100644
--- a/Eigen/src/misc/Kernel.h
+++ b/Eigen/src/misc/Kernel.h
@@ -34,10 +34,10 @@
   > ReturnType;
 };
 
-template<typename _DecompositionType> struct kernel_retval_base
- : public ReturnByValue<kernel_retval_base<_DecompositionType> >
+template<typename DecompositionType_> struct kernel_retval_base
+ : public ReturnByValue<kernel_retval_base<DecompositionType_> >
 {
-  typedef _DecompositionType DecompositionType;
+  typedef DecompositionType_ DecompositionType;
   typedef ReturnByValue<kernel_retval_base> Base;
 
   explicit kernel_retval_base(const DecompositionType& dec)
diff --git a/Eigen/src/plugins/ArrayCwiseUnaryOps.h b/Eigen/src/plugins/ArrayCwiseUnaryOps.h
index b7ea22a..13c55f4 100644
--- a/Eigen/src/plugins/ArrayCwiseUnaryOps.h
+++ b/Eigen/src/plugins/ArrayCwiseUnaryOps.h
@@ -497,6 +497,45 @@
   return CeilReturnType(derived());
 }
 
+template<int N> struct ShiftRightXpr {
+  typedef CwiseUnaryOp<internal::scalar_shift_right_op<Scalar, N>, const Derived> Type;
+};
+
+/** \returns an expression of \c *this with the \a Scalar type arithmetically
+  * shifted right by \a N bit positions.
+  *
+  * The template parameter \a N specifies the number of bit positions to shift.
+  * 
+  * \sa shiftLeft()
+  */
+template<int N>
+EIGEN_DEVICE_FUNC
+typename ShiftRightXpr<N>::Type
+shiftRight() const
+{
+  return typename ShiftRightXpr<N>::Type(derived());
+}
+
+
+template<int N> struct ShiftLeftXpr {
+  typedef CwiseUnaryOp<internal::scalar_shift_left_op<Scalar, N>, const Derived> Type;
+};
+
+/** \returns an expression of \c *this with the \a Scalar type logically
+  * shifted left by \a N bit positions.
+  *
+  * The template parameter \a N specifies the number of bit positions to shift.
+  *
+  * \sa shiftRight()
+  */
+template<int N>
+EIGEN_DEVICE_FUNC
+typename ShiftLeftXpr<N>::Type
+shiftLeft() const
+{
+  return typename ShiftLeftXpr<N>::Type(derived());
+}
+
 /** \returns an expression of the coefficient-wise isnan of *this.
   *
   * Example: \include Cwise_isNaN.cpp
diff --git a/Eigen/src/plugins/CommonCwiseUnaryOps.h b/Eigen/src/plugins/CommonCwiseUnaryOps.h
index 42ff901..5418dc4 100644
--- a/Eigen/src/plugins/CommonCwiseUnaryOps.h
+++ b/Eigen/src/plugins/CommonCwiseUnaryOps.h
@@ -64,49 +64,6 @@
   return typename CastXpr<NewType>::Type(derived());
 }
 
-template<int N> struct ShiftRightXpr {
-  typedef CwiseUnaryOp<internal::scalar_shift_right_op<Scalar, N>, const Derived> Type;
-};
-
-/// \returns an expression of \c *this with the \a Scalar type arithmetically
-/// shifted right by \a N bit positions.
-///
-/// The template parameter \a N specifies the number of bit positions to shift.
-///
-EIGEN_DOC_UNARY_ADDONS(cast,conversion function)
-///
-/// \sa class CwiseUnaryOp
-///
-template<int N>
-EIGEN_DEVICE_FUNC
-typename ShiftRightXpr<N>::Type
-shift_right() const
-{
-  return typename ShiftRightXpr<N>::Type(derived());
-}
-
-
-template<int N> struct ShiftLeftXpr {
-  typedef CwiseUnaryOp<internal::scalar_shift_left_op<Scalar, N>, const Derived> Type;
-};
-
-/// \returns an expression of \c *this with the \a Scalar type logically
-/// shifted left by \a N bit positions.
-///
-/// The template parameter \a N specifies the number of bit positions to shift.
-///
-EIGEN_DOC_UNARY_ADDONS(cast,conversion function)
-///
-/// \sa class CwiseUnaryOp
-///
-template<int N>
-EIGEN_DEVICE_FUNC
-typename ShiftLeftXpr<N>::Type
-shift_left() const
-{
-  return typename ShiftLeftXpr<N>::Type(derived());
-}
-
 /// \returns an expression of the complex conjugate of \c *this.
 ///
 EIGEN_DOC_UNARY_ADDONS(conjugate,complex conjugate)
diff --git a/blas/CMakeLists.txt b/blas/CMakeLists.txt
index 545bc98..f3a94ec 100644
--- a/blas/CMakeLists.txt
+++ b/blas/CMakeLists.txt
@@ -26,20 +26,27 @@
   set(EigenBlas_SRCS ${EigenBlas_SRCS} f2c/complexdots.c)
 endif()
 
-add_library(eigen_blas_static ${EigenBlas_SRCS})
-add_library(eigen_blas SHARED ${EigenBlas_SRCS})
+set(EIGEN_BLAS_TARGETS "")
 
-if(EIGEN_STANDARD_LIBRARIES_TO_LINK_TO)
-  target_link_libraries(eigen_blas_static ${EIGEN_STANDARD_LIBRARIES_TO_LINK_TO})
-  target_link_libraries(eigen_blas        ${EIGEN_STANDARD_LIBRARIES_TO_LINK_TO})
+add_library(eigen_blas_static ${EigenBlas_SRCS})
+list(APPEND EIGEN_BLAS_TARGETS eigen_blas_static)
+
+if (EIGEN_BUILD_SHARED_LIBS)
+  add_library(eigen_blas SHARED ${EigenBlas_SRCS})
+  list(APPEND EIGEN_BLAS_TARGETS eigen_blas)
 endif()
 
-add_dependencies(blas eigen_blas eigen_blas_static)
+foreach(target IN LISTS EIGEN_BLAS_TARGETS)
+  if(EIGEN_STANDARD_LIBRARIES_TO_LINK_TO)
+      target_link_libraries(${target} ${EIGEN_STANDARD_LIBRARIES_TO_LINK_TO})
+  endif()
 
-install(TARGETS eigen_blas eigen_blas_static
-        RUNTIME DESTINATION bin
-        LIBRARY DESTINATION lib
-        ARCHIVE DESTINATION lib)
+  add_dependencies(blas ${target})
+  install(TARGETS ${target}
+          RUNTIME DESTINATION bin
+          LIBRARY DESTINATION lib
+          ARCHIVE DESTINATION lib)
+endforeach()
 
 if(EIGEN_Fortran_COMPILER_WORKS)
 
diff --git a/cmake/Eigen3Config.cmake.in b/cmake/Eigen3Config.cmake.in
index 0a1ac61..96582f5 100644
--- a/cmake/Eigen3Config.cmake.in
+++ b/cmake/Eigen3Config.cmake.in
@@ -3,21 +3,6 @@
 
 @PACKAGE_INIT@
 
-if (NOT TARGET eigen)
+if (NOT TARGET Eigen3::Eigen)
   include ("${CMAKE_CURRENT_LIST_DIR}/Eigen3Targets.cmake")
-endif ()
-
-# Legacy variables, do *not* use. May be removed in the future.
-
-set (EIGEN3_FOUND 1)
-set (EIGEN3_USE_FILE    "${CMAKE_CURRENT_LIST_DIR}/UseEigen3.cmake")
-
-set (EIGEN3_DEFINITIONS  "@EIGEN_DEFINITIONS@")
-set (EIGEN3_INCLUDE_DIR  "@PACKAGE_EIGEN_INCLUDE_DIR@")
-set (EIGEN3_INCLUDE_DIRS "@PACKAGE_EIGEN_INCLUDE_DIR@")
-set (EIGEN3_ROOT_DIR     "@PACKAGE_EIGEN_ROOT_DIR@")
-
-set (EIGEN3_VERSION_STRING "@EIGEN_VERSION_STRING@")
-set (EIGEN3_VERSION_MAJOR  "@EIGEN_VERSION_MAJOR@")
-set (EIGEN3_VERSION_MINOR  "@EIGEN_VERSION_MINOR@")
-set (EIGEN3_VERSION_PATCH  "@EIGEN_VERSION_PATCH@")
+endif (NOT TARGET Eigen3::Eigen)
diff --git a/cmake/Eigen3ConfigLegacy.cmake.in b/cmake/Eigen3ConfigLegacy.cmake.in
deleted file mode 100644
index 62d7224..0000000
--- a/cmake/Eigen3ConfigLegacy.cmake.in
+++ /dev/null
@@ -1,30 +0,0 @@
-#                                               -*- cmake -*-
-#
-#  Eigen3Config.cmake(.in)
-
-# Use the following variables to compile and link against Eigen:
-#  EIGEN3_FOUND              - True if Eigen was found on your system
-#  EIGEN3_USE_FILE           - The file making Eigen usable
-#  EIGEN3_DEFINITIONS        - Definitions needed to build with Eigen
-#  EIGEN3_INCLUDE_DIR        - Directory where signature_of_eigen3_matrix_library can be found
-#  EIGEN3_INCLUDE_DIRS       - List of directories of Eigen and it's dependencies
-#  EIGEN3_ROOT_DIR           - The base directory of Eigen
-#  EIGEN3_VERSION_STRING     - A human-readable string containing the version
-#  EIGEN3_VERSION_MAJOR      - The major version of Eigen
-#  EIGEN3_VERSION_MINOR      - The minor version of Eigen
-#  EIGEN3_VERSION_PATCH      - The patch version of Eigen
-
-@PACKAGE_INIT@
-
-set ( EIGEN3_FOUND 1 )
-set ( EIGEN3_USE_FILE     "${CMAKE_CURRENT_LIST_DIR}/UseEigen3.cmake" )
-
-set ( EIGEN3_DEFINITIONS  "@EIGEN_DEFINITIONS@" )
-set ( EIGEN3_INCLUDE_DIR  "@PACKAGE_EIGEN_INCLUDE_DIR@" )
-set ( EIGEN3_INCLUDE_DIRS "@PACKAGE_EIGEN_INCLUDE_DIR@" )
-set ( EIGEN3_ROOT_DIR     "@PACKAGE_EIGEN_ROOT_DIR@" )
-
-set ( EIGEN3_VERSION_STRING "@EIGEN_VERSION_STRING@" )
-set ( EIGEN3_VERSION_MAJOR  "@EIGEN_VERSION_MAJOR@" )
-set ( EIGEN3_VERSION_MINOR  "@EIGEN_VERSION_MINOR@" )
-set ( EIGEN3_VERSION_PATCH  "@EIGEN_VERSION_PATCH@" )
diff --git a/cmake/FindEigen2.cmake b/cmake/FindEigen2.cmake
deleted file mode 100644
index eb2709d..0000000
--- a/cmake/FindEigen2.cmake
+++ /dev/null
@@ -1,80 +0,0 @@
-# - Try to find Eigen2 lib
-#
-# This module supports requiring a minimum version, e.g. you can do
-#   find_package(Eigen2 2.0.3)
-# to require version 2.0.3 to newer of Eigen2.
-#
-# Once done this will define
-#
-#  EIGEN2_FOUND - system has eigen lib with correct version
-#  EIGEN2_INCLUDE_DIR - the eigen include directory
-#  EIGEN2_VERSION - eigen version
-
-# Copyright (c) 2006, 2007 Montel Laurent, <montel@kde.org>
-# Copyright (c) 2008, 2009 Gael Guennebaud, <g.gael@free.fr>
-# Redistribution and use is allowed according to the terms of the BSD license.
-
-if(NOT Eigen2_FIND_VERSION)
-  if(NOT Eigen2_FIND_VERSION_MAJOR)
-    set(Eigen2_FIND_VERSION_MAJOR 2)
-  endif()
-  if(NOT Eigen2_FIND_VERSION_MINOR)
-    set(Eigen2_FIND_VERSION_MINOR 0)
-  endif()
-  if(NOT Eigen2_FIND_VERSION_PATCH)
-    set(Eigen2_FIND_VERSION_PATCH 0)
-  endif()
-
-  set(Eigen2_FIND_VERSION "${Eigen2_FIND_VERSION_MAJOR}.${Eigen2_FIND_VERSION_MINOR}.${Eigen2_FIND_VERSION_PATCH}")
-endif()
-
-macro(_eigen2_check_version)
-  file(READ "${EIGEN2_INCLUDE_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(EIGEN2_VERSION ${EIGEN2_WORLD_VERSION}.${EIGEN2_MAJOR_VERSION}.${EIGEN2_MINOR_VERSION})
-  if((${EIGEN2_WORLD_VERSION} NOTEQUAL 2) OR (${EIGEN2_MAJOR_VERSION} GREATER 10) OR (${EIGEN2_VERSION} VERSION_LESS ${Eigen2_FIND_VERSION}))
-    set(EIGEN2_VERSION_OK FALSE)
-  else()
-    set(EIGEN2_VERSION_OK TRUE)
-  endif()
-
-  if(NOT EIGEN2_VERSION_OK)
-
-    message(STATUS "Eigen2 version ${EIGEN2_VERSION} found in ${EIGEN2_INCLUDE_DIR}, "
-                   "but at least version ${Eigen2_FIND_VERSION} is required")
-  endif()
-endmacro()
-
-if (EIGEN2_INCLUDE_DIR)
-
-  # in cache already
-  _eigen2_check_version()
-  set(EIGEN2_FOUND ${EIGEN2_VERSION_OK})
-
-else ()
-
-find_path(EIGEN2_INCLUDE_DIR NAMES Eigen/Core
-     PATHS
-     ${INCLUDE_INSTALL_DIR}
-     ${KDE4_INCLUDE_DIR}
-     PATH_SUFFIXES eigen2
-   )
-
-if(EIGEN2_INCLUDE_DIR)
-  _eigen2_check_version()
-endif()
-
-include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(Eigen2 DEFAULT_MSG EIGEN2_INCLUDE_DIR EIGEN2_VERSION_OK)
-
-mark_as_advanced(EIGEN2_INCLUDE_DIR)
-
-endif()
-
diff --git a/cmake/FindEigen3.cmake b/cmake/FindEigen3.cmake
deleted file mode 100644
index 0b36805..0000000
--- a/cmake/FindEigen3.cmake
+++ /dev/null
@@ -1,107 +0,0 @@
-# - Try to find Eigen3 lib
-#
-# This module supports requiring a minimum version, e.g. you can do
-#   find_package(Eigen3 3.1.2)
-# to require version 3.1.2 or newer of Eigen3.
-#
-# Once done this will define
-#
-#  EIGEN3_FOUND - system has eigen lib with correct version
-#  EIGEN3_INCLUDE_DIR - the eigen include directory
-#  EIGEN3_VERSION - eigen version
-#
-# and the following imported target:
-#
-#  Eigen3::Eigen - The header-only Eigen library
-#
-# This module reads hints about search locations from 
-# the following environment variables:
-#
-# EIGEN3_ROOT
-# EIGEN3_ROOT_DIR
-
-# Copyright (c) 2006, 2007 Montel Laurent, <montel@kde.org>
-# Copyright (c) 2008, 2009 Gael Guennebaud, <g.gael@free.fr>
-# Copyright (c) 2009 Benoit Jacob <jacob.benoit.1@gmail.com>
-# Redistribution and use is allowed according to the terms of the 2-clause BSD license.
-
-if(NOT Eigen3_FIND_VERSION)
-  if(NOT Eigen3_FIND_VERSION_MAJOR)
-    set(Eigen3_FIND_VERSION_MAJOR 2)
-  endif()
-  if(NOT Eigen3_FIND_VERSION_MINOR)
-    set(Eigen3_FIND_VERSION_MINOR 91)
-  endif()
-  if(NOT Eigen3_FIND_VERSION_PATCH)
-    set(Eigen3_FIND_VERSION_PATCH 0)
-  endif()
-
-  set(Eigen3_FIND_VERSION "${Eigen3_FIND_VERSION_MAJOR}.${Eigen3_FIND_VERSION_MINOR}.${Eigen3_FIND_VERSION_PATCH}")
-endif()
-
-macro(_eigen3_check_version)
-  file(READ "${EIGEN3_INCLUDE_DIR}/Eigen/src/Core/util/Macros.h" _eigen3_version_header)
-
-  string(REGEX MATCH "define[ \t]+EIGEN_WORLD_VERSION[ \t]+([0-9]+)" _eigen3_world_version_match "${_eigen3_version_header}")
-  set(EIGEN3_WORLD_VERSION "${CMAKE_MATCH_1}")
-  string(REGEX MATCH "define[ \t]+EIGEN_MAJOR_VERSION[ \t]+([0-9]+)" _eigen3_major_version_match "${_eigen3_version_header}")
-  set(EIGEN3_MAJOR_VERSION "${CMAKE_MATCH_1}")
-  string(REGEX MATCH "define[ \t]+EIGEN_MINOR_VERSION[ \t]+([0-9]+)" _eigen3_minor_version_match "${_eigen3_version_header}")
-  set(EIGEN3_MINOR_VERSION "${CMAKE_MATCH_1}")
-
-  set(EIGEN3_VERSION ${EIGEN3_WORLD_VERSION}.${EIGEN3_MAJOR_VERSION}.${EIGEN3_MINOR_VERSION})
-  if(${EIGEN3_VERSION} VERSION_LESS ${Eigen3_FIND_VERSION})
-    set(EIGEN3_VERSION_OK FALSE)
-  else()
-    set(EIGEN3_VERSION_OK TRUE)
-  endif()
-
-  if(NOT EIGEN3_VERSION_OK)
-
-    message(STATUS "Eigen3 version ${EIGEN3_VERSION} found in ${EIGEN3_INCLUDE_DIR}, "
-                   "but at least version ${Eigen3_FIND_VERSION} is required")
-  endif()
-endmacro()
-
-if (EIGEN3_INCLUDE_DIR)
-
-  # in cache already
-  _eigen3_check_version()
-  set(EIGEN3_FOUND ${EIGEN3_VERSION_OK})
-  set(Eigen3_FOUND ${EIGEN3_VERSION_OK})
-
-else ()
-  
-  # search first if an Eigen3Config.cmake is available in the system,
-  # if successful this would set EIGEN3_INCLUDE_DIR and the rest of
-  # the script will work as usual
-  find_package(Eigen3 ${Eigen3_FIND_VERSION} NO_MODULE QUIET)
-
-  if(NOT EIGEN3_INCLUDE_DIR)
-    find_path(EIGEN3_INCLUDE_DIR NAMES signature_of_eigen3_matrix_library
-        HINTS
-        ENV EIGEN3_ROOT 
-        ENV EIGEN3_ROOT_DIR
-        PATHS
-        ${CMAKE_INSTALL_PREFIX}/include
-        ${KDE4_INCLUDE_DIR}
-        PATH_SUFFIXES eigen3 eigen
-      )
-  endif()
-
-  if(EIGEN3_INCLUDE_DIR)
-    _eigen3_check_version()
-  endif()
-
-  include(FindPackageHandleStandardArgs)
-  find_package_handle_standard_args(Eigen3 DEFAULT_MSG EIGEN3_INCLUDE_DIR EIGEN3_VERSION_OK)
-
-  mark_as_advanced(EIGEN3_INCLUDE_DIR)
-
-endif()
-
-if(EIGEN3_FOUND AND NOT TARGET Eigen3::Eigen)
-  add_library(Eigen3::Eigen INTERFACE IMPORTED)
-  set_target_properties(Eigen3::Eigen PROPERTIES
-    INTERFACE_INCLUDE_DIRECTORIES "${EIGEN3_INCLUDE_DIR}")
-endif()
diff --git a/cmake/UseEigen3.cmake b/cmake/UseEigen3.cmake
deleted file mode 100644
index a38bac8..0000000
--- a/cmake/UseEigen3.cmake
+++ /dev/null
@@ -1,6 +0,0 @@
-#                                               -*- cmake -*-
-#
-#  UseEigen3.cmake
-
-add_definitions     ( ${EIGEN3_DEFINITIONS} )
-include_directories ( ${EIGEN3_INCLUDE_DIRS} )
diff --git a/debug/gdb/printers.py b/debug/gdb/printers.py
index 24961d1..2ca3fc5 100644
--- a/debug/gdb/printers.py
+++ b/debug/gdb/printers.py
@@ -22,7 +22,7 @@
 #      import sys
 #      sys.path.insert(0, '/path/to/eigen/printer/directory')
 #      from printers import register_eigen_printers
-#      register_eigen_printers (None)
+#      register_eigen_printers(None)
 #      end
 
 import gdb
@@ -30,21 +30,22 @@
 import itertools
 from bisect import bisect_left
 
+
 # Basic row/column iteration code for use with Sparse and Dense matrices
 class _MatrixEntryIterator(object):
 	
-	def __init__ (self, rows, cols, rowMajor):
+	def __init__(self, rows, cols, row_major):
 		self.rows = rows
 		self.cols = cols
 		self.currentRow = 0
 		self.currentCol = 0
-		self.rowMajor = rowMajor
+		self.rowMajor = row_major
 
-	def __iter__ (self):
+	def __iter__(self):
 		return self
 
 	def next(self):
-                return self.__next__()  # Python 2.x compatibility
+		return self.__next__()  # Python 2.x compatibility
 
 	def __next__(self):
 		row = self.currentRow
@@ -66,41 +67,42 @@
 				self.currentCol = 0
 				self.currentRow = self.currentRow + 1
 
-		return (row, col)
+		return row, col
+
 
 class EigenMatrixPrinter:
-	"Print Eigen Matrix or Array of some kind"
+	"""Print Eigen Matrix or Array of some kind"""
 
 	def __init__(self, variety, val):
-		"Extract all the necessary information"
+		"""Extract all the necessary information"""
 		
 		# Save the variety (presumably "Matrix" or "Array") for later usage
 		self.variety = variety
 		
 		# The gdb extension does not support value template arguments - need to extract them by hand
-		type = val.type
-		if type.code == gdb.TYPE_CODE_REF:
-			type = type.target()
-		self.type = type.unqualified().strip_typedefs()
+		typeinfo = val.type
+		if typeinfo.code == gdb.TYPE_CODE_REF:
+			typeinfo = typeinfo.target()
+		self.type = typeinfo.unqualified().strip_typedefs()
 		tag = self.type.tag
-		regex = re.compile('\<.*\>')
+		regex = re.compile('<.*>')
 		m = regex.findall(tag)[0][1:-1]
 		template_params = m.split(',')
 		template_params = [x.replace(" ", "") for x in template_params]
 		
-		if template_params[1] == '-0x00000000000000001' or template_params[1] == '-0x000000001' or template_params[1] == '-1':
+		if template_params[1] in ['-0x00000000000000001', '-0x000000001', '-1']:
 			self.rows = val['m_storage']['m_rows']
 		else:
 			self.rows = int(template_params[1])
 		
-		if template_params[2] == '-0x00000000000000001' or template_params[2] == '-0x000000001' or template_params[2] == '-1':
+		if template_params[2] in ['-0x00000000000000001', '-0x000000001', '-1']:
 			self.cols = val['m_storage']['m_cols']
 		else:
 			self.cols = int(template_params[2])
 		
-		self.options = 0 # default value
+		self.options = 0  # default value
 		if len(template_params) > 3:
-			self.options = template_params[3];
+			self.options = template_params[3]
 		
 		self.rowMajor = (int(self.options) & 0x1)
 		
@@ -114,50 +116,52 @@
 			self.data = self.data['array']
 			self.data = self.data.cast(self.innerType.pointer())
 			
-	class _iterator(_MatrixEntryIterator):
-		def __init__ (self, rows, cols, dataPtr, rowMajor):
-			super(EigenMatrixPrinter._iterator, self).__init__(rows, cols, rowMajor)
+	class _Iterator(_MatrixEntryIterator):
+		def __init__(self, rows, cols, data_ptr, row_major):
+			super(EigenMatrixPrinter._Iterator, self).__init__(rows, cols, row_major)
 
-			self.dataPtr = dataPtr
+			self.dataPtr = data_ptr
 
 		def __next__(self):
-			
-			row, col = super(EigenMatrixPrinter._iterator, self).__next__()
+			row, col = super(EigenMatrixPrinter._Iterator, self).__next__()
 			
 			item = self.dataPtr.dereference()
 			self.dataPtr = self.dataPtr + 1
-			if (self.cols == 1): #if it's a column vector
-				return ('[%d]' % (row,), item)
-			elif (self.rows == 1): #if it's a row vector
-				return ('[%d]' % (col,), item)
-			return ('[%d,%d]' % (row, col), item)
+			if self.cols == 1:  # if it's a column vector
+				return '[%d]' % (row,), item
+			elif self.rows == 1:  # if it's a row vector
+				return '[%d]' % (col,), item
+			return '[%d,%d]' % (row, col), item
 			
 	def children(self):
 		
-		return self._iterator(self.rows, self.cols, self.data, self.rowMajor)
+		return self._Iterator(self.rows, self.cols, self.data, self.rowMajor)
 		
 	def to_string(self):
-		return "Eigen::%s<%s,%d,%d,%s> (data ptr: %s)" % (self.variety, self.innerType, self.rows, self.cols, "RowMajor" if self.rowMajor else  "ColMajor", self.data)
+		return "Eigen::%s<%s,%d,%d,%s> (data ptr: %s)" % (
+			self.variety, self.innerType, self.rows, self.cols,
+			"RowMajor" if self.rowMajor else "ColMajor", self.data)
+
 
 class EigenSparseMatrixPrinter:
-	"Print an Eigen SparseMatrix"
+	"""Print an Eigen SparseMatrix"""
 
 	def __init__(self, val):
-		"Extract all the necessary information"
+		"""Extract all the necessary information"""
 
-		type = val.type
-		if type.code == gdb.TYPE_CODE_REF:
-			type = type.target()
-		self.type = type.unqualified().strip_typedefs()
+		typeinfo = val.type
+		if typeinfo.code == gdb.TYPE_CODE_REF:
+			typeinfo = typeinfo.target()
+		self.type = typeinfo.unqualified().strip_typedefs()
 		tag = self.type.tag
-		regex = re.compile('\<.*\>')
+		regex = re.compile('<.*>')
 		m = regex.findall(tag)[0][1:-1]
 		template_params = m.split(',')
 		template_params = [x.replace(" ", "") for x in template_params]
 
 		self.options = 0
 		if len(template_params) > 1:
-			self.options = template_params[1];
+			self.options = template_params[1]
 		
 		self.rowMajor = (int(self.options) & 0x1)
 		
@@ -168,22 +172,23 @@
 		self.data = self.val['m_data']
 		self.data = self.data.cast(self.innerType.pointer())
 
-	class _iterator(_MatrixEntryIterator):
-		def __init__ (self, rows, cols, val, rowMajor):
-			super(EigenSparseMatrixPrinter._iterator, self).__init__(rows, cols, rowMajor)
+	class _Iterator(_MatrixEntryIterator):
+		def __init__(self, rows, cols, val, row_major):
+			super(EigenSparseMatrixPrinter._Iterator, self).__init__(rows, cols, row_major)
 
 			self.val = val
 			
 		def __next__(self):
-			
-			row, col = super(EigenSparseMatrixPrinter._iterator, self).__next__()
+			row, col = super(EigenSparseMatrixPrinter._Iterator, self).__next__()
 				
 			# repeat calculations from SparseMatrix.h:
 			outer = row if self.rowMajor else col
 			inner = col if self.rowMajor else row
 			start = self.val['m_outerIndex'][outer]
-			end = ((start + self.val['m_innerNonZeros'][outer]) if self.val['m_innerNonZeros'] else
-			       self.val['m_outerIndex'][outer+1])
+			end = (
+				(start + self.val['m_innerNonZeros'][outer])
+				if self.val['m_innerNonZeros'] else self.val['m_outerIndex'][outer+1]
+			)
 
 			# and from CompressedStorage.h:
 			data = self.val['m_data']
@@ -196,20 +201,19 @@
 				indices = [data['m_indices'][x] for x in range(int(start), int(end)-1)]
 				# find the index with binary search
 				idx = int(start) + bisect_left(indices, inner)
-				if ((idx < end) and (data['m_indices'][idx] == inner)):
+				if idx < end and data['m_indices'][idx] == inner:
 					item = data['m_values'][idx]
 				else:
 					item = 0
 
-			return ('[%d,%d]' % (row, col), item)
+			return '[%d,%d]' % (row, col), item
 
 	def children(self):
 		if self.data:
-			return self._iterator(self.rows(), self.cols(), self.val, self.rowMajor)
+			return self._Iterator(self.rows(), self.cols(), self.val, self.rowMajor)
 
 		return iter([])   # empty matrix, for now
 
-
 	def rows(self):
 		return self.val['m_outerSize'] if self.rowMajor else self.val['m_innerSize']
 
@@ -222,22 +226,23 @@
 			status = ("not compressed" if self.val['m_innerNonZeros'] else "compressed")
 		else:
 			status = "empty"
-		dimensions  = "%d x %d" % (self.rows(), self.cols())
-		layout      = "row" if self.rowMajor else "column"
+		dimensions = "%d x %d" % (self.rows(), self.cols())
+		layout = "row" if self.rowMajor else "column"
 
 		return "Eigen::SparseMatrix<%s>, %s, %s major, %s" % (
-			self.innerType, dimensions, layout, status )
+			self.innerType, dimensions, layout, status)
+
 
 class EigenQuaternionPrinter:
-	"Print an Eigen Quaternion"
+	"""Print an Eigen Quaternion"""
 	
 	def __init__(self, val):
-		"Extract all the necessary information"
+		"""Extract all the necessary information"""
 		# The gdb extension does not support value template arguments - need to extract them by hand
-		type = val.type
-		if type.code == gdb.TYPE_CODE_REF:
-			type = type.target()
-		self.type = type.unqualified().strip_typedefs()
+		typeinfo = val.type
+		if typeinfo.code == gdb.TYPE_CODE_REF:
+			typeinfo = typeinfo.target()
+		self.type = typeinfo.unqualified().strip_typedefs()
 		self.innerType = self.type.template_argument(0)
 		self.val = val
 		
@@ -245,13 +250,13 @@
 		self.data = self.val['m_coeffs']['m_storage']['m_data']['array']
 		self.data = self.data.cast(self.innerType.pointer())
 			
-	class _iterator:
-		def __init__ (self, dataPtr):
-			self.dataPtr = dataPtr
+	class _Iterator:
+		def __init__(self, data_ptr):
+			self.dataPtr = data_ptr
 			self.currentElement = 0
 			self.elementNames = ['x', 'y', 'z', 'w']
 			
-		def __iter__ (self):
+		def __iter__(self):
 			return self
 	
 		def next(self):
@@ -260,47 +265,68 @@
 		def __next__(self):
 			element = self.currentElement
 			
-			if self.currentElement >= 4: #there are 4 elements in a quanternion
+			if self.currentElement >= 4:  # there are 4 elements in a quaternion
 				raise StopIteration
 			
 			self.currentElement = self.currentElement + 1
 			
 			item = self.dataPtr.dereference()
 			self.dataPtr = self.dataPtr + 1
-			return ('[%s]' % (self.elementNames[element],), item)
+			return '[%s]' % (self.elementNames[element],), item
 			
 	def children(self):
 		
-		return self._iterator(self.data)
+		return self._Iterator(self.data)
 	
 	def to_string(self):
 		return "Eigen::Quaternion<%s> (data ptr: %s)" % (self.innerType, self.data)
 
-def build_eigen_dictionary ():
+
+def cast_eigen_block_to_matrix(val):
+	# Get the type of the variable (and convert to a string)
+	# Example: 'const Eigen::Block<Eigen::Block<Eigen::Matrix<double, -1, -1, 0, -1, -1>, -1, -1, false> const, -1, -1, false>'
+	type = str(val.type)
+
+	# Extract the Eigen::Matrix type from the Block:
+	# From the previous example: Eigen::Matrix<double, -1, -1, 0, -1, -1>
+	begin = type.find('Eigen::Matrix<')
+	end = type.find('>', begin) + 1
+
+	# Convert the Eigen::Block to an Eigen::Matrix
+	return val.cast(gdb.lookup_type(type[begin:end]))
+
+
+def build_eigen_dictionary():
 	pretty_printers_dict[re.compile('^Eigen::Quaternion<.*>$')] = lambda val: EigenQuaternionPrinter(val)
 	pretty_printers_dict[re.compile('^Eigen::Matrix<.*>$')] = lambda val: EigenMatrixPrinter("Matrix", val)
+	pretty_printers_dict[re.compile('^Eigen::Block<.*>$')] =\
+		lambda val: EigenMatrixPrinter("Matrix", cast_eigen_block_to_matrix(val))
+	pretty_printers_dict[re.compile('^Eigen::VectorBlock<.*>$')] =\
+		lambda val: EigenMatrixPrinter("Matrix", cast_eigen_block_to_matrix(val))
 	pretty_printers_dict[re.compile('^Eigen::SparseMatrix<.*>$')] = lambda val: EigenSparseMatrixPrinter(val)
-	pretty_printers_dict[re.compile('^Eigen::Array<.*>$')]  = lambda val: EigenMatrixPrinter("Array",  val)
+	pretty_printers_dict[re.compile('^Eigen::Array<.*>$')] = lambda val: EigenMatrixPrinter("Array",  val)
+
 
 def register_eigen_printers(obj):
-	"Register eigen pretty-printers with objfile Obj"
+	"""Register eigen pretty-printers with objfile Obj"""
 
-	if obj == None:
+	if obj is None:
 		obj = gdb
 	obj.pretty_printers.append(lookup_function)
 
+
 def lookup_function(val):
-	"Look-up and return a pretty-printer that can print va."
+	"""Look-up and return a pretty-printer that can print val."""
 	
-	type = val.type
+	typeinfo = val.type
 	
-	if type.code == gdb.TYPE_CODE_REF:
-		type = type.target()
+	if typeinfo.code == gdb.TYPE_CODE_REF:
+		typeinfo = typeinfo.target()
 	
-	type = type.unqualified().strip_typedefs()
+	typeinfo = typeinfo.unqualified().strip_typedefs()
 	
-	typename = type.tag
-	if typename == None:
+	typename = typeinfo.tag
+	if typename is None:
 		return None
 	
 	for function in pretty_printers_dict:
@@ -309,6 +335,7 @@
 	
 	return None
 
+
 pretty_printers_dict = {}
 
-build_eigen_dictionary ()
+build_eigen_dictionary()
diff --git a/demos/opengl/gpuhelper.h b/demos/opengl/gpuhelper.h
index 9ff98e9..880e9a5 100644
--- a/demos/opengl/gpuhelper.h
+++ b/demos/opengl/gpuhelper.h
@@ -34,21 +34,21 @@
         Essentially, this helper function automatically calls glMatrixMode(matrixTarget) if required
         and does a proper call to the right glMultMatrix*() function according to the scalar type
         and storage order.
-        \warning glMatrixMode() must never be called directly. If your're unsure, use forceMatrixMode().
+        \warning glMatrixMode() must never be called directly. If you are unsure, use forceMatrixMode().
         \sa Matrix, loadMatrix(), forceMatrixMode()
     */
-    template<typename Scalar, int _Flags>
-    void multMatrix(const Matrix<Scalar,4,4, _Flags, 4,4>& mat, GLenum matrixTarget);
+    template<typename Scalar, int Flags_>
+    void multMatrix(const Matrix<Scalar,4,4, Flags_, 4,4>& mat, GLenum matrixTarget);
 
     /** Load the matrix \a mat to the OpenGL matrix \a matrixTarget.
         Essentially, this helper function automatically calls glMatrixMode(matrixTarget) if required
         and does a proper call to the right glLoadMatrix*() or glLoadIdentity() function according to the scalar type
         and storage order.
-        \warning glMatrixMode() must never be called directly. If your're unsure, use forceMatrixMode().
+        \warning glMatrixMode() must never be called directly. If you are unsure, use forceMatrixMode().
         \sa Matrix, multMatrix(), forceMatrixMode()
     */
-    template<typename Scalar, int _Flags>
-    void loadMatrix(const Eigen::Matrix<Scalar,4,4, _Flags, 4,4>& mat, GLenum matrixTarget);
+    template<typename Scalar, int Flags_>
+    void loadMatrix(const Eigen::Matrix<Scalar,4,4, Flags_, 4,4>& mat, GLenum matrixTarget);
 
     template<typename Scalar, typename Derived>
     void loadMatrix(
@@ -66,8 +66,8 @@
 
     /** Push the OpenGL matrix \a matrixTarget and load \a mat.
     */
-    template<typename Scalar, int _Flags>
-    inline void pushMatrix(const Matrix<Scalar,4,4, _Flags, 4,4>& mat, GLenum matrixTarget);
+    template<typename Scalar, int Flags_>
+    inline void pushMatrix(const Matrix<Scalar,4,4, Flags_, 4,4>& mat, GLenum matrixTarget);
 
     template<typename Scalar, typename Derived>
     void pushMatrix(
@@ -113,22 +113,22 @@
 
 /** \internal
 */
-template<bool RowMajor, int _Flags> struct GlMatrixHelper;
+template<bool RowMajor, int Flags_> struct GlMatrixHelper;
 
-template<int _Flags> struct GlMatrixHelper<false,_Flags>
+template<int Flags_> struct GlMatrixHelper<false,Flags_>
 {
-    static void loadMatrix(const Matrix<float, 4,4, _Flags, 4,4>&  mat) { glLoadMatrixf(mat.data()); }
-    static void loadMatrix(const Matrix<double,4,4, _Flags, 4,4>& mat) { glLoadMatrixd(mat.data()); }
-    static void multMatrix(const Matrix<float, 4,4, _Flags, 4,4>&  mat) { glMultMatrixf(mat.data()); }
-    static void multMatrix(const Matrix<double,4,4, _Flags, 4,4>& mat) { glMultMatrixd(mat.data()); }
+    static void loadMatrix(const Matrix<float, 4,4, Flags_, 4,4>&  mat) { glLoadMatrixf(mat.data()); }
+    static void loadMatrix(const Matrix<double,4,4, Flags_, 4,4>& mat) { glLoadMatrixd(mat.data()); }
+    static void multMatrix(const Matrix<float, 4,4, Flags_, 4,4>&  mat) { glMultMatrixf(mat.data()); }
+    static void multMatrix(const Matrix<double,4,4, Flags_, 4,4>& mat) { glMultMatrixd(mat.data()); }
 };
 
-template<int _Flags> struct GlMatrixHelper<true,_Flags>
+template<int Flags_> struct GlMatrixHelper<true,Flags_>
 {
-    static void loadMatrix(const Matrix<float, 4,4, _Flags, 4,4>&  mat) { glLoadMatrixf(mat.transpose().eval().data()); }
-    static void loadMatrix(const Matrix<double,4,4, _Flags, 4,4>& mat) { glLoadMatrixd(mat.transpose().eval().data()); }
-    static void multMatrix(const Matrix<float, 4,4, _Flags, 4,4>&  mat) { glMultMatrixf(mat.transpose().eval().data()); }
-    static void multMatrix(const Matrix<double,4,4, _Flags, 4,4>& mat) { glMultMatrixd(mat.transpose().eval().data()); }
+    static void loadMatrix(const Matrix<float, 4,4, Flags_, 4,4>&  mat) { glLoadMatrixf(mat.transpose().eval().data()); }
+    static void loadMatrix(const Matrix<double,4,4, Flags_, 4,4>& mat) { glLoadMatrixd(mat.transpose().eval().data()); }
+    static void multMatrix(const Matrix<float, 4,4, Flags_, 4,4>&  mat) { glMultMatrixf(mat.transpose().eval().data()); }
+    static void multMatrix(const Matrix<double,4,4, Flags_, 4,4>& mat) { glMultMatrixd(mat.transpose().eval().data()); }
 };
 
 inline void GpuHelper::setMatrixTarget(GLenum matrixTarget)
@@ -137,11 +137,11 @@
         glMatrixMode(mCurrentMatrixTarget=matrixTarget);
 }
 
-template<typename Scalar, int _Flags>
-void GpuHelper::multMatrix(const Matrix<Scalar,4,4, _Flags, 4,4>& mat, GLenum matrixTarget)
+template<typename Scalar, int Flags_>
+void GpuHelper::multMatrix(const Matrix<Scalar,4,4, Flags_, 4,4>& mat, GLenum matrixTarget)
 {
     setMatrixTarget(matrixTarget);
-    GlMatrixHelper<_Flags&Eigen::RowMajorBit, _Flags>::multMatrix(mat);
+    GlMatrixHelper<Flags_&Eigen::RowMajorBit, Flags_>::multMatrix(mat);
 }
 
 template<typename Scalar, typename Derived>
@@ -153,11 +153,11 @@
     glLoadIdentity();
 }
 
-template<typename Scalar, int _Flags>
-void GpuHelper::loadMatrix(const Eigen::Matrix<Scalar,4,4, _Flags, 4,4>& mat, GLenum matrixTarget)
+template<typename Scalar, int Flags_>
+void GpuHelper::loadMatrix(const Eigen::Matrix<Scalar,4,4, Flags_, 4,4>& mat, GLenum matrixTarget)
 {
     setMatrixTarget(matrixTarget);
-    GlMatrixHelper<(_Flags&Eigen::RowMajorBit)!=0, _Flags>::loadMatrix(mat);
+    GlMatrixHelper<(Flags_&Eigen::RowMajorBit)!=0, Flags_>::loadMatrix(mat);
 }
 
 inline void GpuHelper::pushMatrix(GLenum matrixTarget)
@@ -166,11 +166,11 @@
     glPushMatrix();
 }
 
-template<typename Scalar, int _Flags>
-inline void GpuHelper::pushMatrix(const Matrix<Scalar,4,4, _Flags, 4,4>& mat, GLenum matrixTarget)
+template<typename Scalar, int Flags_>
+inline void GpuHelper::pushMatrix(const Matrix<Scalar,4,4, Flags_, 4,4>& mat, GLenum matrixTarget)
 {
     pushMatrix(matrixTarget);
-    GlMatrixHelper<_Flags&Eigen::RowMajorBit,_Flags>::loadMatrix(mat);
+    GlMatrixHelper<Flags_&Eigen::RowMajorBit,Flags_>::loadMatrix(mat);
 }
 
 template<typename Scalar, typename Derived>
diff --git a/demos/opengl/quaternion_demo.cpp b/demos/opengl/quaternion_demo.cpp
index dd323a4..531448d 100644
--- a/demos/opengl/quaternion_demo.cpp
+++ b/demos/opengl/quaternion_demo.cpp
@@ -132,11 +132,11 @@
                Quaternionf(lerp(alpha,OrientationType(a.orientation),OrientationType(b.orientation))));
 }
 
-template<typename _Scalar> class EulerAngles
+template<typename Scalar_> class EulerAngles
 {
 public:
   enum { Dim = 3 };
-  typedef _Scalar Scalar;
+  typedef Scalar_ Scalar;
   typedef Matrix<Scalar,3,3> Matrix3;
   typedef Matrix<Scalar,3,1> Vector3;
   typedef Quaternion<Scalar> QuaternionType;
diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt
index 0f9ef23..e7eaa4b 100644
--- a/doc/CMakeLists.txt
+++ b/doc/CMakeLists.txt
@@ -10,9 +10,6 @@
   endif()
 endif()
 
-# some examples and snippets needs c++11, so let's check it once
-check_cxx_compiler_flag("-std=c++11" EIGEN_COMPILER_SUPPORT_CPP11)
-
 option(EIGEN_INTERNAL_DOCUMENTATION "Build internal documentation" OFF)
 option(EIGEN_DOC_USE_MATHJAX "Use MathJax for rendering math in HTML docs" ON)
 
diff --git a/doc/InsideEigenExample.dox b/doc/InsideEigenExample.dox
index ea2275b..4af185d 100644
--- a/doc/InsideEigenExample.dox
+++ b/doc/InsideEigenExample.dox
@@ -88,7 +88,7 @@
 
 Let's look at this constructor, in src/Core/DenseStorage.h. You can see that there are many partial template specializations of DenseStorages here, treating separately the cases where dimensions are Dynamic or fixed at compile-time. The partial specialization that we are looking at is:
 \code
-template<typename T, int _Cols> class DenseStorage<T, Dynamic, Dynamic, _Cols>
+template<typename T, int Cols_> class DenseStorage<T, Dynamic, Dynamic, Cols_>
 \endcode
 
 Here, the constructor called is DenseStorage::DenseStorage(int size, int rows, int columns)
@@ -101,7 +101,7 @@
 
 Here, the \a m_data member is the actual array of coefficients of the matrix. As you see, it is dynamically allocated. Rather than calling new[] or malloc(), as you can see, we have our own internal::aligned_new defined in src/Core/util/Memory.h. What it does is that if vectorization is enabled, then it uses a platform-specific call to allocate a 128-bit-aligned array, as that is very useful for vectorization with both SSE2 and AltiVec. If vectorization is disabled, it amounts to the standard new[].
 
-As you can see, the constructor also sets the \a m_rows member to \a size. Notice that there is no \a m_columns member: indeed, in this partial specialization of DenseStorage, we know the number of columns at compile-time, since the _Cols template parameter is different from Dynamic. Namely, in our case, _Cols is 1, which is to say that our vector is just a matrix with 1 column. Hence, there is no need to store the number of columns as a runtime variable.
+As you can see, the constructor also sets the \a m_rows member to \a size. Notice that there is no \a m_columns member: indeed, in this partial specialization of DenseStorage, we know the number of columns at compile-time, since the Cols_ template parameter is different from Dynamic. Namely, in our case, Cols_ is 1, which is to say that our vector is just a matrix with 1 column. Hence, there is no need to store the number of columns as a runtime variable.
 
 When you call VectorXf::data() to get the pointer to the array of coefficients, it returns DenseStorage::data() which returns the \a m_data member.
 
diff --git a/doc/LeastSquares.dox b/doc/LeastSquares.dox
index 24dfe4b..ddbf38d 100644
--- a/doc/LeastSquares.dox
+++ b/doc/LeastSquares.dox
@@ -30,14 +30,17 @@
 </table>
 
 This is example from the page \link TutorialLinearAlgebra Linear algebra and decompositions \endlink.
+If you just need to solve the least squares problem, but are not interested in the SVD per se, a
+faster alternative method is CompleteOrthogonalDecomposition. 
 
 
 \section LeastSquaresQR Using the QR decomposition
 
 The solve() method in QR decomposition classes also computes the least squares solution. There are
-three QR decomposition classes: HouseholderQR (no pivoting, so fast but unstable),
-ColPivHouseholderQR (column pivoting, thus a bit slower but more accurate) and FullPivHouseholderQR
-(full pivoting, so slowest and most stable). Here is an example with column pivoting:
+three QR decomposition classes: HouseholderQR (no pivoting, fast but unstable if your matrix is
+not rull rank), ColPivHouseholderQR (column pivoting, thus a bit slower but more stable) and
+FullPivHouseholderQR (full pivoting, so slowest and slightly more stable than ColPivHouseholderQR).
+Here is an example with column pivoting:
 
 <table class="example">
 <tr><th>Example:</th><th>Output:</th></tr>
@@ -61,9 +64,11 @@
 </tr>
 </table>
 
-If the matrix \a A is ill-conditioned, then this is not a good method, because the condition number
+This method is usually the fastest, especially when \a A is "tall and skinny". However, if the
+matrix \a A is even mildly ill-conditioned, this is not a good method, because the condition number
 of <i>A</i><sup>T</sup><i>A</i> is the square of the condition number of \a A. This means that you
-lose twice as many digits using normal equation than if you use the other methods.
+lose roughly twice as many digits of accuracy using the normal equation, compared to the more stable
+methods mentioned above.
 
 */
 
diff --git a/doc/TopicLinearAlgebraDecompositions.dox b/doc/TopicLinearAlgebraDecompositions.dox
index 0965da8..402b376 100644
--- a/doc/TopicLinearAlgebraDecompositions.dox
+++ b/doc/TopicLinearAlgebraDecompositions.dox
@@ -72,7 +72,7 @@
         <td>Orthogonalization</td>
         <td>Yes</td>
         <td>Excellent</td>
-        <td><em>Soon: blocking</em></td>
+        <td><em>-</em></td>
     </tr>
 
     <tr>
@@ -88,6 +88,18 @@
     </tr>
 
     <tr class="alt">
+        <td>CompleteOrthogonalDecomposition</td>
+        <td>-</td>
+        <td>Fast</td>
+        <td>Good</td>
+        <td>Yes</td>
+        <td>Orthogonalization</td>
+        <td>Yes</td>
+        <td>Excellent</td>
+        <td><em>-</em></td>
+    </tr>
+
+    <tr>
         <td>LLT</td>
         <td>Positive definite</td>
         <td>Very fast</td>
@@ -99,7 +111,7 @@
         <td>Blocking</td>
     </tr>
 
-    <tr>
+    <tr class="alt">
         <td>LDLT</td>
         <td>Positive or negative semidefinite<sup><a href="#note1">1</a></sup></td>
         <td>Very fast</td>
diff --git a/doc/TutorialBlockOperations.dox b/doc/TutorialBlockOperations.dox
index a2d8c97..df27748 100644
--- a/doc/TutorialBlockOperations.dox
+++ b/doc/TutorialBlockOperations.dox
@@ -167,6 +167,20 @@
     <td>\code 
 matrix.rightCols<q>();\endcode </td>
 </tr>
+<tr><td>%Block containing the q columns starting from i
+                    \link DenseBase::middleCols() * \endlink</td>
+    <td>\code
+matrix.middleCols(i,q);\endcode </td>
+    <td>\code 
+matrix.middleCols<q>(i);\endcode </td>
+</tr>
+<tr><td>%Block containing the q rows starting from i
+                    \link DenseBase::middleRows() * \endlink</td>
+    <td>\code
+matrix.middleRows(i,q);\endcode </td>
+    <td>\code 
+matrix.middleRows<q>(i);\endcode </td>
+</tr>
 </table>
 
 Here is a simple example illustrating the use of the operations presented above:
diff --git a/doc/TutorialLinearAlgebra.dox b/doc/TutorialLinearAlgebra.dox
index a727241..8042fca 100644
--- a/doc/TutorialLinearAlgebra.dox
+++ b/doc/TutorialLinearAlgebra.dox
@@ -14,7 +14,7 @@
     \f[ Ax \: = \: b \f]
 Where \a A and \a b are matrices (\a b could be a vector, as a special case). You want to find a solution \a x.
 
-\b The \b solution: You can choose between various decompositions, depending on what your matrix \a A looks like,
+\b The \b solution: You can choose between various decompositions, depending on the properties of your matrix \a A,
 and depending on whether you favor speed or accuracy. However, let's start with an example that works in all cases,
 and is a good compromise:
 <table class="example">
@@ -34,7 +34,7 @@
 
 Here, ColPivHouseholderQR is a QR decomposition with column pivoting. It's a good compromise for this tutorial, as it
 works for all matrices while being quite fast. Here is a table of some other decompositions that you can choose from,
-depending on your matrix and the trade-off you want to make:
+depending on your matrix, the problem you are trying to solve, and the trade-off you want to make:
 
 <table class="manual">
     <tr>
@@ -128,11 +128,13 @@
 </table>
 To get an overview of the true relative speed of the different decompositions, check this \link DenseDecompositionBenchmark benchmark \endlink.
 
-All of these decompositions offer a solve() method that works as in the above example.
+All of these decompositions offer a solve() method that works as in the above example. 
 
-For example, if your matrix is positive definite, the above table says that a very good
-choice is then the LLT or LDLT decomposition. Here's an example, also demonstrating that using a general
-matrix (not a vector) as right hand side is possible.
+If you know more about the properties of your matrix, you can use the above table to select the best method.
+For example, a good choice for solving linear systems with a non-symmetric matrix of full rank is PartialPivLU.
+If you know that your matrix is also symmetric and positive definite, the above table says that
+a very good choice is the LLT or LDLT decomposition. Here's an example, also demonstrating that using a general
+matrix (not a vector) as right hand side is possible:
 
 <table class="example">
 <tr><th>Example:</th><th>Output:</th></tr>
@@ -146,7 +148,34 @@
 supports many other decompositions), see our special page on
 \ref TopicLinearAlgebraDecompositions "this topic".
 
-\section TutorialLinAlgSolutionExists Checking if a solution really exists
+
+\section TutorialLinAlgLeastsquares Least squares solving
+
+The most general and accurate method to solve under- or over-determined linear systems
+in the least squares sense, is the SVD decomposition. Eigen provides two implementations.
+The recommended one is the BDCSVD class, which scales well for large problems
+and automatically falls back to the JacobiSVD class for smaller problems.
+For both classes, their solve() method solved the linear system in the least-squares
+sense. 
+
+Here is an example:
+<table class="example">
+<tr><th>Example:</th><th>Output:</th></tr>
+<tr>
+  <td>\include TutorialLinAlgSVDSolve.cpp </td>
+  <td>\verbinclude TutorialLinAlgSVDSolve.out </td>
+</tr>
+</table>
+
+An alternative to the SVD, which is usually faster and about as accurate, is CompleteOrthogonalDecomposition. 
+
+Again, if you know more about the problem, the table above contains methods that are potentially faster.
+If your matrix is full rank, HouseHolderQR is the method of choice. If your matrix is full rank and well conditioned,
+using the Cholesky decomposition (LLT) on the matrix of the normal equations can be faster still.
+Our page on \link LeastSquares least squares solving \endlink has more details.
+
+
+\section TutorialLinAlgSolutionExists Checking if a matrix is singular
 
 Only you know what error margin you want to allow for a solution to be considered valid.
 So Eigen lets you do this computation for yourself, if you want to, as in this example:
@@ -179,11 +208,11 @@
 \section TutorialLinAlgInverse Computing inverse and determinant
 
 First of all, make sure that you really want this. While inverse and determinant are fundamental mathematical concepts,
-in \em numerical linear algebra they are not as popular as in pure mathematics. Inverse computations are often
+in \em numerical linear algebra they are not as useful as in pure mathematics. Inverse computations are often
 advantageously replaced by solve() operations, and the determinant is often \em not a good way of checking if a matrix
 is invertible.
 
-However, for \em very \em small matrices, the above is not true, and inverse and determinant can be very useful.
+However, for \em very \em small matrices, the above may not be true, and inverse and determinant can be very useful.
 
 While certain decompositions, such as PartialPivLU and FullPivLU, offer inverse() and determinant() methods, you can also
 call inverse() and determinant() directly on a matrix. If your matrix is of a very small fixed size (at most 4x4) this
@@ -198,28 +227,6 @@
 </tr>
 </table>
 
-\section TutorialLinAlgLeastsquares Least squares solving
-
-The most accurate method to do least squares solving is with a SVD decomposition.
-Eigen provides two implementations.
-The recommended one is the BDCSVD class, which scale well for large problems
-and automatically fall-back to the JacobiSVD class for smaller problems.
-For both classes, their solve() method is doing least-squares solving.
-
-Here is an example:
-<table class="example">
-<tr><th>Example:</th><th>Output:</th></tr>
-<tr>
-  <td>\include TutorialLinAlgSVDSolve.cpp </td>
-  <td>\verbinclude TutorialLinAlgSVDSolve.out </td>
-</tr>
-</table>
-
-Another methods, potentially faster but less reliable, are to use a Cholesky decomposition of the
-normal matrix or a QR decomposition. Our page on \link LeastSquares least squares solving \endlink
-has more details.
-
-
 \section TutorialLinAlgSeparateComputation Separating the computation from the construction
 
 In the above examples, the decomposition was computed at the same time that the decomposition object was constructed.
diff --git a/doc/examples/CMakeLists.txt b/doc/examples/CMakeLists.txt
index a2c9d05..dd49e3c 100644
--- a/doc/examples/CMakeLists.txt
+++ b/doc/examples/CMakeLists.txt
@@ -14,7 +14,3 @@
   )
   add_dependencies(all_examples ${example})
 endforeach()
-
-if(EIGEN_COMPILER_SUPPORT_CPP11)
-ei_add_target_property(nullary_indexing COMPILE_FLAGS "-std=c++11")
-endif()
\ No newline at end of file
diff --git a/doc/snippets/CMakeLists.txt b/doc/snippets/CMakeLists.txt
index 65f195a..868d669 100644
--- a/doc/snippets/CMakeLists.txt
+++ b/doc/snippets/CMakeLists.txt
@@ -6,31 +6,26 @@
   get_filename_component(snippet ${snippet_src} NAME_WE)
   set(compile_snippet_target compile_${snippet})
   set(compile_snippet_src ${compile_snippet_target}.cpp)
-  if((NOT ${snippet_src} MATCHES "cxx11") OR EIGEN_COMPILER_SUPPORT_CPP11)
-    file(READ ${snippet_src} snippet_source_code)
-    configure_file(${CMAKE_CURRENT_SOURCE_DIR}/compile_snippet.cpp.in
-                  ${CMAKE_CURRENT_BINARY_DIR}/${compile_snippet_src})
-    add_executable(${compile_snippet_target}
-                  ${CMAKE_CURRENT_BINARY_DIR}/${compile_snippet_src})
-    if(EIGEN_STANDARD_LIBRARIES_TO_LINK_TO)
-      target_link_libraries(${compile_snippet_target} ${EIGEN_STANDARD_LIBRARIES_TO_LINK_TO})
-    endif()
-    if(${snippet_src} MATCHES "cxx11")
-      set_target_properties(${compile_snippet_target} PROPERTIES COMPILE_FLAGS "-std=c++11")
-    endif()
-    if(${snippet_src} MATCHES "deprecated")
-      set_target_properties(${compile_snippet_target} PROPERTIES COMPILE_FLAGS "-DEIGEN_NO_DEPRECATED_WARNING")
-    endif()
-    add_custom_command(
-      TARGET ${compile_snippet_target}
-      POST_BUILD
-      COMMAND ${compile_snippet_target}
-      ARGS >${CMAKE_CURRENT_BINARY_DIR}/${snippet}.out
-    )
-    add_dependencies(all_snippets ${compile_snippet_target})
-    set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/${compile_snippet_src}
-                                PROPERTIES OBJECT_DEPENDS ${snippet_src})
-  else()
-    message("skip snippet ${snippet_src} because compiler does not support C++11")
+  
+  file(READ ${snippet_src} snippet_source_code)
+  configure_file(${CMAKE_CURRENT_SOURCE_DIR}/compile_snippet.cpp.in
+                ${CMAKE_CURRENT_BINARY_DIR}/${compile_snippet_src})
+  add_executable(${compile_snippet_target}
+                ${CMAKE_CURRENT_BINARY_DIR}/${compile_snippet_src})
+  if(EIGEN_STANDARD_LIBRARIES_TO_LINK_TO)
+    target_link_libraries(${compile_snippet_target} ${EIGEN_STANDARD_LIBRARIES_TO_LINK_TO})
   endif()
+
+  if(${snippet_src} MATCHES "deprecated")
+    set_target_properties(${compile_snippet_target} PROPERTIES COMPILE_FLAGS "-DEIGEN_NO_DEPRECATED_WARNING")
+  endif()
+  add_custom_command(
+    TARGET ${compile_snippet_target}
+    POST_BUILD
+    COMMAND ${compile_snippet_target}
+    ARGS >${CMAKE_CURRENT_BINARY_DIR}/${snippet}.out
+  )
+  add_dependencies(all_snippets ${compile_snippet_target})
+  set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/${compile_snippet_src}
+                              PROPERTIES OBJECT_DEPENDS ${snippet_src})
 endforeach()
diff --git a/doc/snippets/Tridiagonalization_decomposeInPlace.cpp b/doc/snippets/Tridiagonalization_decomposeInPlace.cpp
index 93dcfca..3cdce67 100644
--- a/doc/snippets/Tridiagonalization_decomposeInPlace.cpp
+++ b/doc/snippets/Tridiagonalization_decomposeInPlace.cpp
@@ -4,7 +4,8 @@
 
 VectorXd diag(5);
 VectorXd subdiag(4);
-internal::tridiagonalization_inplace(A, diag, subdiag, true);
+VectorXd hcoeffs(4);  // Scratch space for householder reflector.
+internal::tridiagonalization_inplace(A, diag, subdiag, hcoeffs, true);
 cout << "The orthogonal matrix Q is:" << endl << A << endl;
 cout << "The diagonal of the tridiagonal matrix T is:" << endl << diag << endl;
 cout << "The subdiagonal of the tridiagonal matrix T is:" << endl << subdiag << endl;
diff --git a/doc/special_examples/CMakeLists.txt b/doc/special_examples/CMakeLists.txt
index 5b00e8b..e6407aa 100644
--- a/doc/special_examples/CMakeLists.txt
+++ b/doc/special_examples/CMakeLists.txt
@@ -19,16 +19,13 @@
   add_dependencies(all_examples Tutorial_sparse_example)
 endif()
 
-if(EIGEN_COMPILER_SUPPORT_CPP11)
-  add_executable(random_cpp11 random_cpp11.cpp)
-  target_link_libraries(random_cpp11 ${EIGEN_STANDARD_LIBRARIES_TO_LINK_TO})
-  add_dependencies(all_examples random_cpp11)
-  ei_add_target_property(random_cpp11 COMPILE_FLAGS "-std=c++11")
+add_executable(random_cpp11 random_cpp11.cpp)
+target_link_libraries(random_cpp11 ${EIGEN_STANDARD_LIBRARIES_TO_LINK_TO})
+add_dependencies(all_examples random_cpp11)
 
-  add_custom_command(
-    TARGET random_cpp11
-    POST_BUILD
-    COMMAND random_cpp11
-    ARGS >${CMAKE_CURRENT_BINARY_DIR}/random_cpp11.out
-  )
-endif()
+add_custom_command(
+  TARGET random_cpp11
+  POST_BUILD
+  COMMAND random_cpp11
+  ARGS >${CMAKE_CURRENT_BINARY_DIR}/random_cpp11.out
+)
diff --git a/failtest/CMakeLists.txt b/failtest/CMakeLists.txt
index 256e541..2c5fc33 100644
--- a/failtest/CMakeLists.txt
+++ b/failtest/CMakeLists.txt
@@ -62,9 +62,5 @@
 ei_add_failtest("bdcsvd_int")
 ei_add_failtest("eigensolver_int")
 ei_add_failtest("eigensolver_cplx")
-
-if(EIGEN_TEST_CXX11)
-  ei_add_failtest("initializer_list_1")
-  ei_add_failtest("initializer_list_2")
-endif()
-
+ei_add_failtest("initializer_list_1")
+ei_add_failtest("initializer_list_2")
diff --git a/lapack/CMakeLists.txt b/lapack/CMakeLists.txt
index 9eec810..c8ca640 100644
--- a/lapack/CMakeLists.txt
+++ b/lapack/CMakeLists.txt
@@ -1,10 +1,16 @@
-
 project(EigenLapack CXX)
 
 include(CheckLanguage)
 check_language(Fortran)
 if(CMAKE_Fortran_COMPILER)
   enable_language(Fortran)
+  if("${CMAKE_Fortran_COMPILER_ID}" STREQUAL "GNU")
+    if ("${CMAKE_Fortran_COMPILER_VERSION}" VERSION_GREATER_EQUAL 10.0)
+      # We use an old version of LAPACK with argument type mismatches.
+      # Allow them to compile anyway with newer GNU versions.
+      set(CMAKE_Fortran_FLAGS  "${CMAKE_Fortran_FLAGS} -fallow-argument-mismatch")
+    endif()
+  endif()
   set(EIGEN_Fortran_COMPILER_WORKS ON)
 else()
   set(EIGEN_Fortran_COMPILER_WORKS OFF)
@@ -88,25 +94,29 @@
 
 endif()
 
+set(EIGEN_LAPACK_TARGETS "")
+
 add_library(eigen_lapack_static ${EigenLapack_SRCS} ${ReferenceLapack_SRCS})
-add_library(eigen_lapack SHARED ${EigenLapack_SRCS})
+list(APPEND EIGEN_LAPACK_TARGETS eigen_lapack_static)
 
-target_link_libraries(eigen_lapack  eigen_blas)
-
-if(EIGEN_STANDARD_LIBRARIES_TO_LINK_TO)
-  target_link_libraries(eigen_lapack_static ${EIGEN_STANDARD_LIBRARIES_TO_LINK_TO})
-  target_link_libraries(eigen_lapack        ${EIGEN_STANDARD_LIBRARIES_TO_LINK_TO})
+if (EIGEN_BUILD_SHARED_LIBS)
+  add_library(eigen_lapack SHARED ${EigenLapack_SRCS})
+  list(APPEND EIGEN_LAPACK_TARGETS eigen_lapack)
+  target_link_libraries(eigen_lapack  eigen_blas)
 endif()
 
-add_dependencies(lapack eigen_lapack eigen_lapack_static)
+foreach(target IN LISTS EIGEN_LAPACK_TARGETS)
+  if(EIGEN_STANDARD_LIBRARIES_TO_LINK_TO)
+    target_link_libraries(${target} ${EIGEN_STANDARD_LIBRARIES_TO_LINK_TO})
+  endif()
+  add_dependencies(lapack ${target})
+  install(TARGETS ${target}
+          RUNTIME DESTINATION bin
+          LIBRARY DESTINATION lib
+          ARCHIVE DESTINATION lib)
+endforeach()
 
-install(TARGETS eigen_lapack eigen_lapack_static
-        RUNTIME DESTINATION bin
-        LIBRARY DESTINATION lib
-        ARCHIVE DESTINATION lib)
 
-        
-        
 get_filename_component(eigen_full_path_to_testing_lapack "./testing/" ABSOLUTE)
 if(EXISTS ${eigen_full_path_to_testing_lapack})
   
@@ -141,6 +151,7 @@
     string(REPLACE "." "_" input_name ${input})
     set(testName "${target}_${input_name}")
     if(EXISTS "${TEST_INPUT}")
+      add_dependencies(buildtests ${target})
       add_test(NAME LAPACK-${testName}
         COMMAND "${CMAKE_COMMAND}"
         -DTEST=$<TARGET_FILE:${target}>
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 56664e7..f0136db 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -164,7 +164,6 @@
 ei_add_test(mixingtypes)
 ei_add_test(io)
 ei_add_test(packetmath "-DEIGEN_FAST_MATH=1")
-ei_add_test(unalignedassert)
 ei_add_test(vectorization_logic)
 ei_add_test(basicstuff)
 ei_add_test(constructor)
@@ -286,10 +285,9 @@
 ei_add_test(num_dimensions)
 ei_add_test(stl_iterators)
 ei_add_test(blasutil)
-if(EIGEN_TEST_CXX11)
-  ei_add_test(initializer_list_construction)
-  ei_add_test(diagonal_matrix_variadic_ctor)
-endif()
+ei_add_test(random_matrix)
+ei_add_test(initializer_list_construction)
+ei_add_test(diagonal_matrix_variadic_ctor)
 
 add_executable(bug1213 bug1213.cpp bug1213_main.cpp)
 
@@ -400,7 +398,6 @@
     set(CUDA_NVCC_FLAGS "-ccbin ${CMAKE_C_COMPILER}" CACHE STRING "nvcc flags" FORCE)
   endif()
   if(EIGEN_TEST_CUDA_CLANG)
-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
     string(APPEND CMAKE_CXX_FLAGS " --cuda-path=${CUDA_TOOLKIT_ROOT_DIR}")
     foreach(GPU IN LISTS EIGEN_CUDA_COMPUTE_ARCH)
       string(APPEND CMAKE_CXX_FLAGS " --cuda-gpu-arch=sm_${GPU}")
diff --git a/test/array_cwise.cpp b/test/array_cwise.cpp
index 1bc8e19..0cc438b 100644
--- a/test/array_cwise.cpp
+++ b/test/array_cwise.cpp
@@ -626,6 +626,41 @@
   }
 }
 
+template<int N>
+struct shift_left {
+  template<typename Scalar>
+  Scalar operator()(const Scalar& v) const {
+    return v << N;
+  }
+};
+
+template<int N>
+struct arithmetic_shift_right {
+  template<typename Scalar>
+  Scalar operator()(const Scalar& v) const {
+    return v >> N;
+  }
+};
+
+template<typename ArrayType> void array_integer(const ArrayType& m)
+{
+  Index rows = m.rows();
+  Index cols = m.cols();
+
+  ArrayType m1 = ArrayType::Random(rows, cols),
+            m2(rows, cols);
+
+  m2 = m1.template shiftLeft<2>();
+  VERIFY( (m2 == m1.unaryExpr(shift_left<2>())).all() );
+  m2 = m1.template shiftLeft<9>();
+  VERIFY( (m2 == m1.unaryExpr(shift_left<9>())).all() );
+  
+  m2 = m1.template shiftRight<2>();
+  VERIFY( (m2 == m1.unaryExpr(arithmetic_shift_right<2>())).all() );
+  m2 = m1.template shiftRight<9>();
+  VERIFY( (m2 == m1.unaryExpr(arithmetic_shift_right<9>())).all() );
+}
+
 EIGEN_DECLARE_TEST(array_cwise)
 {
   for(int i = 0; i < g_repeat; i++) {
@@ -636,6 +671,8 @@
     CALL_SUBTEST_5( array(ArrayXXf(internal::random<int>(1,EIGEN_TEST_MAX_SIZE), internal::random<int>(1,EIGEN_TEST_MAX_SIZE))) );
     CALL_SUBTEST_6( array(ArrayXXi(internal::random<int>(1,EIGEN_TEST_MAX_SIZE), internal::random<int>(1,EIGEN_TEST_MAX_SIZE))) );
     CALL_SUBTEST_6( array(Array<Index,Dynamic,Dynamic>(internal::random<int>(1,EIGEN_TEST_MAX_SIZE), internal::random<int>(1,EIGEN_TEST_MAX_SIZE))) );
+    CALL_SUBTEST_6( array_integer(ArrayXXi(internal::random<int>(1,EIGEN_TEST_MAX_SIZE), internal::random<int>(1,EIGEN_TEST_MAX_SIZE))) );
+    CALL_SUBTEST_6( array_integer(Array<Index,Dynamic,Dynamic>(internal::random<int>(1,EIGEN_TEST_MAX_SIZE), internal::random<int>(1,EIGEN_TEST_MAX_SIZE))) );
   }
   for(int i = 0; i < g_repeat; i++) {
     CALL_SUBTEST_1( comparisons(Array<float, 1, 1>()) );
diff --git a/test/bfloat16_float.cpp b/test/bfloat16_float.cpp
index 1df22f7..c3de0b1 100644
--- a/test/bfloat16_float.cpp
+++ b/test/bfloat16_float.cpp
@@ -32,18 +32,6 @@
   return dest;
 }
 
-void test_truncate(float input, float expected_truncation, float expected_rounding){
-  bfloat16 truncated = Eigen::bfloat16_impl::truncate_to_bfloat16(input);
-  bfloat16 rounded = Eigen::bfloat16_impl::float_to_bfloat16_rtne<false>(input);
-  if ((numext::isnan)(input)){
-    VERIFY((numext::isnan)(static_cast<float>(truncated)) || (numext::isinf)(static_cast<float>(truncated)));
-    VERIFY((numext::isnan)(static_cast<float>(rounded)) || (numext::isinf)(static_cast<float>(rounded)));
-    return;
-  }
-  VERIFY_IS_EQUAL(expected_truncation, static_cast<float>(truncated));
-  VERIFY_IS_EQUAL(expected_rounding, static_cast<float>(rounded));
-}
-
 template<typename T>
  void test_roundtrip() {
   // Representable T round trip via bfloat16
@@ -122,31 +110,6 @@
   VERIFY_BFLOAT16_BITS_EQUAL(bfloat16(0.0f), 0x0000);
   VERIFY_BFLOAT16_BITS_EQUAL(bfloat16(-0.0f), 0x8000);
 
-  // Flush denormals to zero
-  for (float denorm = -std::numeric_limits<float>::denorm_min();
-       denorm < std::numeric_limits<float>::denorm_min();
-       denorm = nextafterf(denorm, 1.0f)) {
-    bfloat16 bf_trunc = Eigen::bfloat16_impl::truncate_to_bfloat16(denorm);
-    VERIFY_IS_EQUAL(static_cast<float>(bf_trunc), 0.0f);
-
-    // Implicit conversion of denormls to bool is correct
-    VERIFY_IS_EQUAL(static_cast<bool>(bfloat16(denorm)), false);
-    VERIFY_IS_EQUAL(bfloat16(denorm), false);
-
-    if (std::signbit(denorm)) {
-      VERIFY_BFLOAT16_BITS_EQUAL(bf_trunc, 0x8000);
-    } else {
-      VERIFY_BFLOAT16_BITS_EQUAL(bf_trunc, 0x0000);
-    }
-    bfloat16 bf_round = Eigen::bfloat16_impl::float_to_bfloat16_rtne<false>(denorm);
-    VERIFY_IS_EQUAL(static_cast<float>(bf_round), 0.0f);
-    if (std::signbit(denorm)) {
-      VERIFY_BFLOAT16_BITS_EQUAL(bf_round, 0x8000);
-    } else {
-      VERIFY_BFLOAT16_BITS_EQUAL(bf_round, 0x0000);
-    }
-  }
-
   // Default is zero
   VERIFY_IS_EQUAL(static_cast<float>(bfloat16()), 0.0f);
 
@@ -156,52 +119,6 @@
   test_roundtrip<std::complex<float> >();
   test_roundtrip<std::complex<double> >();
 
-  // Truncate test
-  test_truncate(
-      BinaryToFloat(0, 0x80, 0x48, 0xf5c3),
-      BinaryToFloat(0, 0x80, 0x48, 0x0000),
-      BinaryToFloat(0, 0x80, 0x49, 0x0000));
-  test_truncate(
-      BinaryToFloat(1, 0x80, 0x48, 0xf5c3),
-      BinaryToFloat(1, 0x80, 0x48, 0x0000),
-      BinaryToFloat(1, 0x80, 0x49, 0x0000));
-  test_truncate(
-      BinaryToFloat(0, 0x80, 0x48, 0x8000),
-      BinaryToFloat(0, 0x80, 0x48, 0x0000),
-      BinaryToFloat(0, 0x80, 0x48, 0x0000));
-  test_truncate(
-      BinaryToFloat(0, 0xff, 0x00, 0x0001),
-      BinaryToFloat(0, 0xff, 0x40, 0x0000),
-      BinaryToFloat(0, 0xff, 0x40, 0x0000));
-  test_truncate(
-      BinaryToFloat(0, 0xff, 0x7f, 0xffff),
-      BinaryToFloat(0, 0xff, 0x40, 0x0000),
-      BinaryToFloat(0, 0xff, 0x40, 0x0000));
-  test_truncate(
-      BinaryToFloat(1, 0x80, 0x48, 0xc000),
-      BinaryToFloat(1, 0x80, 0x48, 0x0000),
-      BinaryToFloat(1, 0x80, 0x49, 0x0000));
-  test_truncate(
-      BinaryToFloat(0, 0x80, 0x48, 0x0000),
-      BinaryToFloat(0, 0x80, 0x48, 0x0000),
-      BinaryToFloat(0, 0x80, 0x48, 0x0000));
-  test_truncate(
-      BinaryToFloat(0, 0x80, 0x48, 0x4000),
-      BinaryToFloat(0, 0x80, 0x48, 0x0000),
-      BinaryToFloat(0, 0x80, 0x48, 0x0000));
-  test_truncate(
-      BinaryToFloat(0, 0x80, 0x48, 0x8000),
-      BinaryToFloat(0, 0x80, 0x48, 0x0000),
-      BinaryToFloat(0, 0x80, 0x48, 0x0000));
-  test_truncate(
-      BinaryToFloat(0, 0x00, 0x48, 0x8000),
-      BinaryToFloat(0, 0x00, 0x00, 0x0000),
-      BinaryToFloat(0, 0x00, 0x00, 0x0000));
-  test_truncate(
-      BinaryToFloat(0, 0x00, 0x7f, 0xc000),
-      BinaryToFloat(0, 0x00, 0x00, 0x0000),
-      BinaryToFloat(0, 0x00, 0x00, 0x0000));
-
   // Conversion
   Array<float,1,100> a;
   for (int i = 0; i < 100; i++) a(i) = i + 1.25;
@@ -250,12 +167,6 @@
 
   VERIFY_BFLOAT16_BITS_EQUAL(bfloat16(BinaryToFloat(0x0, 0xff, 0x40, 0x0)), 0x7fc0);
   VERIFY_BFLOAT16_BITS_EQUAL(bfloat16(BinaryToFloat(0x1, 0xff, 0x40, 0x0)), 0xffc0);
-  VERIFY_BFLOAT16_BITS_EQUAL(Eigen::bfloat16_impl::truncate_to_bfloat16(
-                               BinaryToFloat(0x0, 0xff, 0x40, 0x0)),
-                             0x7fc0);
-  VERIFY_BFLOAT16_BITS_EQUAL(Eigen::bfloat16_impl::truncate_to_bfloat16(
-                               BinaryToFloat(0x1, 0xff, 0x40, 0x0)),
-                             0xffc0);
 }
 
 void test_numtraits()
diff --git a/test/conservative_resize.cpp b/test/conservative_resize.cpp
index d709e33..d48eb12 100644
--- a/test/conservative_resize.cpp
+++ b/test/conservative_resize.cpp
@@ -115,9 +115,11 @@
 {
   typedef Eigen::Matrix<AnnoyingScalar,Dynamic,1> VectorType;
   typedef Eigen::Matrix<AnnoyingScalar,Dynamic,Dynamic> MatrixType;
-  
+
   {
+#ifndef EIGEN_TEST_ANNOYING_SCALAR_DONT_THROW
     AnnoyingScalar::dont_throw = true;
+#endif
     int n = 50;
     VectorType v0(n), v1(n);
     MatrixType m0(n,n), m1(n,n), m2(n,n);
@@ -156,7 +158,9 @@
     CALL_SUBTEST_4((run_vector_tests<std::complex<float> >()));
     CALL_SUBTEST_5((run_vector_tests<std::complex<double> >()));
 
+#ifndef EIGEN_TEST_ANNOYING_SCALAR_DONT_THROW
     AnnoyingScalar::dont_throw = true;
+#endif
     CALL_SUBTEST_6(( run_vector_tests<AnnoyingScalar>() ));
     CALL_SUBTEST_6(( noncopyable<0>() ));
   }
diff --git a/test/geo_hyperplane.cpp b/test/geo_hyperplane.cpp
index 2c89ecd..44b2f2a 100644
--- a/test/geo_hyperplane.cpp
+++ b/test/geo_hyperplane.cpp
@@ -172,11 +172,6 @@
 
   VERIFY_IS_APPROX(p1->coeffs(), p2->coeffs());
   VERIFY_IS_APPROX(p1->coeffs(), p3->coeffs());
-  
-  #if defined(EIGEN_VECTORIZE) && EIGEN_MAX_STATIC_ALIGN_BYTES > 0
-  if(internal::packet_traits<Scalar>::Vectorizable && internal::packet_traits<Scalar>::size<=4)
-    VERIFY_RAISES_ASSERT((::new(reinterpret_cast<void*>(array3u)) Plane3a));
-  #endif
 }
 
 
diff --git a/test/geo_parametrizedline.cpp b/test/geo_parametrizedline.cpp
index 7135c8f..e4b194a 100644
--- a/test/geo_parametrizedline.cpp
+++ b/test/geo_parametrizedline.cpp
@@ -110,11 +110,6 @@
   VERIFY_IS_APPROX(p1->origin(), p3->origin());
   VERIFY_IS_APPROX(p1->direction(), p2->direction());
   VERIFY_IS_APPROX(p1->direction(), p3->direction());
-  
-  #if defined(EIGEN_VECTORIZE) && EIGEN_MAX_STATIC_ALIGN_BYTES>0
-  if(internal::packet_traits<Scalar>::Vectorizable && internal::packet_traits<Scalar>::size<=4)
-    VERIFY_RAISES_ASSERT((::new(reinterpret_cast<void*>(array3u)) Line4a));
-  #endif
 }
 
 EIGEN_DECLARE_TEST(geo_parametrizedline)
diff --git a/test/geo_quaternion.cpp b/test/geo_quaternion.cpp
index c4a3162..c561fc8 100644
--- a/test/geo_quaternion.cpp
+++ b/test/geo_quaternion.cpp
@@ -218,10 +218,6 @@
   VERIFY_IS_APPROX(q1.coeffs(), q2.coeffs());
   VERIFY_IS_APPROX(q1.coeffs(), q3.coeffs());
   VERIFY_IS_APPROX(q4.coeffs(), q3.coeffs());
-  #ifdef EIGEN_VECTORIZE
-  if(internal::packet_traits<Scalar>::Vectorizable)
-    VERIFY_RAISES_ASSERT((MQuaternionA(array3unaligned)));
-  #endif
     
   VERIFY_IS_APPROX(mq1 * (mq1.inverse() * v1), v1);
   VERIFY_IS_APPROX(mq1 * (mq1.conjugate() * v1), v1);
@@ -281,10 +277,6 @@
 
   VERIFY_IS_APPROX(q1->coeffs(), q2->coeffs());
   VERIFY_IS_APPROX(q1->coeffs(), q3->coeffs());
-  #if defined(EIGEN_VECTORIZE) && EIGEN_MAX_STATIC_ALIGN_BYTES>0
-  if(internal::packet_traits<Scalar>::Vectorizable && internal::packet_traits<Scalar>::size<=4)
-    VERIFY_RAISES_ASSERT((::new(reinterpret_cast<void*>(arrayunaligned)) QuaternionA));
-  #endif
 }
 
 template<typename PlainObjectType> void check_const_correctness(const PlainObjectType&)
diff --git a/test/geo_transformations.cpp b/test/geo_transformations.cpp
index d433561..72c6eda 100644
--- a/test/geo_transformations.cpp
+++ b/test/geo_transformations.cpp
@@ -582,11 +582,6 @@
   VERIFY_IS_APPROX(p1->matrix(), p3->matrix());
   
   VERIFY_IS_APPROX( (*p1) * (*p1), (*p2)*(*p3));
-  
-  #if defined(EIGEN_VECTORIZE) && EIGEN_MAX_STATIC_ALIGN_BYTES>0
-  if(internal::packet_traits<Scalar>::Vectorizable)
-    VERIFY_RAISES_ASSERT((::new(reinterpret_cast<void*>(array3u)) Projective3a));
-  #endif
 }
 
 template<typename Scalar, int Dim, int Options> void transform_products()
diff --git a/test/main.h b/test/main.h
index 786673d..0166738 100644
--- a/test/main.h
+++ b/test/main.h
@@ -357,7 +357,7 @@
 #endif // EIGEN_NO_ASSERTION_CHECKING
 
 #define EIGEN_INTERNAL_DEBUGGING
-#include <Eigen/QR> // required for createRandomPIMatrixOfRank
+#include <Eigen/QR> // required for createRandomPIMatrixOfRank and generateRandomMatrixSvs
 
 inline void verify_impl(bool condition, const char *testname, const char *file, int line, const char *condition_as_string)
 {
@@ -403,6 +403,36 @@
   } while (0)
 
 
+  namespace Eigen {
+
+// Forward declarations to avoid ICC warnings
+template<typename T, typename U>
+bool test_is_equal(const T& actual, const U& expected, bool expect_equal=true);
+
+template<typename MatrixType>
+void createRandomPIMatrixOfRank(Index desired_rank, Index rows, Index cols, MatrixType& m);
+
+template<typename PermutationVectorType>
+void randomPermutationVector(PermutationVectorType& v, Index size);
+
+template<typename MatrixType>
+MatrixType generateRandomUnitaryMatrix(const Index dim);
+
+template<typename MatrixType, typename RealScalarVectorType>
+void generateRandomMatrixSvs(const RealScalarVectorType &svs, const Index rows, const Index cols, MatrixType& M);
+
+template<typename VectorType, typename RealScalar>
+VectorType setupRandomSvs(const Index dim, const RealScalar max);
+
+template<typename VectorType, typename RealScalar>
+VectorType setupRangeSvs(const Index dim, const RealScalar min, const RealScalar max);
+
+} // end namespace Eigen
+
+// Forward declaration to avoid ICC warnings
+template<typename T> std::string type_name();
+
+
 namespace Eigen {
 
 template<typename T1,typename T2>
@@ -625,10 +655,6 @@
   return m.isUnitary(test_precision<typename internal::traits<Derived>::Scalar>());
 }
 
-// Forward declaration to avoid ICC warning
-template<typename T, typename U>
-bool test_is_equal(const T& actual, const U& expected, bool expect_equal=true);
-
 template<typename T, typename U>
 bool test_is_equal(const T& actual, const U& expected, bool expect_equal)
 {
@@ -683,7 +709,7 @@
   MatrixType d = MatrixType::Identity(rows,cols);
   MatrixBType  b = MatrixBType::Random(cols,cols);
 
-  // set the diagonal such that only desired_rank non-zero entries reamain
+  // set the diagonal such that only desired_rank non-zero entries remain
   const Index diag_size = (std::min)(d.rows(),d.cols());
   if(diag_size != desired_rank)
     d.diagonal().segment(desired_rank, diag_size-desired_rank) = VectorType::Zero(diag_size-desired_rank);
@@ -720,6 +746,138 @@
 }
 
 /**
+ * Generate a random unitary matrix of prescribed dimension.
+ *
+ * The algorithm is using a random Householder sequence to produce
+ * a random unitary matrix.
+ *
+ * @tparam MatrixType type of matrix to generate
+ * @param dim row and column dimension of the requested square matrix
+ * @return random unitary matrix
+ */
+template<typename MatrixType>
+MatrixType generateRandomUnitaryMatrix(const Index dim)
+{
+  typedef typename internal::traits<MatrixType>::Scalar Scalar;
+  typedef Matrix<Scalar, Dynamic, 1> VectorType;
+
+  MatrixType v = MatrixType::Identity(dim, dim);
+  VectorType h = VectorType::Zero(dim);
+  for (Index i = 0; i < dim; ++i)
+  {
+    v.col(i).tail(dim - i - 1) = VectorType::Random(dim - i - 1);
+    h(i) = 2 / v.col(i).tail(dim - i).squaredNorm();
+  }
+
+  const Eigen::HouseholderSequence<MatrixType, VectorType> HSeq(v, h);
+  return MatrixType(HSeq);
+}
+
+/**
+ * Generation of random matrix with prescribed singular values.
+ *
+ * We generate random matrices with given singular values by setting up
+ * a singular value decomposition. By choosing the number of zeros as
+ * singular values we can specify the rank of the matrix.
+ * Moreover, we also control its spectral norm, which is the largest
+ * singular value, as well as its condition number with respect to the
+ * l2-norm, which is the quotient of the largest and smallest singular
+ * value.
+ *
+ * Reference: For details on the method see e.g. Section 8.1 (pp. 62 f) in
+ *
+ *   C. C. Paige, M. A. Saunders,
+ *   LSQR: An algorithm for sparse linear equations and sparse least squares.
+ *   ACM Transactions on Mathematical Software 8(1), pp. 43-71, 1982.
+ *   https://web.stanford.edu/group/SOL/software/lsqr/lsqr-toms82a.pdf
+ *
+ * and also the LSQR webpage https://web.stanford.edu/group/SOL/software/lsqr/.
+ *
+ * @tparam MatrixType matrix type to generate
+ * @tparam RealScalarVectorType vector type with real entries used for singular values
+ * @param svs vector of desired singular values
+ * @param rows row dimension of requested random matrix
+ * @param cols column dimension of requested random matrix
+ * @param M generated matrix with prescribed singular values
+ */
+template<typename MatrixType, typename RealScalarVectorType>
+void generateRandomMatrixSvs(const RealScalarVectorType &svs, const Index rows, const Index cols, MatrixType& M)
+{
+  enum { Rows = MatrixType::RowsAtCompileTime, Cols = MatrixType::ColsAtCompileTime };
+  typedef typename internal::traits<MatrixType>::Scalar Scalar;
+  typedef Matrix<Scalar, Rows, Rows> MatrixAType;
+  typedef Matrix<Scalar, Cols, Cols> MatrixBType;
+
+  const Index min_dim = (std::min)(rows, cols);
+
+  const MatrixAType U = generateRandomUnitaryMatrix<MatrixAType>(rows);
+  const MatrixBType V = generateRandomUnitaryMatrix<MatrixBType>(cols);
+
+  M = U.block(0, 0, rows, min_dim) * svs.asDiagonal() * V.block(0, 0, cols, min_dim).transpose();
+}
+
+/**
+ * Setup a vector of random singular values with prescribed upper limit.
+ * For use with generateRandomMatrixSvs().
+ *
+ * Singular values are non-negative real values. By convention (to be consistent with
+ * singular value decomposition) we sort them in decreasing order.
+ *
+ * This strategy produces random singular values in the range [0, max], in particular
+ * the singular values can be zero or arbitrarily close to zero.
+ *
+ * @tparam VectorType vector type with real entries used for singular values
+ * @tparam RealScalar data type used for real entry
+ * @param dim number of singular values to generate
+ * @param max upper bound for singular values
+ * @return vector of singular values
+ */
+template<typename VectorType, typename RealScalar>
+VectorType setupRandomSvs(const Index dim, const RealScalar max)
+{
+  VectorType svs = max / RealScalar(2) * (VectorType::Random(dim) + VectorType::Ones(dim));
+  std::sort(svs.begin(), svs.end(), std::greater<RealScalar>());
+  return svs;
+}
+
+/**
+ * Setup a vector of random singular values with prescribed range.
+ * For use with generateRandomMatrixSvs().
+ *
+ * Singular values are non-negative real values. By convention (to be consistent with
+ * singular value decomposition) we sort them in decreasing order.
+ *
+ * For dim > 1 this strategy generates a vector with largest entry max, smallest entry
+ * min, and remaining entries in the range [min, max]. For dim == 1 the only entry is
+ * min.
+ *
+ * @tparam VectorType vector type with real entries used for singular values
+ * @tparam RealScalar data type used for real entry
+ * @param dim number of singular values to generate
+ * @param min smallest singular value to use
+ * @param max largest singular value to use
+ * @return vector of singular values
+ */
+template<typename VectorType, typename RealScalar>
+VectorType setupRangeSvs(const Index dim, const RealScalar min, const RealScalar max)
+{
+  VectorType svs = VectorType::Random(dim);
+  if(dim == 0)
+    return svs;
+  if(dim == 1)
+  {
+    svs(0) = min;
+    return svs;
+  }
+  std::sort(svs.begin(), svs.end(), std::greater<RealScalar>());
+
+  // scale to range [min, max]
+  const RealScalar c_min = svs(dim - 1), c_max = svs(0);
+  svs = (svs - VectorType::Constant(dim, c_min)) / (c_max - c_min);
+  return min * (VectorType::Ones(dim) - svs) + max * svs;
+}
+
+/**
  * Check if number is "not a number" (NaN).
  *
  * @tparam T input type
@@ -764,8 +922,6 @@
 template<typename T> struct GetDifferentType<std::complex<T> >
 { typedef std::complex<typename GetDifferentType<T>::type> type; };
 
-// Forward declaration to avoid ICC warning
-template<typename T> std::string type_name();
 template<typename T> std::string type_name()                    { return "other"; }
 template<> std::string type_name<float>()                       { return "float"; }
 template<> std::string type_name<double>()                      { return "double"; }
diff --git a/test/random_matrix.cpp b/test/random_matrix.cpp
new file mode 100644
index 0000000..fb877de
--- /dev/null
+++ b/test/random_matrix.cpp
@@ -0,0 +1,136 @@
+// This file is part of Eigen, a lightweight C++ template library
+// for linear algebra.
+//
+// Copyright (C) 2021 Kolja Brix <kolja.brix@rwth-aachen.de>
+//
+// This Source Code Form is subject to the terms of the Mozilla
+// 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/.
+
+#include "main.h"
+#include <Eigen/SVD>
+
+
+template<typename MatrixType>
+void check_generateRandomUnitaryMatrix(const Index dim)
+{
+    const MatrixType Q = generateRandomUnitaryMatrix<MatrixType>(dim);
+
+    // validate dimensions
+    VERIFY_IS_EQUAL(Q.rows(), dim);
+    VERIFY_IS_EQUAL(Q.cols(), dim);
+
+    VERIFY_IS_UNITARY(Q);
+}
+
+template<typename VectorType, typename RealScalarType>
+void check_setupRandomSvs(const Index dim, const RealScalarType max)
+{
+    const VectorType v = setupRandomSvs<VectorType, RealScalarType>(dim, max);
+
+    // validate dimensions
+    VERIFY_IS_EQUAL(v.size(), dim);
+
+    // check entries
+    for(Index i = 0; i < v.size(); ++i)
+        VERIFY_GE(v(i), 0);
+    for(Index i = 0; i < v.size()-1; ++i)
+        VERIFY_GE(v(i), v(i+1));
+}
+
+template<typename VectorType, typename RealScalarType>
+void check_setupRangeSvs(const Index dim, const RealScalarType min, const RealScalarType max)
+{
+    const VectorType v = setupRangeSvs<VectorType, RealScalarType>(dim, min, max);
+
+    // validate dimensions
+    VERIFY_IS_EQUAL(v.size(), dim);
+
+    // check entries
+    if(dim == 1) {
+        VERIFY_IS_APPROX(v(0), min);
+    } else {
+        VERIFY_IS_APPROX(v(0), max);
+        VERIFY_IS_APPROX(v(dim-1), min);
+    }
+    for(Index i = 0; i < v.size()-1; ++i)
+        VERIFY_GE(v(i), v(i+1));
+}
+
+template<typename MatrixType, typename RealScalar, typename RealVectorType>
+void check_generateRandomMatrixSvs(const Index rows, const Index cols, const Index diag_size,
+                                   const RealScalar min_svs, const RealScalar max_svs)
+{
+    RealVectorType svs = setupRangeSvs<RealVectorType, RealScalar>(diag_size, min_svs, max_svs);
+
+    MatrixType M;
+    generateRandomMatrixSvs(svs, rows, cols, M);
+
+    // validate dimensions
+    VERIFY_IS_EQUAL(M.rows(), rows);
+    VERIFY_IS_EQUAL(M.cols(), cols);
+    VERIFY_IS_EQUAL(svs.size(), diag_size);
+
+    // validate singular values
+    Eigen::JacobiSVD<MatrixType> SVD(M);
+    VERIFY_IS_APPROX(svs, SVD.singularValues());
+}
+
+template<typename MatrixType>
+void check_random_matrix(const MatrixType &m)
+{
+    enum {
+        Rows = MatrixType::RowsAtCompileTime,
+        Cols = MatrixType::ColsAtCompileTime,
+        DiagSize = EIGEN_SIZE_MIN_PREFER_DYNAMIC(Rows, Cols)
+    };
+    typedef typename MatrixType::Scalar Scalar;
+    typedef typename NumTraits<Scalar>::Real RealScalar;
+    typedef Matrix<RealScalar, DiagSize, 1> RealVectorType;
+
+    const Index rows = m.rows(), cols = m.cols();
+    const Index diag_size = (std::min)(rows, cols);
+    const RealScalar min_svs = 1.0, max_svs = 1000.0;
+
+    // check generation of unitary random matrices
+    typedef Matrix<Scalar, Rows, Rows> MatrixAType;
+    typedef Matrix<Scalar, Cols, Cols> MatrixBType;
+    check_generateRandomUnitaryMatrix<MatrixAType>(rows);
+    check_generateRandomUnitaryMatrix<MatrixBType>(cols);
+
+    // test generators for singular values
+    check_setupRandomSvs<RealVectorType, RealScalar>(diag_size, max_svs);
+    check_setupRangeSvs<RealVectorType, RealScalar>(diag_size, min_svs, max_svs);
+
+    // check generation of random matrices
+    check_generateRandomMatrixSvs<MatrixType, RealScalar, RealVectorType>(rows, cols, diag_size, min_svs, max_svs);
+}
+
+EIGEN_DECLARE_TEST(random_matrix)
+{
+  for(int i = 0; i < g_repeat; i++) {
+    CALL_SUBTEST_1(check_random_matrix(Matrix<float, 1, 1>()));
+    CALL_SUBTEST_2(check_random_matrix(Matrix<float, 4, 4>()));
+    CALL_SUBTEST_3(check_random_matrix(Matrix<float, 2, 3>()));
+    CALL_SUBTEST_4(check_random_matrix(Matrix<float, 7, 4>()));
+
+    CALL_SUBTEST_5(check_random_matrix(Matrix<double, 1, 1>()));
+    CALL_SUBTEST_6(check_random_matrix(Matrix<double, 6, 6>()));
+    CALL_SUBTEST_7(check_random_matrix(Matrix<double, 5, 3>()));
+    CALL_SUBTEST_8(check_random_matrix(Matrix<double, 4, 9>()));
+
+    CALL_SUBTEST_9(check_random_matrix(Matrix<std::complex<float>, 12, 12>()));
+    CALL_SUBTEST_10(check_random_matrix(Matrix<std::complex<float>, 7, 14>()));
+    CALL_SUBTEST_11(check_random_matrix(Matrix<std::complex<double>, 15, 11>()));
+    CALL_SUBTEST_12(check_random_matrix(Matrix<std::complex<double>, 6, 9>()));
+
+    CALL_SUBTEST_13(check_random_matrix(
+        MatrixXf(internal::random<int>(1, EIGEN_TEST_MAX_SIZE), internal::random<int>(1, EIGEN_TEST_MAX_SIZE))));
+    CALL_SUBTEST_14(check_random_matrix(
+        MatrixXd(internal::random<int>(1, EIGEN_TEST_MAX_SIZE), internal::random<int>(1, EIGEN_TEST_MAX_SIZE))));
+    CALL_SUBTEST_15(check_random_matrix(
+        MatrixXcf(internal::random<int>(1, EIGEN_TEST_MAX_SIZE), internal::random<int>(1, EIGEN_TEST_MAX_SIZE))));
+    CALL_SUBTEST_16(check_random_matrix(
+        MatrixXcd(internal::random<int>(1, EIGEN_TEST_MAX_SIZE), internal::random<int>(1, EIGEN_TEST_MAX_SIZE))));
+  }
+}
diff --git a/test/sparse.h b/test/sparse.h
index 6cd07fc..67cc06e 100644
--- a/test/sparse.h
+++ b/test/sparse.h
@@ -102,55 +102,6 @@
   //sparseMat.finalize();
 }
 
-template<typename Scalar,int Opt1,int Opt2,typename Index> void
-initSparse(double density,
-           Matrix<Scalar,Dynamic,Dynamic, Opt1>& refMat,
-           DynamicSparseMatrix<Scalar, Opt2, Index>& sparseMat,
-           int flags = 0,
-           std::vector<Matrix<Index,2,1> >* zeroCoords = 0,
-           std::vector<Matrix<Index,2,1> >* nonzeroCoords = 0)
-{
-  enum { IsRowMajor = DynamicSparseMatrix<Scalar,Opt2,Index>::IsRowMajor };
-  sparseMat.setZero();
-  sparseMat.reserve(int(refMat.rows()*refMat.cols()*density));
-  for(int j=0; j<sparseMat.outerSize(); j++)
-  {
-    sparseMat.startVec(j); // not needed for DynamicSparseMatrix
-    for(int i=0; i<sparseMat.innerSize(); i++)
-    {
-      int ai(i), aj(j);
-      if(IsRowMajor)
-        std::swap(ai,aj);
-      Scalar v = (internal::random<double>(0,1) < density) ? internal::random<Scalar>() : Scalar(0);
-      if ((flags&ForceNonZeroDiag) && (i==j))
-      {
-        v = internal::random<Scalar>()*Scalar(3.);
-        v = v*v + Scalar(5.);
-      }
-      if ((flags & MakeLowerTriangular) && aj>ai)
-        v = Scalar(0);
-      else if ((flags & MakeUpperTriangular) && aj<ai)
-        v = Scalar(0);
-
-      if ((flags&ForceRealDiag) && (i==j))
-        v = numext::real(v);
-
-      if (v!=Scalar(0))
-      {
-        sparseMat.insertBackByOuterInner(j,i) = v;
-        if (nonzeroCoords)
-          nonzeroCoords->push_back(Matrix<Index,2,1> (ai,aj));
-      }
-      else if (zeroCoords)
-      {
-        zeroCoords->push_back(Matrix<Index,2,1> (ai,aj));
-      }
-      refMat(ai,aj) = v;
-    }
-  }
-  sparseMat.finalize();
-}
-
 template<typename Scalar,int Options,typename Index> void
 initSparse(double density,
            Matrix<Scalar,Dynamic,1>& refVec,
diff --git a/test/sparse_block.cpp b/test/sparse_block.cpp
index f966810..b4905b0 100644
--- a/test/sparse_block.cpp
+++ b/test/sparse_block.cpp
@@ -315,8 +315,9 @@
     
     CALL_SUBTEST_4(( sparse_block(SparseMatrix<double,ColMajor,short int>(short(r), short(c))) ));
     CALL_SUBTEST_4(( sparse_block(SparseMatrix<double,RowMajor,short int>(short(r), short(c))) ));
-
+#ifndef EIGEN_TEST_ANNOYING_SCALAR_DONT_THROW
     AnnoyingScalar::dont_throw = true;
+#endif
     CALL_SUBTEST_5((  sparse_block(SparseMatrix<AnnoyingScalar>(r,c)) ));
   }
 }
diff --git a/test/swap.cpp b/test/swap.cpp
index 5b259d3..813c613 100644
--- a/test/swap.cpp
+++ b/test/swap.cpp
@@ -16,10 +16,10 @@
   typedef int type;
 };
 
-template<typename _Scalar, int _Rows, int _Cols, int _Options, int _MaxRows, int _MaxCols>
-struct other_matrix_type<Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols> >
+template<typename Scalar_, int Rows_, int Cols_, int Options_, int MaxRows_, int MaxCols_>
+struct other_matrix_type<Matrix<Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_> >
 {
-  typedef Matrix<_Scalar, _Rows, _Cols, _Options^RowMajor, _MaxRows, _MaxCols> type;
+  typedef Matrix<Scalar_, Rows_, Cols_, Options_^RowMajor, MaxRows_, MaxCols_> type;
 };
 
 template<typename MatrixType> void swap(const MatrixType& m)
diff --git a/test/symbolic_index.cpp b/test/symbolic_index.cpp
index b114cbb..a75ca11 100644
--- a/test/symbolic_index.cpp
+++ b/test/symbolic_index.cpp
@@ -58,15 +58,15 @@
   VERIFY( is_same_type( fix<9>()/2, int(9/2) ) );
 
   VERIFY( is_same_symb( lastp1-1, last, size) );
-  VERIFY( is_same_symb( lastp1-fix<1>, last, size) );
+  VERIFY( is_same_symb( lastp1-fix<1>(), last, size) );
 
   VERIFY_IS_EQUAL( ( (last*5-2)/3 ).eval(last=size-1), ((size-1)*5-2)/3 );
-  VERIFY_IS_EQUAL( ( (last*fix<5>-fix<2>)/fix<3> ).eval(last=size-1), ((size-1)*5-2)/3 );
+  VERIFY_IS_EQUAL( ( (last*fix<5>()-fix<2>())/fix<3>() ).eval(last=size-1), ((size-1)*5-2)/3 );
   VERIFY_IS_EQUAL( ( -last*lastp1  ).eval(last=size-1), -(size-1)*size );
   VERIFY_IS_EQUAL( ( lastp1-3*last  ).eval(last=size-1), size- 3*(size-1) );
   VERIFY_IS_EQUAL( ( (lastp1-3*last)/lastp1  ).eval(last=size-1), (size- 3*(size-1))/size );
 
-#if EIGEN_HAS_CXX14
+#if EIGEN_HAS_CXX14_VARIABLE_TEMPLATES
   {
     struct x_tag {};  static const symbolic::SymbolExpr<x_tag> x;
     struct y_tag {};  static const symbolic::SymbolExpr<y_tag> y;
diff --git a/test/unalignedassert.cpp b/test/unalignedassert.cpp
deleted file mode 100644
index 120cc42..0000000
--- a/test/unalignedassert.cpp
+++ /dev/null
@@ -1,180 +0,0 @@
-// This file is part of Eigen, a lightweight C++ template library
-// for linear algebra.
-//
-// Copyright (C) 2008 Benoit Jacob <jacob.benoit.1@gmail.com>
-// Copyright (C) 2015 Gael Guennebaud <gael.guennebaud@inria.fr>
-//
-// This Source Code Form is subject to the terms of the Mozilla
-// 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/.
-
-#if defined(EIGEN_TEST_PART_1)
-  // default
-#elif defined(EIGEN_TEST_PART_2)
-  #define EIGEN_MAX_STATIC_ALIGN_BYTES 16
-  #define EIGEN_MAX_ALIGN_BYTES 16
-#elif defined(EIGEN_TEST_PART_3)
-  #define EIGEN_MAX_STATIC_ALIGN_BYTES 32
-  #define EIGEN_MAX_ALIGN_BYTES 32
-#elif defined(EIGEN_TEST_PART_4)
-  #define EIGEN_MAX_STATIC_ALIGN_BYTES 64
-  #define EIGEN_MAX_ALIGN_BYTES 64
-#endif
-
-#include "main.h"
-
-typedef Matrix<float,  6,1> Vector6f;
-typedef Matrix<float,  8,1> Vector8f;
-typedef Matrix<float, 12,1> Vector12f;
-
-typedef Matrix<double, 5,1> Vector5d;
-typedef Matrix<double, 6,1> Vector6d;
-typedef Matrix<double, 7,1> Vector7d;
-typedef Matrix<double, 8,1> Vector8d;
-typedef Matrix<double, 9,1> Vector9d;
-typedef Matrix<double,10,1> Vector10d;
-typedef Matrix<double,12,1> Vector12d;
-
-struct TestNew1
-{
-  MatrixXd m; // good: m will allocate its own array, taking care of alignment.
-  TestNew1() : m(20,20) {}
-};
-
-struct TestNew2
-{
-  Matrix3d m; // good: m's size isn't a multiple of 16 bytes, so m doesn't have to be 16-byte aligned,
-              // 8-byte alignment is good enough here, which we'll get automatically
-};
-
-struct TestNew3
-{
-  Vector2f m; // good: m's size isn't a multiple of 16 bytes, so m doesn't have to be 16-byte aligned
-};
-
-struct TestNew4
-{
-  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
-  Vector2d m;
-  float f; // make the struct have sizeof%16!=0 to make it a little more tricky when we allow an array of 2 such objects
-};
-
-struct TestNew5
-{
-  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
-  float f; // try the f at first -- the EIGEN_ALIGN_MAX attribute of m should make that still work
-  Matrix4f m;
-};
-
-struct TestNew6
-{
-  Matrix<float,2,2,DontAlign> m; // good: no alignment requested
-  float f;
-};
-
-template<bool Align> struct Depends
-{
-  EIGEN_MAKE_ALIGNED_OPERATOR_NEW_IF(Align)
-  Vector2d m;
-  float f;
-};
-
-template<typename T>
-void check_unalignedassert_good()
-{
-  T *x, *y;
-  x = new T;
-  delete x;
-  y = new T[2];
-  delete[] y;
-}
-
-#if EIGEN_MAX_STATIC_ALIGN_BYTES>0
-template<typename T>
-void construct_at_boundary(int boundary)
-{
-  char buf[sizeof(T)+256];
-  size_t _buf = reinterpret_cast<internal::UIntPtr>(buf);
-  _buf += (EIGEN_MAX_ALIGN_BYTES - (_buf % EIGEN_MAX_ALIGN_BYTES)); // make 16/32/...-byte aligned
-  _buf += boundary; // make exact boundary-aligned
-  T *x = ::new(reinterpret_cast<void*>(_buf)) T;
-  x[0].setZero(); // just in order to silence warnings
-  x->~T();
-}
-#endif
-
-void unalignedassert()
-{
-#if EIGEN_MAX_STATIC_ALIGN_BYTES>0
-  construct_at_boundary<Vector2f>(4);
-  construct_at_boundary<Vector3f>(4);
-  construct_at_boundary<Vector4f>(16);
-  construct_at_boundary<Vector6f>(4);
-  construct_at_boundary<Vector8f>(EIGEN_MAX_ALIGN_BYTES);
-  construct_at_boundary<Vector12f>(16);
-  construct_at_boundary<Matrix2f>(16);
-  construct_at_boundary<Matrix3f>(4);
-  construct_at_boundary<Matrix4f>(EIGEN_MAX_ALIGN_BYTES);
-
-  construct_at_boundary<Vector2d>(16);
-  construct_at_boundary<Vector3d>(4);
-  construct_at_boundary<Vector4d>(EIGEN_MAX_ALIGN_BYTES);
-  construct_at_boundary<Vector5d>(4);
-  construct_at_boundary<Vector6d>(16);
-  construct_at_boundary<Vector7d>(4);
-  construct_at_boundary<Vector8d>(EIGEN_MAX_ALIGN_BYTES);
-  construct_at_boundary<Vector9d>(4);
-  construct_at_boundary<Vector10d>(16);
-  construct_at_boundary<Vector12d>(EIGEN_MAX_ALIGN_BYTES);
-  construct_at_boundary<Matrix2d>(EIGEN_MAX_ALIGN_BYTES);
-  construct_at_boundary<Matrix3d>(4);
-  construct_at_boundary<Matrix4d>(EIGEN_MAX_ALIGN_BYTES);
-
-  construct_at_boundary<Vector2cf>(16);
-  construct_at_boundary<Vector3cf>(4);
-  construct_at_boundary<Vector2cd>(EIGEN_MAX_ALIGN_BYTES);
-  construct_at_boundary<Vector3cd>(16);
-#endif
-
-  check_unalignedassert_good<TestNew1>();
-  check_unalignedassert_good<TestNew2>();
-  check_unalignedassert_good<TestNew3>();
-
-  check_unalignedassert_good<TestNew4>();
-  check_unalignedassert_good<TestNew5>();
-  check_unalignedassert_good<TestNew6>();
-  check_unalignedassert_good<Depends<true> >();
-
-#if EIGEN_MAX_STATIC_ALIGN_BYTES>0
-  if(EIGEN_MAX_ALIGN_BYTES>=16)
-  {
-    VERIFY_RAISES_ASSERT(construct_at_boundary<Vector4f>(8));
-    VERIFY_RAISES_ASSERT(construct_at_boundary<Vector8f>(8));
-    VERIFY_RAISES_ASSERT(construct_at_boundary<Vector12f>(8));
-    VERIFY_RAISES_ASSERT(construct_at_boundary<Vector2d>(8));
-    VERIFY_RAISES_ASSERT(construct_at_boundary<Vector4d>(8));
-    VERIFY_RAISES_ASSERT(construct_at_boundary<Vector6d>(8));
-    VERIFY_RAISES_ASSERT(construct_at_boundary<Vector8d>(8));
-    VERIFY_RAISES_ASSERT(construct_at_boundary<Vector10d>(8));
-    VERIFY_RAISES_ASSERT(construct_at_boundary<Vector12d>(8));
-    // Complexes are disabled because the compiler might aggressively vectorize
-    // the initialization of complex coeffs to 0 before we can check for alignedness
-    //VERIFY_RAISES_ASSERT(construct_at_boundary<Vector2cf>(8));
-    VERIFY_RAISES_ASSERT(construct_at_boundary<Vector4i>(8));
-  }
-  for(int b=8; b<EIGEN_MAX_ALIGN_BYTES; b+=8)
-  {
-    if(b<32)  VERIFY_RAISES_ASSERT(construct_at_boundary<Vector8f>(b));
-    if(b<64)  VERIFY_RAISES_ASSERT(construct_at_boundary<Matrix4f>(b));
-    if(b<32)  VERIFY_RAISES_ASSERT(construct_at_boundary<Vector4d>(b));
-    if(b<32)  VERIFY_RAISES_ASSERT(construct_at_boundary<Matrix2d>(b));
-    if(b<128) VERIFY_RAISES_ASSERT(construct_at_boundary<Matrix4d>(b));
-    //if(b<32)  VERIFY_RAISES_ASSERT(construct_at_boundary<Vector2cd>(b));
-  }
-#endif
-}
-
-EIGEN_DECLARE_TEST(unalignedassert)
-{
-  CALL_SUBTEST(unalignedassert());
-}
diff --git a/test/vectorization_logic.cpp b/test/vectorization_logic.cpp
index 97c0bda..602e9f1 100644
--- a/test/vectorization_logic.cpp
+++ b/test/vectorization_logic.cpp
@@ -337,7 +337,8 @@
         ((!EIGEN_UNALIGNED_VECTORIZE) && (sizeof(Scalar)==16)) ? NoUnrolling : CompleteUnrolling));
               
       VERIFY(test_assign(Matrix3(),Matrix3().cwiseQuotient(Matrix3()),
-        PacketTraits::HasDiv ? LinearVectorizedTraversal : LinearTraversal,CompleteUnrolling));
+        PacketTraits::HasDiv ? LinearVectorizedTraversal : LinearTraversal,
+        PacketTraits::HasDiv ? CompleteUnrolling : NoUnrolling));
         
       VERIFY(test_assign(Matrix<Scalar,17,17>(),Matrix<Scalar,17,17>()+Matrix<Scalar,17,17>(),
         sizeof(Scalar)==16 ? InnerVectorizedTraversal : (EIGEN_UNALIGNED_VECTORIZE ? LinearVectorizedTraversal : LinearTraversal),
diff --git a/unsupported/Eigen/AlignedVector3 b/unsupported/Eigen/AlignedVector3
index 4fa1842..fb36608 100644
--- a/unsupported/Eigen/AlignedVector3
+++ b/unsupported/Eigen/AlignedVector3
@@ -37,23 +37,23 @@
   *
   */
 // TODO specialize Cwise
-template<typename _Scalar> class AlignedVector3;
+template<typename Scalar_> class AlignedVector3;
 
 namespace internal {
-template<typename _Scalar> struct traits<AlignedVector3<_Scalar> >
-  : traits<Matrix<_Scalar,3,1,0,4,1> >
+template<typename Scalar_> struct traits<AlignedVector3<Scalar_> >
+  : traits<Matrix<Scalar_,3,1,0,4,1> >
 {
 };
 }
 
-template<typename _Scalar> class AlignedVector3
-  : public MatrixBase<AlignedVector3<_Scalar> >
+template<typename Scalar_> class AlignedVector3
+  : public MatrixBase<AlignedVector3<Scalar_> >
 {
-    typedef Matrix<_Scalar,4,1> CoeffType;
+    typedef Matrix<Scalar_,4,1> CoeffType;
     CoeffType m_coeffs;
   public:
 
-    typedef MatrixBase<AlignedVector3<_Scalar> > Base;	
+    typedef MatrixBase<AlignedVector3<Scalar_> > Base;
     EIGEN_DENSE_PUBLIC_INTERFACE(AlignedVector3)
     using Base::operator*;
 
@@ -207,10 +207,10 @@
 
 namespace internal {
 
-template<typename _Scalar>
-struct eval<AlignedVector3<_Scalar>, Dense>
+template<typename Scalar_>
+struct eval<AlignedVector3<Scalar_>, Dense>
 {
- typedef const AlignedVector3<_Scalar>& type;
+ typedef const AlignedVector3<Scalar_>& type;
 };
 
 template<typename Scalar>
diff --git a/unsupported/Eigen/CXX11/src/Tensor/Tensor.h b/unsupported/Eigen/CXX11/src/Tensor/Tensor.h
index 8cac2bb..03361e6 100644
--- a/unsupported/Eigen/CXX11/src/Tensor/Tensor.h
+++ b/unsupported/Eigen/CXX11/src/Tensor/Tensor.h
@@ -42,7 +42,8 @@
   * \endcode
   *
   * This class can be extended with the help of the plugin mechanism described on the page
-  * \ref TopicCustomizing_Plugins by defining the preprocessor symbol \c EIGEN_TENSOR_PLUGIN.
+  * \ref TopicCustomizing_Plugins by defining the preprocessor symbol \c EIGEN_TENSOR_PLUGIN,
+  * \c EIGEN_TENSORBASE_PLUGIN, and \c EIGEN_READONLY_TENSORBASE_PLUGIN.
   *
   * <i><b>Some notes:</b></i>
   *
@@ -522,6 +523,10 @@
     }
 #endif
 
+    #ifdef EIGEN_TENSOR_PLUGIN
+    #include EIGEN_TENSOR_PLUGIN
+    #endif
+
   protected:
 
     bool checkIndexRange(const array<Index, NumIndices>& indices) const
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorArgMax.h b/unsupported/Eigen/CXX11/src/Tensor/TensorArgMax.h
index 8b8fb92..1d7e9f1 100644
--- a/unsupported/Eigen/CXX11/src/Tensor/TensorArgMax.h
+++ b/unsupported/Eigen/CXX11/src/Tensor/TensorArgMax.h
@@ -14,20 +14,20 @@
 namespace Eigen {
 namespace internal {
 
-/** \class TensorIndexTuple
+/** \class TensorIndexPair
   * \ingroup CXX11_Tensor_Module
   *
-  * \brief Tensor + Index Tuple class.
+  * \brief Tensor + Index Pair class.
   *
   *
   */
 template<typename XprType>
-struct traits<TensorIndexTupleOp<XprType> > : public traits<XprType>
+struct traits<TensorIndexPairOp<XprType> > : public traits<XprType>
 {
   typedef traits<XprType> XprTraits;
   typedef typename XprTraits::StorageKind StorageKind;
   typedef typename XprTraits::Index Index;
-  typedef Tuple<Index, typename XprTraits::Scalar> Scalar;
+  typedef Pair<Index, typename XprTraits::Scalar> Scalar;
   typedef typename XprType::Nested Nested;
   typedef typename remove_reference<Nested>::type _Nested;
   static const int NumDimensions = XprTraits::NumDimensions;
@@ -35,32 +35,32 @@
 };
 
 template<typename XprType>
-struct eval<TensorIndexTupleOp<XprType>, Eigen::Dense>
+struct eval<TensorIndexPairOp<XprType>, Eigen::Dense>
 {
-  typedef const TensorIndexTupleOp<XprType>EIGEN_DEVICE_REF type;
+  typedef const TensorIndexPairOp<XprType>EIGEN_DEVICE_REF type;
 };
 
 template<typename XprType>
-struct nested<TensorIndexTupleOp<XprType>, 1,
-              typename eval<TensorIndexTupleOp<XprType> >::type>
+struct nested<TensorIndexPairOp<XprType>, 1,
+              typename eval<TensorIndexPairOp<XprType> >::type>
 {
-  typedef TensorIndexTupleOp<XprType> type;
+  typedef TensorIndexPairOp<XprType> type;
 };
 
 }  // end namespace internal
 
 template<typename XprType>
-class TensorIndexTupleOp : public TensorBase<TensorIndexTupleOp<XprType>, ReadOnlyAccessors>
+class TensorIndexPairOp : public TensorBase<TensorIndexPairOp<XprType>, ReadOnlyAccessors>
 {
   public:
-  typedef typename Eigen::internal::traits<TensorIndexTupleOp>::Scalar Scalar;
+  typedef typename Eigen::internal::traits<TensorIndexPairOp>::Scalar Scalar;
   typedef typename Eigen::NumTraits<Scalar>::Real RealScalar;
-  typedef typename Eigen::internal::nested<TensorIndexTupleOp>::type Nested;
-  typedef typename Eigen::internal::traits<TensorIndexTupleOp>::StorageKind StorageKind;
-  typedef typename Eigen::internal::traits<TensorIndexTupleOp>::Index Index;
-  typedef Tuple<Index, typename XprType::CoeffReturnType> CoeffReturnType;
+  typedef typename Eigen::internal::nested<TensorIndexPairOp>::type Nested;
+  typedef typename Eigen::internal::traits<TensorIndexPairOp>::StorageKind StorageKind;
+  typedef typename Eigen::internal::traits<TensorIndexPairOp>::Index Index;
+  typedef Pair<Index, typename XprType::CoeffReturnType> CoeffReturnType;
 
-  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorIndexTupleOp(const XprType& expr)
+  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorIndexPairOp(const XprType& expr)
       : m_xpr(expr) {}
 
   EIGEN_DEVICE_FUNC
@@ -73,9 +73,9 @@
 
 // Eval as rvalue
 template<typename ArgType, typename Device>
-struct TensorEvaluator<const TensorIndexTupleOp<ArgType>, Device>
+struct TensorEvaluator<const TensorIndexPairOp<ArgType>, Device>
 {
-  typedef TensorIndexTupleOp<ArgType> XprType;
+  typedef TensorIndexPairOp<ArgType> XprType;
   typedef typename XprType::Index Index;
   typedef typename XprType::Scalar Scalar;
   typedef typename XprType::CoeffReturnType CoeffReturnType;
@@ -138,14 +138,14 @@
 
 namespace internal {
 
-/** \class TensorTupleIndex
+/** \class TensorPairIndex
   * \ingroup CXX11_Tensor_Module
   *
-  * \brief Converts to Tensor<Tuple<Index, Scalar> > and reduces to Tensor<Index>.
+  * \brief Converts to Tensor<Pair<Index, Scalar> > and reduces to Tensor<Index>.
   *
   */
 template<typename ReduceOp, typename Dims, typename XprType>
-struct traits<TensorTupleReducerOp<ReduceOp, Dims, XprType> > : public traits<XprType>
+struct traits<TensorPairReducerOp<ReduceOp, Dims, XprType> > : public traits<XprType>
 {
   typedef traits<XprType> XprTraits;
   typedef typename XprTraits::StorageKind StorageKind;
@@ -158,32 +158,32 @@
 };
 
 template<typename ReduceOp, typename Dims, typename XprType>
-struct eval<TensorTupleReducerOp<ReduceOp, Dims, XprType>, Eigen::Dense>
+struct eval<TensorPairReducerOp<ReduceOp, Dims, XprType>, Eigen::Dense>
 {
-  typedef const TensorTupleReducerOp<ReduceOp, Dims, XprType>EIGEN_DEVICE_REF type;
+  typedef const TensorPairReducerOp<ReduceOp, Dims, XprType>EIGEN_DEVICE_REF type;
 };
 
 template<typename ReduceOp, typename Dims, typename XprType>
-struct nested<TensorTupleReducerOp<ReduceOp, Dims, XprType>, 1,
-              typename eval<TensorTupleReducerOp<ReduceOp, Dims, XprType> >::type>
+struct nested<TensorPairReducerOp<ReduceOp, Dims, XprType>, 1,
+              typename eval<TensorPairReducerOp<ReduceOp, Dims, XprType> >::type>
 {
-  typedef TensorTupleReducerOp<ReduceOp, Dims, XprType> type;
+  typedef TensorPairReducerOp<ReduceOp, Dims, XprType> type;
 };
 
 }  // end namespace internal
 
 template<typename ReduceOp, typename Dims, typename XprType>
-class TensorTupleReducerOp : public TensorBase<TensorTupleReducerOp<ReduceOp, Dims, XprType>, ReadOnlyAccessors>
+class TensorPairReducerOp : public TensorBase<TensorPairReducerOp<ReduceOp, Dims, XprType>, ReadOnlyAccessors>
 {
   public:
-  typedef typename Eigen::internal::traits<TensorTupleReducerOp>::Scalar Scalar;
+  typedef typename Eigen::internal::traits<TensorPairReducerOp>::Scalar Scalar;
   typedef typename Eigen::NumTraits<Scalar>::Real RealScalar;
-  typedef typename Eigen::internal::nested<TensorTupleReducerOp>::type Nested;
-  typedef typename Eigen::internal::traits<TensorTupleReducerOp>::StorageKind StorageKind;
-  typedef typename Eigen::internal::traits<TensorTupleReducerOp>::Index Index;
+  typedef typename Eigen::internal::nested<TensorPairReducerOp>::type Nested;
+  typedef typename Eigen::internal::traits<TensorPairReducerOp>::StorageKind StorageKind;
+  typedef typename Eigen::internal::traits<TensorPairReducerOp>::Index Index;
   typedef Index CoeffReturnType;
 
-  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorTupleReducerOp(const XprType& expr,
+  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorPairReducerOp(const XprType& expr,
                                                           const ReduceOp& reduce_op,
                                                           const Index return_dim,
                                                           const Dims& reduce_dims)
@@ -211,27 +211,27 @@
 
 // Eval as rvalue
 template<typename ReduceOp, typename Dims, typename ArgType, typename Device>
-struct TensorEvaluator<const TensorTupleReducerOp<ReduceOp, Dims, ArgType>, Device>
+struct TensorEvaluator<const TensorPairReducerOp<ReduceOp, Dims, ArgType>, Device>
 {
-  typedef TensorTupleReducerOp<ReduceOp, Dims, ArgType> XprType;
+  typedef TensorPairReducerOp<ReduceOp, Dims, ArgType> XprType;
   typedef typename XprType::Index Index;
   typedef typename XprType::Scalar Scalar;
   typedef typename XprType::CoeffReturnType CoeffReturnType;
-  typedef typename TensorIndexTupleOp<ArgType>::CoeffReturnType TupleType;
-  typedef typename TensorEvaluator<const TensorReductionOp<ReduceOp, Dims, const TensorIndexTupleOp<ArgType> >, Device>::Dimensions Dimensions;
-  typedef typename TensorEvaluator<const TensorIndexTupleOp<ArgType> , Device>::Dimensions InputDimensions;
+  typedef typename TensorIndexPairOp<ArgType>::CoeffReturnType PairType;
+  typedef typename TensorEvaluator<const TensorReductionOp<ReduceOp, Dims, const TensorIndexPairOp<ArgType> >, Device>::Dimensions Dimensions;
+  typedef typename TensorEvaluator<const TensorIndexPairOp<ArgType> , Device>::Dimensions InputDimensions;
   static const int NumDims = internal::array_size<InputDimensions>::value;
   typedef array<Index, NumDims> StrideDims;
   typedef StorageMemory<CoeffReturnType, Device> Storage;
   typedef typename Storage::Type EvaluatorPointerType;
-  typedef StorageMemory<TupleType, Device> TupleStorageMem;
+  typedef StorageMemory<PairType, Device> PairStorageMem;
 
   enum {
     IsAligned         = /*TensorEvaluator<ArgType, Device>::IsAligned*/ false,
     PacketAccess      = /*TensorEvaluator<ArgType, Device>::PacketAccess*/ false,
     BlockAccess       = false,
     PreferBlockAccess = TensorEvaluator<ArgType, Device>::PreferBlockAccess,
-    Layout            = TensorEvaluator<const TensorReductionOp<ReduceOp, Dims, const TensorIndexTupleOp<ArgType> >, Device>::Layout,
+    Layout            = TensorEvaluator<const TensorReductionOp<ReduceOp, Dims, const TensorIndexPairOp<ArgType> >, Device>::Layout,
     CoordAccess       = false,  // to be implemented
     RawAccess         = false
   };
@@ -242,7 +242,7 @@
 
   EIGEN_STRONG_INLINE TensorEvaluator(const XprType& op, const Device& device)
       : m_orig_impl(op.expression(), device),
-        m_impl(op.expression().index_tuples().reduce(op.reduce_dims(), op.reduce_op()), device),
+        m_impl(op.expression().index_pairs().reduce(op.reduce_dims(), op.reduce_op()), device),
         m_return_dim(op.return_dim())
   {
     gen_strides(m_orig_impl.dimensions(), m_strides);
@@ -272,7 +272,7 @@
   }
 
   EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE CoeffReturnType coeff(Index index) const {
-    const TupleType v = m_impl.coeff(index);
+    const PairType v = m_impl.coeff(index);
     return (m_return_dim < 0) ? v.first : (v.first % m_stride_mod) / m_stride_div;
   }
 
@@ -316,8 +316,8 @@
   }
 
  protected:
-  TensorEvaluator<const TensorIndexTupleOp<ArgType>, Device> m_orig_impl;
-  TensorEvaluator<const TensorReductionOp<ReduceOp, Dims, const TensorIndexTupleOp<ArgType> >, Device> m_impl;
+  TensorEvaluator<const TensorIndexPairOp<ArgType>, Device> m_orig_impl;
+  TensorEvaluator<const TensorReductionOp<ReduceOp, Dims, const TensorIndexPairOp<ArgType> >, Device> m_impl;
   const Index m_return_dim;
   StrideDims m_strides;
   Index m_stride_mod;
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorBase.h b/unsupported/Eigen/CXX11/src/Tensor/TensorBase.h
index 35b6458..580b937 100644
--- a/unsupported/Eigen/CXX11/src/Tensor/TensorBase.h
+++ b/unsupported/Eigen/CXX11/src/Tensor/TensorBase.h
@@ -741,55 +741,55 @@
     }
 
    EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
-    const TensorTupleReducerOp<
-      internal::ArgMaxTupleReducer<Tuple<Index, CoeffReturnType> >,
+    const TensorPairReducerOp<
+      internal::ArgMaxPairReducer<Pair<Index, CoeffReturnType> >,
       const array<Index, NumDimensions>, const Derived>
     argmax() const {
       array<Index, NumDimensions> in_dims;
       for (Index d = 0; d < NumDimensions; ++d) in_dims[d] = d;
-      return TensorTupleReducerOp<
-        internal::ArgMaxTupleReducer<Tuple<Index, CoeffReturnType> >,
+      return TensorPairReducerOp<
+        internal::ArgMaxPairReducer<Pair<Index, CoeffReturnType> >,
         const array<Index, NumDimensions>,
-        const Derived>(derived(), internal::ArgMaxTupleReducer<Tuple<Index, CoeffReturnType> >(), -1, in_dims);
+        const Derived>(derived(), internal::ArgMaxPairReducer<Pair<Index, CoeffReturnType> >(), -1, in_dims);
     }
 
     EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
-    const TensorTupleReducerOp<
-      internal::ArgMinTupleReducer<Tuple<Index, CoeffReturnType> >,
+    const TensorPairReducerOp<
+      internal::ArgMinPairReducer<Pair<Index, CoeffReturnType> >,
       const array<Index, NumDimensions>, const Derived>
     argmin() const {
       array<Index, NumDimensions> in_dims;
       for (Index d = 0; d < NumDimensions; ++d) in_dims[d] = d;
-      return TensorTupleReducerOp<
-        internal::ArgMinTupleReducer<Tuple<Index, CoeffReturnType> >,
+      return TensorPairReducerOp<
+        internal::ArgMinPairReducer<Pair<Index, CoeffReturnType> >,
         const array<Index, NumDimensions>,
-        const Derived>(derived(), internal::ArgMinTupleReducer<Tuple<Index, CoeffReturnType> >(), -1, in_dims);
+        const Derived>(derived(), internal::ArgMinPairReducer<Pair<Index, CoeffReturnType> >(), -1, in_dims);
     }
 
     EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
-    const TensorTupleReducerOp<
-      internal::ArgMaxTupleReducer<Tuple<Index, CoeffReturnType> >,
+    const TensorPairReducerOp<
+      internal::ArgMaxPairReducer<Pair<Index, CoeffReturnType> >,
       const array<Index, 1>, const Derived>
     argmax(const Index return_dim) const {
       array<Index, 1> in_dims;
       in_dims[0] = return_dim;
-      return TensorTupleReducerOp<
-        internal::ArgMaxTupleReducer<Tuple<Index, CoeffReturnType> >,
+      return TensorPairReducerOp<
+        internal::ArgMaxPairReducer<Pair<Index, CoeffReturnType> >,
         const array<Index, 1>,
-        const Derived>(derived(), internal::ArgMaxTupleReducer<Tuple<Index, CoeffReturnType> >(), return_dim, in_dims);
+        const Derived>(derived(), internal::ArgMaxPairReducer<Pair<Index, CoeffReturnType> >(), return_dim, in_dims);
     }
 
     EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
-    const TensorTupleReducerOp<
-      internal::ArgMinTupleReducer<Tuple<Index, CoeffReturnType> >,
+    const TensorPairReducerOp<
+      internal::ArgMinPairReducer<Pair<Index, CoeffReturnType> >,
       const array<Index, 1>, const Derived>
     argmin(const Index return_dim) const {
       array<Index, 1> in_dims;
       in_dims[0] = return_dim;
-      return TensorTupleReducerOp<
-        internal::ArgMinTupleReducer<Tuple<Index, CoeffReturnType> >,
+      return TensorPairReducerOp<
+        internal::ArgMinPairReducer<Pair<Index, CoeffReturnType> >,
         const array<Index, 1>,
-        const Derived>(derived(), internal::ArgMinTupleReducer<Tuple<Index, CoeffReturnType> >(), return_dim, in_dims);
+        const Derived>(derived(), internal::ArgMinPairReducer<Pair<Index, CoeffReturnType> >(), return_dim, in_dims);
     }
 
     template <typename Reducer, typename Dims> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
@@ -935,11 +935,11 @@
       return TensorInflationOp<const Strides, const Derived>(derived(), strides);
     }
 
-    // Returns a tensor containing index/value tuples
+    // Returns a tensor containing index/value pairs
     EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
-    const TensorIndexTupleOp<const Derived>
-    index_tuples() const {
-      return TensorIndexTupleOp<const Derived>(derived());
+    const TensorIndexPairOp<const Derived>
+    index_pairs() const {
+      return TensorIndexPairOp<const Derived>(derived());
     }
 
     // Support for custom unary and binary operations
@@ -960,6 +960,10 @@
       return TensorForcedEvalOp<const Derived>(derived());
     }
 
+    #ifdef EIGEN_READONLY_TENSORBASE_PLUGIN
+    #include EIGEN_READONLY_TENSORBASE_PLUGIN
+    #endif
+
   protected:
     template <typename Scalar, int NumIndices, int Options, typename IndexType> friend class Tensor;
     template <typename Scalar, typename Dimensions, int Option, typename IndexTypes> friend class TensorFixedSize;
@@ -1152,6 +1156,10 @@
       return TensorAsyncDevice<Derived, DeviceType, DoneCallback>(dev, derived(), std::move(done));
     }
 
+    #ifdef EIGEN_TENSORBASE_PLUGIN
+    #include EIGEN_TENSORBASE_PLUGIN
+    #endif
+
  protected:
     EIGEN_DEFAULT_EMPTY_CONSTRUCTOR_AND_DESTRUCTOR(TensorBase)
     EIGEN_DEFAULT_COPY_CONSTRUCTOR(TensorBase)
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorForwardDeclarations.h b/unsupported/Eigen/CXX11/src/Tensor/TensorForwardDeclarations.h
index 246ebe4..139384a 100644
--- a/unsupported/Eigen/CXX11/src/Tensor/TensorForwardDeclarations.h
+++ b/unsupported/Eigen/CXX11/src/Tensor/TensorForwardDeclarations.h
@@ -61,8 +61,8 @@
 template<typename TernaryOp, typename Arg1XprType, typename Arg2XprType, typename Arg3XprType> class TensorCwiseTernaryOp;
 template<typename IfXprType, typename ThenXprType, typename ElseXprType> class TensorSelectOp;
 template<typename Op, typename Dims, typename XprType, template <class> class MakePointer_ = MakePointer > class TensorReductionOp;
-template<typename XprType> class TensorIndexTupleOp;
-template<typename ReduceOp, typename Dims, typename XprType> class TensorTupleReducerOp;
+template<typename XprType> class TensorIndexPairOp;
+template<typename ReduceOp, typename Dims, typename XprType> class TensorPairReducerOp;
 template<typename Axis, typename LeftXprType, typename RightXprType> class TensorConcatenationOp;
 template<typename Dimensions, typename LeftXprType, typename RightXprType, typename OutputKernelType> class TensorContractionOp;
 template<typename TargetType, typename XprType> class TensorConversionOp;
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorFunctors.h b/unsupported/Eigen/CXX11/src/Tensor/TensorFunctors.h
index d963032..b99edd4 100644
--- a/unsupported/Eigen/CXX11/src/Tensor/TensorFunctors.h
+++ b/unsupported/Eigen/CXX11/src/Tensor/TensorFunctors.h
@@ -367,7 +367,7 @@
 
 // Argmin/Argmax reducers.  Returns the first occurrence if multiple locations
 // contain the same min/max value.
-template <typename T> struct ArgMaxTupleReducer
+template <typename T> struct ArgMaxPairReducer
 {
   EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void reduce(const T t, T* accum) const {
     if (t.second < accum->second) {
@@ -385,7 +385,7 @@
 };
 
 template <typename T, typename Device>
-struct reducer_traits<ArgMaxTupleReducer<T>, Device> {
+struct reducer_traits<ArgMaxPairReducer<T>, Device> {
   enum {
     Cost = NumTraits<T>::AddCost,
     PacketAccess = false,
@@ -395,7 +395,7 @@
 };
 
 
-template <typename T> struct ArgMinTupleReducer
+template <typename T> struct ArgMinPairReducer
 {
   EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void reduce(const T& t, T* accum) const {
     if (t.second > accum->second) {
@@ -413,7 +413,7 @@
 };
 
 template <typename T, typename Device>
-struct reducer_traits<ArgMinTupleReducer<T>, Device> {
+struct reducer_traits<ArgMinPairReducer<T>, Device> {
   enum {
     Cost = NumTraits<T>::AddCost,
     PacketAccess = false,
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorMeta.h b/unsupported/Eigen/CXX11/src/Tensor/TensorMeta.h
index a6181d3..e13ec09 100644
--- a/unsupported/Eigen/CXX11/src/Tensor/TensorMeta.h
+++ b/unsupported/Eigen/CXX11/src/Tensor/TensorMeta.h
@@ -52,7 +52,7 @@
 };
 
 // For CUDA packet types when using a GpuDevice
-#if defined(EIGEN_USE_GPU) && defined(EIGEN_HAS_GPU_FP16)
+#if defined(EIGEN_USE_GPU) && defined(EIGEN_HAS_GPU_FP16) && defined(EIGEN_GPU_COMPILE_PHASE)
 
 typedef ulonglong2 Packet4h2;
 template<>
@@ -207,9 +207,11 @@
 #endif
 #endif
 
-// Tuple mimics std::pair but works on e.g. nvcc.
-template <typename U, typename V> struct Tuple {
+// Pair mimics std::pair but works on e.g. nvcc.
+template <typename U, typename V> struct Pair {
  public:
+  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
+
   U first;
   V second;
 
@@ -217,13 +219,13 @@
   typedef V second_type;
 
   EIGEN_CONSTEXPR EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
-  Tuple() : first(), second() {}
+  Pair() : first(), second() {}
 
   EIGEN_CONSTEXPR EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
-  Tuple(const U& f, const V& s) : first(f), second(s) {}
+  Pair(const U& f, const V& s) : first(f), second(s) {}
 
   EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
-  void swap(Tuple& rhs) {
+  void swap(Pair& rhs) {
     using numext::swap;
     swap(first, rhs.first);
     swap(second, rhs.second);
@@ -232,13 +234,13 @@
 
 template <typename U, typename V>
 EIGEN_CONSTEXPR EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
-bool operator==(const Tuple<U, V>& x, const Tuple<U, V>& y) {
+bool operator==(const Pair<U, V>& x, const Pair<U, V>& y) {
   return (x.first == y.first && x.second == y.second);
 }
 
 template <typename U, typename V>
 EIGEN_CONSTEXPR EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
-bool operator!=(const Tuple<U, V>& x, const Tuple<U, V>& y) {
+bool operator!=(const Pair<U, V>& x, const Pair<U, V>& y) {
   return !(x == y);
 }
 
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorReductionGpu.h b/unsupported/Eigen/CXX11/src/Tensor/TensorReductionGpu.h
index db4e8d8..315ccc1 100644
--- a/unsupported/Eigen/CXX11/src/Tensor/TensorReductionGpu.h
+++ b/unsupported/Eigen/CXX11/src/Tensor/TensorReductionGpu.h
@@ -98,6 +98,7 @@
     }
   }
 }
+#ifdef EIGEN_GPU_COMPILE_PHASE
 // reduction should be associative since reduction is not atomic in wide vector but atomic in half2 operations
 template <typename R>
 __device__ inline void atomicReduce(Packet4h2* output, Packet4h2 accum, R& reducer) {
@@ -107,6 +108,7 @@
     atomicReduce(houtput+i,*(haccum+i),reducer);
   }
 }
+#endif  // EIGEN_GPU_COMPILE_PHASE
 #endif  // EIGEN_HAS_GPU_FP16
 
 template <>
@@ -213,8 +215,8 @@
 #ifdef EIGEN_HAS_GPU_FP16
 template <typename Self,
           typename Reducer, typename Index>
-__global__ EIGEN_HIP_LAUNCH_BOUNDS_1024 void ReductionInitFullReduxKernelHalfFloat(Reducer reducer, const Self input, Index num_coeffs,
-                                                      packet_traits<Eigen::half>::type* scratch) {
+__global__ EIGEN_HIP_LAUNCH_BOUNDS_1024 void ReductionInitFullReduxKernelHalfFloat(
+    Reducer reducer, const Self input, Index num_coeffs, half* scratch) {
   eigen_assert(blockDim.x == 1);
   eigen_assert(gridDim.x == 1);
   typedef packet_traits<Eigen::half>::type packet_type;
@@ -224,15 +226,16 @@
     half2* h2scratch = reinterpret_cast<half2*>(scratch);
     for (Index i = num_coeffs - packet_remainder; i + 2 <= num_coeffs; i += 2) {
       *h2scratch =
-          __halves2half2(input.m_impl.coeff(i), input.m_impl.coeff(i + 1));
+          __halves2half2(input.coeff(i), input.coeff(i + 1));
       h2scratch++;
     }
     if ((num_coeffs & 1) != 0) {
-      half lastCoeff = input.m_impl.coeff(num_coeffs - 1);
+      half lastCoeff = input.coeff(num_coeffs - 1);
       *h2scratch = __halves2half2(lastCoeff, reducer.initialize());
     }
   } else {
-    *scratch = reducer.template initializePacket<packet_type>();
+    packet_type reduce = reducer.template initializePacket<packet_type>();
+    internal::pstoreu(scratch, reduce);
   }
 }
 
@@ -258,8 +261,9 @@
 
 template <int BlockSize, int NumPerThread, typename Self,
           typename Reducer, typename Index>
-__global__ EIGEN_HIP_LAUNCH_BOUNDS_1024 void FullReductionKernelHalfFloat(Reducer reducer, const Self input, Index num_coeffs,
-                                    half* output, packet_traits<Eigen::half>::type* scratch) {
+__global__ EIGEN_HIP_LAUNCH_BOUNDS_1024 void FullReductionKernelHalfFloat(
+    Reducer reducer, const Self input, Index num_coeffs,
+    half* output, half* scratch) {
   typedef typename packet_traits<Eigen::half>::type PacketType;
   const int packet_width = unpacket_traits<PacketType>::size;
   eigen_assert(NumPerThread % packet_width == 0);
@@ -273,19 +277,20 @@
       int rem = num_coeffs % packet_width;
       if (rem != 0) {
         half2* p_scratch = reinterpret_cast<half2*>(scratch);
-        *scratch = reducer.template initializePacket<PacketType>();
+        pstoreu(scratch, reducer.template initializePacket<PacketType>());
         for (int i = 0; i < rem / 2; i++) {
           *p_scratch = __halves2half2(
-              input.m_impl.coeff(num_coeffs - packet_width + 2 * i),
-              input.m_impl.coeff(num_coeffs - packet_width + 2 * i + 1));
+              input.coeff(num_coeffs - packet_width + 2 * i),
+              input.coeff(num_coeffs - packet_width + 2 * i + 1));
           p_scratch++;
         }
         if ((num_coeffs & 1) != 0) {
-          half last = input.m_impl.coeff(num_coeffs - 1);
+          half last = input.coeff(num_coeffs - 1);
           *p_scratch = __halves2half2(last, reducer.initialize());
         }
       } else {
-        *scratch = reducer.template initializePacket<PacketType>();
+        PacketType reduce = reducer.template initializePacket<PacketType>();
+        pstoreu(scratch, reduce);
       }
     }
     __syncthreads();
@@ -298,7 +303,7 @@
   for (Index i = 0; i < max_iter; i += BlockSize) {
     const Index index = first_index + packet_width * i;
     eigen_assert(index + packet_width < num_coeffs);
-    PacketType val = input.m_impl.template packet<Unaligned>(index);
+    PacketType val = input.template packet<Unaligned>(index);
     reducer.reducePacket(val, &accum);
   }
 
@@ -337,7 +342,7 @@
   }
 
   if ((threadIdx.x & (warpSize - 1)) == 0) {
-    atomicReduce(scratch, accum, reducer);
+    atomicReduce(reinterpret_cast<PacketType*>(scratch), accum, reducer);
   }
 
   __syncthreads();
@@ -357,17 +362,21 @@
 }
 
 template <typename Op>
-__global__ EIGEN_HIP_LAUNCH_BOUNDS_1024 void ReductionCleanupKernelHalfFloat(Op reducer, half* output, packet_traits<Eigen::half>::type* scratch) {
+__global__ EIGEN_HIP_LAUNCH_BOUNDS_1024 void ReductionCleanupKernelHalfFloat(Op reducer, half* output, half* scratch) {
   eigen_assert(threadIdx.x == 1);
-  half2* pscratch = reinterpret_cast<half2*>(scratch);
-  half tmp = __float2half(0.f);
   typedef packet_traits<Eigen::half>::type packet_type;
-  for (int i = 0; i < unpacket_traits<packet_type>::size; i += 2) {
-    reducer.reduce(__low2half(*pscratch), &tmp);
-    reducer.reduce(__high2half(*pscratch), &tmp);
-    pscratch++;
+  if (unpacket_traits<packet_type>::size == 1) {
+    *output = *scratch;
+  } else {
+    half2* pscratch = reinterpret_cast<half2*>(scratch);
+    half tmp = __float2half(0.f);
+    for (int i = 0; i < unpacket_traits<packet_type>::size; i += 2) {
+      reducer.reduce(__low2half(*pscratch), &tmp);
+      reducer.reduce(__high2half(*pscratch), &tmp);
+      pscratch++;
+    }
+    *output = tmp;
   }
-  *output = tmp;
 }
 
 #endif // EIGEN_HAS_GPU_FP16
@@ -416,13 +425,11 @@
 struct FullReductionLauncher<Self, Op, Eigen::half, true> {
   static void run(const Self& self, Op& reducer, const GpuDevice& device, half* output, typename Self::Index num_coeffs) {
     typedef typename Self::Index Index;
-    typedef typename packet_traits<Eigen::half>::type PacketType;
 
     const int block_size = 256;
     const int num_per_thread = 128;
     const int num_blocks = divup<int>(num_coeffs, block_size * num_per_thread);
-    PacketType* scratch = static_cast<PacketType*>(device.scratchpad());
-    // half2* scratch = static_cast<half2*>(device.scratchpad());
+    half* scratch = static_cast<half*>(device.scratchpad());
 
     if (num_blocks > 1) {
       // We initialize the output and the scrathpad outside the reduction kernel when we can't be sure that there
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorTraits.h b/unsupported/Eigen/CXX11/src/Tensor/TensorTraits.h
index 4f7fd34..87dc418 100644
--- a/unsupported/Eigen/CXX11/src/Tensor/TensorTraits.h
+++ b/unsupported/Eigen/CXX11/src/Tensor/TensorTraits.h
@@ -122,16 +122,16 @@
 };
 
 
-template<typename _Scalar, int NumIndices_, int Options, typename IndexType_>
-struct eval<Tensor<_Scalar, NumIndices_, Options, IndexType_>, Eigen::Dense>
+template<typename Scalar_, int NumIndices_, int Options, typename IndexType_>
+struct eval<Tensor<Scalar_, NumIndices_, Options, IndexType_>, Eigen::Dense>
 {
-  typedef const Tensor<_Scalar, NumIndices_, Options, IndexType_>EIGEN_DEVICE_REF type;
+  typedef const Tensor<Scalar_, NumIndices_, Options, IndexType_>EIGEN_DEVICE_REF type;
 };
 
-template<typename _Scalar, int NumIndices_, int Options, typename IndexType_>
-struct eval<const Tensor<_Scalar, NumIndices_, Options, IndexType_>, Eigen::Dense>
+template<typename Scalar_, int NumIndices_, int Options, typename IndexType_>
+struct eval<const Tensor<Scalar_, NumIndices_, Options, IndexType_>, Eigen::Dense>
 {
-  typedef const Tensor<_Scalar, NumIndices_, Options, IndexType_>EIGEN_DEVICE_REF type;
+  typedef const Tensor<Scalar_, NumIndices_, Options, IndexType_>EIGEN_DEVICE_REF type;
 };
 
 template<typename Scalar_, typename Dimensions, int Options, typename IndexType_>
diff --git a/unsupported/Eigen/CXX11/src/TensorSymmetry/util/TemplateGroupTheory.h b/unsupported/Eigen/CXX11/src/TensorSymmetry/util/TemplateGroupTheory.h
index 54bf9db..61113fe 100644
--- a/unsupported/Eigen/CXX11/src/TensorSymmetry/util/TemplateGroupTheory.h
+++ b/unsupported/Eigen/CXX11/src/TensorSymmetry/util/TemplateGroupTheory.h
@@ -637,21 +637,21 @@
   * \tparam Equality      The equality check operation that checks if two group elements
   *                       are equal to another.
   * \tparam id            The identity element
-  * \tparam _generators   A list of (possibly redundant) generators of the group
+  * \tparam Generators_   A list of (possibly redundant) generators of the group
   */
 template<
   template<typename, typename> class Multiply,
   template<typename, typename> class Equality,
   typename id,
-  typename _generators
+  typename Generators_
 >
 struct enumerate_group_elements
   : public enumerate_group_elements_noid<
       Multiply,
       Equality,
       id,
-      typename strip_identities<Equality, id, _generators>::type,
-      strip_identities<Equality, id, _generators>::global_flags
+      typename strip_identities<Equality, id, Generators_>::type,
+      strip_identities<Equality, id, Generators_>::global_flags
     >
 {
 };
diff --git a/unsupported/Eigen/FFT b/unsupported/Eigen/FFT
index c8c311a..e16a7d9 100644
--- a/unsupported/Eigen/FFT
+++ b/unsupported/Eigen/FFT
@@ -203,11 +203,11 @@
     }
     */
 
-    template <typename _Input>
+    template <typename Input_>
     inline
-    void fwd( std::vector<Complex> & dst, const std::vector<_Input> & src) 
+    void fwd( std::vector<Complex> & dst, const std::vector<Input_> & src)
     {
-      if ( NumTraits<_Input>::IsComplex == 0 && HasFlag(HalfSpectrum) )
+      if ( NumTraits<Input_>::IsComplex == 0 && HasFlag(HalfSpectrum) )
         dst.resize( (src.size()>>1)+1); // half the bins + Nyquist bin
       else
         dst.resize(src.size());
@@ -343,12 +343,12 @@
       }
     }
 
-    template <typename _Output>
+    template <typename Output_>
     inline
-    void inv( std::vector<_Output> & dst, const std::vector<Complex> & src,Index nfft=-1)
+    void inv( std::vector<Output_> & dst, const std::vector<Complex> & src,Index nfft=-1)
     {
       if (nfft<1)
-        nfft = ( NumTraits<_Output>::IsComplex == 0 && HasFlag(HalfSpectrum) ) ? 2*(src.size()-1) : src.size();
+        nfft = ( NumTraits<Output_>::IsComplex == 0 && HasFlag(HalfSpectrum) ) ? 2*(src.size()-1) : src.size();
       dst.resize( nfft );
       inv( &dst[0],&src[0],nfft);
     }
diff --git a/unsupported/Eigen/IterativeSolvers b/unsupported/Eigen/IterativeSolvers
index 38e09fd..3db7902 100644
--- a/unsupported/Eigen/IterativeSolvers
+++ b/unsupported/Eigen/IterativeSolvers
@@ -16,7 +16,7 @@
 
 
 /**
-  * \defgroup IterativeLinearSolvers_Module Iterative solvers module
+  * \defgroup IterativeLinearSolvers_Module Iterative Solvers module
   * This module aims to provide various iterative linear and non linear solver algorithms.
   * It currently provides:
   *  - a constrained conjugate gradient
@@ -25,6 +25,50 @@
   *  - a DGMRES implementation
   *  - a MINRES implementation
   *
+  * Choosing the best solver for solving \c A \c x = \c b depends a lot on the preconditioner chosen as well as the properties of \c A. The following flowchart might help you.
+  * \dot width=50%
+  * digraph g {
+* node [ fontname=Arial, fontsize=11];
+* edge [ fontname=Helvetica, fontsize=10 ];
+*	A1[label="hermitian",shape="box"];
+* A2[label="positive definite",shape="box"];
+* CG[shape="plaintext"];
+* A3[label="ill conditioned",shape="box"];
+* A4[label="good preconditioner",shape="box"];
+* A5[label="flexible preconditioner",shape="box"];
+* A6[label="strongly indefinite",shape="box"];
+* A8[label="large imaginary eigenvalue",shape="box"];
+* A7[label="large imaginary eigenvalue",shape="box"];
+*
+* SYMMLQ[shape="plaintext"];
+* MINRES[shape="plaintext"];
+* GCR[shape="plaintext"];
+* GMRES[shape="plaintext"];
+* IDRSTABL[shape="plaintext"];
+* IDRS[shape="plaintext"];
+* BICGSTABL[shape="plaintext"];
+* BICGSTAB[shape="plaintext"];
+*	
+*	A1 -> A2 [label="yes"];
+*	A2 -> CG [label="yes"];
+*	A2 -> A3 [label="no"];
+*	A3 -> SYMMLQ [label="yes"];
+*	A3 -> MINRES [label="no"];
+*
+*	A1 -> A4 [label="no"];
+*	A4 -> A5 [label="yes"];
+*	A5 -> GCR [label="yes"];
+*	A5 -> GMRES [label="no"];
+*
+*	A4 -> A6 [label="no"];
+*	A6 -> A8 [label="yes"];
+*	A6 -> A7 [label="no"];
+*	A7 -> BICGSTABL [label="yes"];
+*	A7 -> BICGSTAB [label="no"];
+*	A8 -> IDRSTABL [label="yes"];
+*	A8 -> IDRS [label="no"];
+* }
+  * \enddot
   * \code
   * #include <unsupported/Eigen/IterativeSolvers>
   * \endcode
@@ -36,7 +80,6 @@
 #include "src/IterativeSolvers/IncompleteLU.h"
 #include "src/IterativeSolvers/GMRES.h"
 #include "src/IterativeSolvers/DGMRES.h"
-//#include "src/IterativeSolvers/SSORPreconditioner.h"
 #include "src/IterativeSolvers/MINRES.h"
 #include "src/IterativeSolvers/IDRS.h"
 
diff --git a/unsupported/Eigen/SparseExtra b/unsupported/Eigen/SparseExtra
index ba5cbd6..2fa8f9f 100644
--- a/unsupported/Eigen/SparseExtra
+++ b/unsupported/Eigen/SparseExtra
@@ -16,6 +16,7 @@
 
 #include <vector>
 #include <map>
+#include <unordered_map>
 #include <cstdlib>
 #include <cstring>
 #include <algorithm>
@@ -30,16 +31,16 @@
 /**
   * \defgroup SparseExtra_Module SparseExtra module
   *
-  * This module contains some experimental features extending the sparse module.
+  * This module contains some experimental features extending the sparse module:
+  * - A RandomSetter which is a wrapper object allowing to set/update a sparse matrix with random access.
+  * - MatrixMarket format(https://math.nist.gov/MatrixMarket/formats.html) readers and writers for sparse and dense matrices.
   *
   * \code
-  * #include <Eigen/SparseExtra>
+  * #include <unsupported/Eigen/SparseExtra>
   * \endcode
   */
 
 
-#include "src/SparseExtra/DynamicSparseMatrix.h"
-#include "src/SparseExtra/BlockOfDynamicSparseMatrix.h"
 #include "src/SparseExtra/RandomSetter.h"
 
 #include "src/SparseExtra/MarketIO.h"
diff --git a/unsupported/Eigen/src/BVH/KdBVH.h b/unsupported/Eigen/src/BVH/KdBVH.h
index 2d5b76a..034fec7 100644
--- a/unsupported/Eigen/src/BVH/KdBVH.h
+++ b/unsupported/Eigen/src/BVH/KdBVH.h
@@ -55,23 +55,23 @@
 /** \class KdBVH
  *  \brief A simple bounding volume hierarchy based on AlignedBox
  *
- *  \param _Scalar The underlying scalar type of the bounding boxes
- *  \param _Dim The dimension of the space in which the hierarchy lives
+ *  \param Scalar_ The underlying scalar type of the bounding boxes
+ *  \param Dim_ The dimension of the space in which the hierarchy lives
  *  \param _Object The object type that lives in the hierarchy.  It must have value semantics.  Either bounding_box(_Object) must
- *                 be defined and return an AlignedBox<_Scalar, _Dim> or bounding boxes must be provided to the tree initializer.
+ *                 be defined and return an AlignedBox<Scalar_, Dim_> or bounding boxes must be provided to the tree initializer.
  *
  *  This class provides a simple (as opposed to optimized) implementation of a bounding volume hierarchy analogous to a Kd-tree.
  *  Given a sequence of objects, it computes their bounding boxes, constructs a Kd-tree of their centers
  *  and builds a BVH with the structure of that Kd-tree.  When the elements of the tree are too expensive to be copied around,
  *  it is useful for _Object to be a pointer.
  */
-template<typename _Scalar, int _Dim, typename _Object> class KdBVH
+template<typename Scalar_, int Dim_, typename _Object> class KdBVH
 {
 public:
-  enum { Dim = _Dim };
+  enum { Dim = Dim_ };
   typedef _Object Object;
   typedef std::vector<Object, aligned_allocator<Object> > ObjectList;
-  typedef _Scalar Scalar;
+  typedef Scalar_ Scalar;
   typedef AlignedBox<Scalar, Dim> Volume;
   typedef std::vector<Volume, aligned_allocator<Volume> > VolumeList;
   typedef int Index;
diff --git a/unsupported/Eigen/src/EulerAngles/EulerAngles.h b/unsupported/Eigen/src/EulerAngles/EulerAngles.h
index e43cdb7..7f4535d 100644
--- a/unsupported/Eigen/src/EulerAngles/EulerAngles.h
+++ b/unsupported/Eigen/src/EulerAngles/EulerAngles.h
@@ -92,18 +92,18 @@
     *
     * More information about Euler angles: https://en.wikipedia.org/wiki/Euler_angles
     *
-    * \tparam _Scalar the scalar type, i.e. the type of the angles.
+    * \tparam Scalar_ the scalar type, i.e. the type of the angles.
     *
     * \tparam _System the EulerSystem to use, which represents the axes of rotation.
     */
-  template <typename _Scalar, class _System>
-  class EulerAngles : public RotationBase<EulerAngles<_Scalar, _System>, 3>
+  template <typename Scalar_, class _System>
+  class EulerAngles : public RotationBase<EulerAngles<Scalar_, _System>, 3>
   {
     public:
-      typedef RotationBase<EulerAngles<_Scalar, _System>, 3> Base;
+      typedef RotationBase<EulerAngles<Scalar_, _System>, 3> Base;
       
       /** the scalar type of the angles */
-      typedef _Scalar Scalar;
+      typedef Scalar_ Scalar;
       typedef typename NumTraits<Scalar>::Real RealScalar;
       
       /** the EulerSystem to use, which represents the axes of rotation. */
@@ -322,10 +322,10 @@
 
   namespace internal
   {
-    template<typename _Scalar, class _System>
-    struct traits<EulerAngles<_Scalar, _System> >
+    template<typename Scalar_, class _System>
+    struct traits<EulerAngles<Scalar_, _System> >
     {
-      typedef _Scalar Scalar;
+      typedef Scalar_ Scalar;
     };
     
     // set from a rotation matrix
diff --git a/unsupported/Eigen/src/EulerAngles/EulerSystem.h b/unsupported/Eigen/src/EulerAngles/EulerSystem.h
index 2a833b0..3b06d01 100644
--- a/unsupported/Eigen/src/EulerAngles/EulerSystem.h
+++ b/unsupported/Eigen/src/EulerAngles/EulerSystem.h
@@ -13,7 +13,7 @@
 namespace Eigen
 {
   // Forward declarations
-  template <typename _Scalar, class _System>
+  template <typename Scalar_, class _System>
   class EulerAngles;
   
   namespace internal
@@ -272,7 +272,7 @@
         res.gamma() = -res.gamma();
     }
     
-    template <typename _Scalar, class _System>
+    template <typename Scalar_, class _System>
     friend class Eigen::EulerAngles;
     
     template<typename System,
diff --git a/unsupported/Eigen/src/FFT/ei_fftw_impl.h b/unsupported/Eigen/src/FFT/ei_fftw_impl.h
index 1c2cd24..b9e760b 100644
--- a/unsupported/Eigen/src/FFT/ei_fftw_impl.h
+++ b/unsupported/Eigen/src/FFT/ei_fftw_impl.h
@@ -173,10 +173,10 @@
       }
   };
 
-  template <typename _Scalar>
+  template <typename Scalar_>
   struct fftw_impl
   {
-      typedef _Scalar Scalar;
+      typedef Scalar_ Scalar;
       typedef std::complex<Scalar> Complex;
 
       inline
diff --git a/unsupported/Eigen/src/FFT/ei_kissfft_impl.h b/unsupported/Eigen/src/FFT/ei_kissfft_impl.h
index 430953a..bcecb63 100644
--- a/unsupported/Eigen/src/FFT/ei_kissfft_impl.h
+++ b/unsupported/Eigen/src/FFT/ei_kissfft_impl.h
@@ -14,10 +14,10 @@
   // This FFT implementation was derived from kissfft http:sourceforge.net/projects/kissfft
   // Copyright 2003-2009 Mark Borgerding
 
-template <typename _Scalar>
+template <typename Scalar_>
 struct kiss_cpx_fft
 {
-  typedef _Scalar Scalar;
+  typedef Scalar_ Scalar;
   typedef std::complex<Scalar> Complex;
   std::vector<Complex> m_twiddles;
   std::vector<int> m_stageRadix;
@@ -90,9 +90,9 @@
     }while(n>1);
   }
 
-  template <typename _Src>
+  template <typename Src_>
     inline
-    void work( int stage,Complex * xout, const _Src * xin, size_t fstride,size_t in_stride)
+    void work( int stage,Complex * xout, const Src_ * xin, size_t fstride,size_t in_stride)
     {
       int p = m_stageRadix[stage];
       int m = m_stageRemainder[stage];
@@ -292,10 +292,10 @@
     }
 };
 
-template <typename _Scalar>
+template <typename Scalar_>
 struct kissfft_impl
 {
-  typedef _Scalar Scalar;
+  typedef Scalar_ Scalar;
   typedef std::complex<Scalar> Complex;
 
   void clear() 
diff --git a/unsupported/Eigen/src/IterativeSolvers/DGMRES.h b/unsupported/Eigen/src/IterativeSolvers/DGMRES.h
index 5ae011b..9114b16 100644
--- a/unsupported/Eigen/src/IterativeSolvers/DGMRES.h
+++ b/unsupported/Eigen/src/IterativeSolvers/DGMRES.h
@@ -14,17 +14,17 @@
 
 namespace Eigen { 
   
-template< typename _MatrixType,
-          typename _Preconditioner = DiagonalPreconditioner<typename _MatrixType::Scalar> >
+template< typename MatrixType_,
+          typename Preconditioner_ = DiagonalPreconditioner<typename MatrixType_::Scalar> >
 class DGMRES;
 
 namespace internal {
 
-template< typename _MatrixType, typename _Preconditioner>
-struct traits<DGMRES<_MatrixType,_Preconditioner> >
+template< typename MatrixType_, typename Preconditioner_>
+struct traits<DGMRES<MatrixType_,Preconditioner_> >
 {
-  typedef _MatrixType MatrixType;
-  typedef _Preconditioner Preconditioner;
+  typedef MatrixType_ MatrixType;
+  typedef Preconditioner_ Preconditioner;
 };
 
 /** \brief Computes a permutation vector to have a sorted sequence
@@ -68,8 +68,8 @@
  * the IncompleteLUT for instance. The preconditioner is applied 
  * at right of the matrix and the combination is multiplicative.
  * 
- * \tparam _MatrixType the type of the sparse matrix A, can be a dense or a sparse matrix.
- * \tparam _Preconditioner the type of the preconditioner. Default is DiagonalPreconditioner
+ * \tparam MatrixType_ the type of the sparse matrix A, can be a dense or a sparse matrix.
+ * \tparam Preconditioner_ the type of the preconditioner. Default is DiagonalPreconditioner
  * Typical usage :
  * \code
  * SparseMatrix<double> A;
@@ -97,8 +97,8 @@
 
  * 
  */
-template< typename _MatrixType, typename _Preconditioner>
-class DGMRES : public IterativeSolverBase<DGMRES<_MatrixType,_Preconditioner> >
+template< typename MatrixType_, typename Preconditioner_>
+class DGMRES : public IterativeSolverBase<DGMRES<MatrixType_,Preconditioner_> >
 {
     typedef IterativeSolverBase<DGMRES> Base;
     using Base::matrix;
@@ -110,11 +110,11 @@
   public:
     using Base::_solve_impl;
     using Base::_solve_with_guess_impl;
-    typedef _MatrixType MatrixType;
+    typedef MatrixType_ MatrixType;
     typedef typename MatrixType::Scalar Scalar;
     typedef typename MatrixType::StorageIndex StorageIndex;
     typedef typename MatrixType::RealScalar RealScalar;
-    typedef _Preconditioner Preconditioner;
+    typedef Preconditioner_ Preconditioner;
     typedef Matrix<Scalar,Dynamic,Dynamic> DenseMatrix; 
     typedef Matrix<RealScalar,Dynamic,Dynamic> DenseRealMatrix; 
     typedef Matrix<Scalar,Dynamic,1> DenseVector;
@@ -223,9 +223,9 @@
  * A right preconditioner is used combined with deflation.
  * 
  */
-template< typename _MatrixType, typename _Preconditioner>
+template< typename MatrixType_, typename Preconditioner_>
 template<typename Rhs, typename Dest>
-void DGMRES<_MatrixType, _Preconditioner>::dgmres(const MatrixType& mat,const Rhs& rhs, Dest& x,
+void DGMRES<MatrixType_, Preconditioner_>::dgmres(const MatrixType& mat,const Rhs& rhs, Dest& x,
               const Preconditioner& precond) const
 {
   const RealScalar considerAsZero = (std::numeric_limits<RealScalar>::min)();
@@ -281,9 +281,9 @@
  * \param normRhs The norm of the right hand side vector
  * \param nbIts The number of iterations
  */
-template< typename _MatrixType, typename _Preconditioner>
+template< typename MatrixType_, typename Preconditioner_>
 template<typename Dest>
-Index DGMRES<_MatrixType, _Preconditioner>::dgmresCycle(const MatrixType& mat, const Preconditioner& precond, Dest& x, DenseVector& r0, RealScalar& beta, const RealScalar& normRhs, Index& nbIts) const
+Index DGMRES<MatrixType_, Preconditioner_>::dgmresCycle(const MatrixType& mat, const Preconditioner& precond, Dest& x, DenseVector& r0, RealScalar& beta, const RealScalar& normRhs, Index& nbIts) const
 {
   //Initialization 
   DenseVector g(m_restart+1); // Right hand side of the least square problem
@@ -374,8 +374,8 @@
 }
 
 
-template< typename _MatrixType, typename _Preconditioner>
-void DGMRES<_MatrixType, _Preconditioner>::dgmresInitDeflation(Index& rows) const
+template< typename MatrixType_, typename Preconditioner_>
+void DGMRES<MatrixType_, Preconditioner_>::dgmresInitDeflation(Index& rows) const
 {
   m_U.resize(rows, m_maxNeig);
   m_MU.resize(rows, m_maxNeig); 
@@ -384,14 +384,14 @@
   m_isDeflAllocated = true; 
 }
 
-template< typename _MatrixType, typename _Preconditioner>
-inline typename DGMRES<_MatrixType, _Preconditioner>::ComplexVector DGMRES<_MatrixType, _Preconditioner>::schurValues(const ComplexSchur<DenseMatrix>& schurofH) const
+template< typename MatrixType_, typename Preconditioner_>
+inline typename DGMRES<MatrixType_, Preconditioner_>::ComplexVector DGMRES<MatrixType_, Preconditioner_>::schurValues(const ComplexSchur<DenseMatrix>& schurofH) const
 {
   return schurofH.matrixT().diagonal();
 }
 
-template< typename _MatrixType, typename _Preconditioner>
-inline typename DGMRES<_MatrixType, _Preconditioner>::ComplexVector DGMRES<_MatrixType, _Preconditioner>::schurValues(const RealSchur<DenseMatrix>& schurofH) const
+template< typename MatrixType_, typename Preconditioner_>
+inline typename DGMRES<MatrixType_, Preconditioner_>::ComplexVector DGMRES<MatrixType_, Preconditioner_>::schurValues(const RealSchur<DenseMatrix>& schurofH) const
 {
   const DenseMatrix& T = schurofH.matrixT();
   Index it = T.rows();
@@ -415,8 +415,8 @@
   return eig;
 }
 
-template< typename _MatrixType, typename _Preconditioner>
-Index DGMRES<_MatrixType, _Preconditioner>::dgmresComputeDeflationData(const MatrixType& mat, const Preconditioner& precond, const Index& it, StorageIndex& neig) const
+template< typename MatrixType_, typename Preconditioner_>
+Index DGMRES<MatrixType_, Preconditioner_>::dgmresComputeDeflationData(const MatrixType& mat, const Preconditioner& precond, const Index& it, StorageIndex& neig) const
 {
   // First, find the Schur form of the Hessenberg matrix H
   typename internal::conditional<NumTraits<Scalar>::IsComplex, ComplexSchur<DenseMatrix>, RealSchur<DenseMatrix> >::type schurofH; 
@@ -498,9 +498,9 @@
   m_isDeflInitialized = true;
   return 0; 
 }
-template<typename _MatrixType, typename _Preconditioner>
+template<typename MatrixType_, typename Preconditioner_>
 template<typename RhsType, typename DestType>
-Index DGMRES<_MatrixType, _Preconditioner>::dgmresApplyDeflation(const RhsType &x, DestType &y) const
+Index DGMRES<MatrixType_, Preconditioner_>::dgmresApplyDeflation(const RhsType &x, DestType &y) const
 {
   DenseVector x1 = m_U.leftCols(m_r).transpose() * x; 
   y = x + m_U.leftCols(m_r) * ( m_lambdaN * m_luT.solve(x1) - x1);
diff --git a/unsupported/Eigen/src/IterativeSolvers/GMRES.h b/unsupported/Eigen/src/IterativeSolvers/GMRES.h
index ff91209..4bd5904 100644
--- a/unsupported/Eigen/src/IterativeSolvers/GMRES.h
+++ b/unsupported/Eigen/src/IterativeSolvers/GMRES.h
@@ -216,17 +216,17 @@
 
 }
 
-template< typename _MatrixType,
-          typename _Preconditioner = DiagonalPreconditioner<typename _MatrixType::Scalar> >
+template< typename MatrixType_,
+          typename Preconditioner_ = DiagonalPreconditioner<typename MatrixType_::Scalar> >
 class GMRES;
 
 namespace internal {
 
-template< typename _MatrixType, typename _Preconditioner>
-struct traits<GMRES<_MatrixType,_Preconditioner> >
+template< typename MatrixType_, typename Preconditioner_>
+struct traits<GMRES<MatrixType_,Preconditioner_> >
 {
-  typedef _MatrixType MatrixType;
-  typedef _Preconditioner Preconditioner;
+  typedef MatrixType_ MatrixType;
+  typedef Preconditioner_ Preconditioner;
 };
 
 }
@@ -237,8 +237,8 @@
   * This class allows to solve for A.x = b sparse linear problems using a generalized minimal
   * residual method. The vectors x and b can be either dense or sparse.
   *
-  * \tparam _MatrixType the type of the sparse matrix A, can be a dense or a sparse matrix.
-  * \tparam _Preconditioner the type of the preconditioner. Default is DiagonalPreconditioner
+  * \tparam MatrixType_ the type of the sparse matrix A, can be a dense or a sparse matrix.
+  * \tparam Preconditioner_ the type of the preconditioner. Default is DiagonalPreconditioner
   *
   * The maximal number of iterations and tolerance value can be controlled via the setMaxIterations()
   * and setTolerance() methods. The defaults are the size of the problem for the maximal number of iterations
@@ -265,8 +265,8 @@
   *
   * \sa class SimplicialCholesky, DiagonalPreconditioner, IdentityPreconditioner
   */
-template< typename _MatrixType, typename _Preconditioner>
-class GMRES : public IterativeSolverBase<GMRES<_MatrixType,_Preconditioner> >
+template< typename MatrixType_, typename Preconditioner_>
+class GMRES : public IterativeSolverBase<GMRES<MatrixType_,Preconditioner_> >
 {
   typedef IterativeSolverBase<GMRES> Base;
   using Base::matrix;
@@ -280,10 +280,10 @@
 
 public:
   using Base::_solve_impl;
-  typedef _MatrixType MatrixType;
+  typedef MatrixType_ MatrixType;
   typedef typename MatrixType::Scalar Scalar;
   typedef typename MatrixType::RealScalar RealScalar;
-  typedef _Preconditioner Preconditioner;
+  typedef Preconditioner_ Preconditioner;
 
 public:
 
diff --git a/unsupported/Eigen/src/IterativeSolvers/IDRS.h b/unsupported/Eigen/src/IterativeSolvers/IDRS.h
index 90d20fa..5d62439 100755
--- a/unsupported/Eigen/src/IterativeSolvers/IDRS.h
+++ b/unsupported/Eigen/src/IterativeSolvers/IDRS.h
@@ -271,17 +271,17 @@
 
 	}  // namespace internal
 
-	template <typename _MatrixType, typename _Preconditioner = DiagonalPreconditioner<typename _MatrixType::Scalar> >
+	template <typename MatrixType_, typename Preconditioner_ = DiagonalPreconditioner<typename MatrixType_::Scalar> >
 	class IDRS;
 
 	namespace internal
 	{
 
-		template <typename _MatrixType, typename _Preconditioner>
-		struct traits<Eigen::IDRS<_MatrixType, _Preconditioner> >
+		template <typename MatrixType_, typename Preconditioner_>
+		struct traits<Eigen::IDRS<MatrixType_, Preconditioner_> >
 		{
-			typedef _MatrixType MatrixType;
-			typedef _Preconditioner Preconditioner;
+			typedef MatrixType_ MatrixType;
+			typedef Preconditioner_ Preconditioner;
 		};
 
 	}  // namespace internal
@@ -305,8 +305,8 @@
   * and uses 7 vectors. GMRES terminates in at most N iterations, and uses I+3 vectors, with I the number of iterations. 
   * Restarting GMRES limits the memory consumption, but destroys the finite termination property.
   *
-  * \tparam _MatrixType the type of the sparse matrix A, can be a dense or a sparse matrix.
-  * \tparam _Preconditioner the type of the preconditioner. Default is DiagonalPreconditioner
+  * \tparam MatrixType_ the type of the sparse matrix A, can be a dense or a sparse matrix.
+  * \tparam Preconditioner_ the type of the preconditioner. Default is DiagonalPreconditioner
   *
   * \implsparsesolverconcept
   *
@@ -327,15 +327,15 @@
   *
   * \sa class SimplicialCholesky, DiagonalPreconditioner, IdentityPreconditioner
   */
-	template <typename _MatrixType, typename _Preconditioner>
-	class IDRS : public IterativeSolverBase<IDRS<_MatrixType, _Preconditioner> >
+	template <typename MatrixType_, typename Preconditioner_>
+	class IDRS : public IterativeSolverBase<IDRS<MatrixType_, Preconditioner_> >
 	{
 
 		public:
-			typedef _MatrixType MatrixType;
+			typedef MatrixType_ MatrixType;
 			typedef typename MatrixType::Scalar Scalar;
 			typedef typename MatrixType::RealScalar RealScalar;
-			typedef _Preconditioner Preconditioner;
+			typedef Preconditioner_ Preconditioner;
 
 		private:
 			typedef IterativeSolverBase<IDRS> Base;
diff --git a/unsupported/Eigen/src/IterativeSolvers/IncompleteLU.h b/unsupported/Eigen/src/IterativeSolvers/IncompleteLU.h
index 7d08c35..c528aa8 100644
--- a/unsupported/Eigen/src/IterativeSolvers/IncompleteLU.h
+++ b/unsupported/Eigen/src/IterativeSolvers/IncompleteLU.h
@@ -12,14 +12,14 @@
 
 namespace Eigen { 
 
-template <typename _Scalar>
-class IncompleteLU : public SparseSolverBase<IncompleteLU<_Scalar> >
+template <typename Scalar_>
+class IncompleteLU : public SparseSolverBase<IncompleteLU<Scalar_> >
 {
   protected:
-    typedef SparseSolverBase<IncompleteLU<_Scalar> > Base;
+    typedef SparseSolverBase<IncompleteLU<Scalar_> > Base;
     using Base::m_isInitialized;
     
-    typedef _Scalar Scalar;
+    typedef Scalar_ Scalar;
     typedef Matrix<Scalar,Dynamic,1> Vector;
     typedef typename Vector::Index Index;
     typedef SparseMatrix<Scalar,RowMajor> FactorType;
diff --git a/unsupported/Eigen/src/IterativeSolvers/MINRES.h b/unsupported/Eigen/src/IterativeSolvers/MINRES.h
index 5db454d..f36c2c0 100644
--- a/unsupported/Eigen/src/IterativeSolvers/MINRES.h
+++ b/unsupported/Eigen/src/IterativeSolvers/MINRES.h
@@ -138,17 +138,17 @@
         
     }
     
-    template< typename _MatrixType, int _UpLo=Lower,
-    typename _Preconditioner = IdentityPreconditioner>
+    template< typename MatrixType_, int UpLo_=Lower,
+    typename Preconditioner_ = IdentityPreconditioner>
     class MINRES;
     
     namespace internal {
         
-        template< typename _MatrixType, int _UpLo, typename _Preconditioner>
-        struct traits<MINRES<_MatrixType,_UpLo,_Preconditioner> >
+        template< typename MatrixType_, int UpLo_, typename Preconditioner_>
+        struct traits<MINRES<MatrixType_,UpLo_,Preconditioner_> >
         {
-            typedef _MatrixType MatrixType;
-            typedef _Preconditioner Preconditioner;
+            typedef MatrixType_ MatrixType;
+            typedef Preconditioner_ Preconditioner;
         };
         
     }
@@ -160,10 +160,10 @@
      * of Paige and Saunders (1975). The sparse matrix A must be symmetric (possibly indefinite).
      * The vectors x and b can be either dense or sparse.
      *
-     * \tparam _MatrixType the type of the sparse matrix A, can be a dense or a sparse matrix.
-     * \tparam _UpLo the triangular part that will be used for the computations. It can be Lower,
+     * \tparam MatrixType_ the type of the sparse matrix A, can be a dense or a sparse matrix.
+     * \tparam UpLo_ the triangular part that will be used for the computations. It can be Lower,
      *               Upper, or Lower|Upper in which the full matrix entries will be considered. Default is Lower.
-     * \tparam _Preconditioner the type of the preconditioner. Default is DiagonalPreconditioner
+     * \tparam Preconditioner_ the type of the preconditioner. Default is DiagonalPreconditioner
      *
      * The maximal number of iterations and tolerance value can be controlled via the setMaxIterations()
      * and setTolerance() methods. The defaults are the size of the problem for the maximal number of iterations
@@ -191,8 +191,8 @@
      *
      * \sa class ConjugateGradient, BiCGSTAB, SimplicialCholesky, DiagonalPreconditioner, IdentityPreconditioner
      */
-    template< typename _MatrixType, int _UpLo, typename _Preconditioner>
-    class MINRES : public IterativeSolverBase<MINRES<_MatrixType,_UpLo,_Preconditioner> >
+    template< typename MatrixType_, int UpLo_, typename Preconditioner_>
+    class MINRES : public IterativeSolverBase<MINRES<MatrixType_,UpLo_,Preconditioner_> >
     {
         
         typedef IterativeSolverBase<MINRES> Base;
@@ -203,12 +203,12 @@
         using Base::m_isInitialized;
     public:
         using Base::_solve_impl;
-        typedef _MatrixType MatrixType;
+        typedef MatrixType_ MatrixType;
         typedef typename MatrixType::Scalar Scalar;
         typedef typename MatrixType::RealScalar RealScalar;
-        typedef _Preconditioner Preconditioner;
+        typedef Preconditioner_ Preconditioner;
         
-        enum {UpLo = _UpLo};
+        enum {UpLo = UpLo_};
         
     public:
         
diff --git a/unsupported/Eigen/src/IterativeSolvers/Scaling.h b/unsupported/Eigen/src/IterativeSolvers/Scaling.h
index 9b3eb53..848f572 100644
--- a/unsupported/Eigen/src/IterativeSolvers/Scaling.h
+++ b/unsupported/Eigen/src/IterativeSolvers/Scaling.h
@@ -38,17 +38,17 @@
   * x = scal.RightScaling().cwiseProduct(x); 
   * \endcode
   * 
-  * \tparam _MatrixType the type of the matrix. It should be a real square sparsematrix
+  * \tparam MatrixType_ the type of the matrix. It should be a real square sparsematrix
   * 
   * References : D. Ruiz and B. Ucar, A Symmetry Preserving Algorithm for Matrix Scaling, INRIA Research report RR-7552
   * 
   * \sa \ref IncompleteLUT 
   */
-template<typename _MatrixType>
+template<typename MatrixType_>
 class IterScaling
 {
   public:
-    typedef _MatrixType MatrixType; 
+    typedef MatrixType_ MatrixType;
     typedef typename MatrixType::Scalar Scalar;
     typedef typename MatrixType::Index Index;
     
diff --git a/unsupported/Eigen/src/KroneckerProduct/KroneckerTensorProduct.h b/unsupported/Eigen/src/KroneckerProduct/KroneckerTensorProduct.h
index 6a9b0be..c14ca0c 100644
--- a/unsupported/Eigen/src/KroneckerProduct/KroneckerTensorProduct.h
+++ b/unsupported/Eigen/src/KroneckerProduct/KroneckerTensorProduct.h
@@ -198,11 +198,11 @@
 
 namespace internal {
 
-template<typename _Lhs, typename _Rhs>
-struct traits<KroneckerProduct<_Lhs,_Rhs> >
+template<typename Lhs_, typename Rhs_>
+struct traits<KroneckerProduct<Lhs_,Rhs_> >
 {
-  typedef typename remove_all<_Lhs>::type Lhs;
-  typedef typename remove_all<_Rhs>::type Rhs;
+  typedef typename remove_all<Lhs_>::type Lhs;
+  typedef typename remove_all<Rhs_>::type Rhs;
   typedef typename ScalarBinaryOpTraits<typename Lhs::Scalar, typename Rhs::Scalar>::ReturnType Scalar;
   typedef typename promote_index_type<typename Lhs::StorageIndex, typename Rhs::StorageIndex>::type StorageIndex;
 
@@ -216,12 +216,12 @@
   typedef Matrix<Scalar,Rows,Cols> ReturnType;
 };
 
-template<typename _Lhs, typename _Rhs>
-struct traits<KroneckerProductSparse<_Lhs,_Rhs> >
+template<typename Lhs_, typename Rhs_>
+struct traits<KroneckerProductSparse<Lhs_,Rhs_> >
 {
   typedef MatrixXpr XprKind;
-  typedef typename remove_all<_Lhs>::type Lhs;
-  typedef typename remove_all<_Rhs>::type Rhs;
+  typedef typename remove_all<Lhs_>::type Lhs;
+  typedef typename remove_all<Rhs_>::type Rhs;
   typedef typename ScalarBinaryOpTraits<typename Lhs::Scalar, typename Rhs::Scalar>::ReturnType Scalar;
   typedef typename cwise_promote_storage_type<typename traits<Lhs>::StorageKind, typename traits<Rhs>::StorageKind, scalar_product_op<typename Lhs::Scalar, typename Rhs::Scalar> >::ret StorageKind;
   typedef typename promote_index_type<typename Lhs::StorageIndex, typename Rhs::StorageIndex>::type StorageIndex;
diff --git a/unsupported/Eigen/src/LevenbergMarquardt/LMqrsolv.h b/unsupported/Eigen/src/LevenbergMarquardt/LMqrsolv.h
index 1234858..bbf6ac1 100644
--- a/unsupported/Eigen/src/LevenbergMarquardt/LMqrsolv.h
+++ b/unsupported/Eigen/src/LevenbergMarquardt/LMqrsolv.h
@@ -98,9 +98,9 @@
     x = iPerm * wa; 
 }
 
-template <typename Scalar, int _Options, typename Index>
+template <typename Scalar, int Options_, typename Index>
 void lmqrsolv(
-  SparseMatrix<Scalar,_Options,Index> &s,
+  SparseMatrix<Scalar,Options_,Index> &s,
   const PermutationMatrix<Dynamic,Dynamic> &iPerm,
   const Matrix<Scalar,Dynamic,1> &diag,
   const Matrix<Scalar,Dynamic,1> &qtb,
diff --git a/unsupported/Eigen/src/LevenbergMarquardt/LevenbergMarquardt.h b/unsupported/Eigen/src/LevenbergMarquardt/LevenbergMarquardt.h
index 62561da..ac004f5 100644
--- a/unsupported/Eigen/src/LevenbergMarquardt/LevenbergMarquardt.h
+++ b/unsupported/Eigen/src/LevenbergMarquardt/LevenbergMarquardt.h
@@ -38,10 +38,10 @@
     };
 }
 
-template <typename _Scalar, int NX=Dynamic, int NY=Dynamic>
+template <typename Scalar_, int NX=Dynamic, int NY=Dynamic>
 struct DenseFunctor
 {
-  typedef _Scalar Scalar;
+  typedef Scalar_ Scalar;
   enum {
     InputsAtCompileTime = NX,
     ValuesAtCompileTime = NY
@@ -65,11 +65,11 @@
   // should be defined in derived classes
 };
 
-template <typename _Scalar, typename _Index>
+template <typename Scalar_, typename Index_>
 struct SparseFunctor
 {
-  typedef _Scalar Scalar;
-  typedef _Index Index;
+  typedef Scalar_ Scalar;
+  typedef Index_ Index;
   typedef Matrix<Scalar,Dynamic,1> InputType;
   typedef Matrix<Scalar,Dynamic,1> ValueType;
   typedef SparseMatrix<Scalar, ColMajor, Index> JacobianType;
@@ -106,11 +106,11 @@
   * Check wikipedia for more information.
   * http://en.wikipedia.org/wiki/Levenberg%E2%80%93Marquardt_algorithm
   */
-template<typename _FunctorType>
+template<typename FunctorType_>
 class LevenbergMarquardt : internal::no_assignment_operator
 {
   public:
-    typedef _FunctorType FunctorType;
+    typedef FunctorType_ FunctorType;
     typedef typename FunctorType::QRSolver QRSolver;
     typedef typename FunctorType::JacobianType JacobianType;
     typedef typename JacobianType::Scalar Scalar;
diff --git a/unsupported/Eigen/src/NumericalDiff/NumericalDiff.h b/unsupported/Eigen/src/NumericalDiff/NumericalDiff.h
index ea5d8bc..796d0bc 100644
--- a/unsupported/Eigen/src/NumericalDiff/NumericalDiff.h
+++ b/unsupported/Eigen/src/NumericalDiff/NumericalDiff.h
@@ -32,11 +32,11 @@
   *
   * Currently only "Forward" and "Central" scheme are implemented.
   */
-template<typename _Functor, NumericalDiffMode mode=Forward>
-class NumericalDiff : public _Functor
+template<typename Functor_, NumericalDiffMode mode=Forward>
+class NumericalDiff : public Functor_
 {
 public:
-    typedef _Functor Functor;
+    typedef Functor_ Functor;
     typedef typename Functor::Scalar Scalar;
     typedef typename Functor::InputType InputType;
     typedef typename Functor::ValueType ValueType;
diff --git a/unsupported/Eigen/src/Polynomials/Companion.h b/unsupported/Eigen/src/Polynomials/Companion.h
index 59a15b0..3c9a164 100644
--- a/unsupported/Eigen/src/Polynomials/Companion.h
+++ b/unsupported/Eigen/src/Polynomials/Companion.h
@@ -29,18 +29,18 @@
 
 #endif
 
-template< typename _Scalar, int _Deg >
+template< typename Scalar_, int _Deg >
 class companion
 {
   public:
-    EIGEN_MAKE_ALIGNED_OPERATOR_NEW_IF_VECTORIZABLE_FIXED_SIZE(_Scalar,_Deg==Dynamic ? Dynamic : _Deg)
+    EIGEN_MAKE_ALIGNED_OPERATOR_NEW_IF_VECTORIZABLE_FIXED_SIZE(Scalar_,_Deg==Dynamic ? Dynamic : _Deg)
 
     enum {
       Deg = _Deg,
       Deg_1=decrement_if_fixed_size<Deg>::ret
     };
 
-    typedef _Scalar                                Scalar;
+    typedef Scalar_                                Scalar;
     typedef typename NumTraits<Scalar>::Real       RealScalar;
     typedef Matrix<Scalar, Deg, 1>                 RightColumn;
     //typedef DiagonalMatrix< Scalar, Deg_1, Deg_1 > BottomLeftDiagonal;
@@ -54,7 +54,7 @@
     typedef DenseIndex Index;
 
   public:
-    EIGEN_STRONG_INLINE const _Scalar operator()(Index row, Index col ) const
+    EIGEN_STRONG_INLINE const Scalar_ operator()(Index row, Index col ) const
     {
       if( m_bl_diag.rows() > col )
       {
@@ -130,9 +130,9 @@
 
 
 
-template< typename _Scalar, int _Deg >
+template< typename Scalar_, int _Deg >
 inline
-bool companion<_Scalar,_Deg>::balanced( RealScalar colNorm, RealScalar rowNorm,
+bool companion<Scalar_,_Deg>::balanced( RealScalar colNorm, RealScalar rowNorm,
     bool& isBalanced, RealScalar& colB, RealScalar& rowB )
 {
   if( RealScalar(0) == colNorm || RealScalar(0) == rowNorm 
@@ -184,9 +184,9 @@
   }
 }
 
-template< typename _Scalar, int _Deg >
+template< typename Scalar_, int _Deg >
 inline
-bool companion<_Scalar,_Deg>::balancedR( RealScalar colNorm, RealScalar rowNorm,
+bool companion<Scalar_,_Deg>::balancedR( RealScalar colNorm, RealScalar rowNorm,
     bool& isBalanced, RealScalar& colB, RealScalar& rowB )
 {
   if( RealScalar(0) == colNorm || RealScalar(0) == rowNorm ){ return true; }
@@ -197,7 +197,7 @@
      * of the row and column norm
      */
     const RealScalar q = colNorm/rowNorm;
-    if( !isApprox( q, _Scalar(1) ) )
+    if( !isApprox( q, Scalar_(1) ) )
     {
       rowB = sqrt( colNorm/rowNorm );
       colB = RealScalar(1)/rowB;
@@ -211,8 +211,8 @@
 }
 
 
-template< typename _Scalar, int _Deg >
-void companion<_Scalar,_Deg>::balance()
+template< typename Scalar_, int _Deg >
+void companion<Scalar_,_Deg>::balance()
 {
   using std::abs;
   EIGEN_STATIC_ASSERT( Deg == Dynamic || 1 < Deg, YOU_MADE_A_PROGRAMMING_MISTAKE );
diff --git a/unsupported/Eigen/src/Polynomials/PolynomialSolver.h b/unsupported/Eigen/src/Polynomials/PolynomialSolver.h
index 5e0ecbb..a9e8212 100644
--- a/unsupported/Eigen/src/Polynomials/PolynomialSolver.h
+++ b/unsupported/Eigen/src/Polynomials/PolynomialSolver.h
@@ -25,13 +25,13 @@
  * It stores the set of roots as a vector of complexes.
  *
  */
-template< typename _Scalar, int _Deg >
+template< typename Scalar_, int _Deg >
 class PolynomialSolverBase
 {
   public:
-    EIGEN_MAKE_ALIGNED_OPERATOR_NEW_IF_VECTORIZABLE_FIXED_SIZE(_Scalar,_Deg==Dynamic ? Dynamic : _Deg)
+    EIGEN_MAKE_ALIGNED_OPERATOR_NEW_IF_VECTORIZABLE_FIXED_SIZE(Scalar_,_Deg==Dynamic ? Dynamic : _Deg)
 
-    typedef _Scalar                             Scalar;
+    typedef Scalar_                             Scalar;
     typedef typename NumTraits<Scalar>::Real    RealScalar;
     typedef std::complex<RealScalar>            RootType;
     typedef Matrix<RootType,_Deg,1>             RootsType;
@@ -59,7 +59,7 @@
      * i.e. the real part of the complex roots that have an imaginary part which
      * absolute value is smaller than absImaginaryThreshold.
      * absImaginaryThreshold takes the dummy_precision associated
-     * with the _Scalar template parameter of the PolynomialSolver class as the default value.
+     * with the Scalar_ template parameter of the PolynomialSolver class as the default value.
      *
      * \param[out] bi_seq : the back insertion sequence (stl concept)
      * \param[in]  absImaginaryThreshold : the maximum bound of the imaginary part of a complex
@@ -200,7 +200,7 @@
      * A real root is defined as the real part of a complex root with absolute imaginary
      * part smallest than absImaginaryThreshold.
      * absImaginaryThreshold takes the dummy_precision associated
-     * with the _Scalar template parameter of the PolynomialSolver class as the default value.
+     * with the Scalar_ template parameter of the PolynomialSolver class as the default value.
      * If no real root is found the boolean hasArealRoot is set to false and the real part of
      * the root with smallest absolute imaginary part is returned instead.
      *
@@ -223,7 +223,7 @@
      * A real root is defined as the real part of a complex root with absolute imaginary
      * part smallest than absImaginaryThreshold.
      * absImaginaryThreshold takes the dummy_precision associated
-     * with the _Scalar template parameter of the PolynomialSolver class as the default value.
+     * with the Scalar_ template parameter of the PolynomialSolver class as the default value.
      * If no real root is found the boolean hasArealRoot is set to false and the real part of
      * the root with smallest absolute imaginary part is returned instead.
      *
@@ -246,7 +246,7 @@
      * A real root is defined as the real part of a complex root with absolute imaginary
      * part smallest than absImaginaryThreshold.
      * absImaginaryThreshold takes the dummy_precision associated
-     * with the _Scalar template parameter of the PolynomialSolver class as the default value.
+     * with the Scalar_ template parameter of the PolynomialSolver class as the default value.
      * If no real root is found the boolean hasArealRoot is set to false and the real part of
      * the root with smallest absolute imaginary part is returned instead.
      *
@@ -269,7 +269,7 @@
      * A real root is defined as the real part of a complex root with absolute imaginary
      * part smallest than absImaginaryThreshold.
      * absImaginaryThreshold takes the dummy_precision associated
-     * with the _Scalar template parameter of the PolynomialSolver class as the default value.
+     * with the Scalar_ template parameter of the PolynomialSolver class as the default value.
      * If no real root is found the boolean hasArealRoot is set to false and the real part of
      * the root with smallest absolute imaginary part is returned instead.
      *
@@ -306,7 +306,7 @@
   *
   * Computes the complex roots of a real polynomial.
   *
-  * \param _Scalar the scalar type, i.e., the type of the polynomial coefficients
+  * \param Scalar_ the scalar type, i.e., the type of the polynomial coefficients
   * \param _Deg the degree of the polynomial, can be a compile time value or Dynamic.
   *             Notice that the number of polynomial coefficients is _Deg+1.
   *
@@ -327,13 +327,13 @@
   * However, almost always, correct accuracy is reached even in these cases for 64bit
   * (double) floating types and small polynomial degree (<20).
   */
-template<typename _Scalar, int _Deg>
-class PolynomialSolver : public PolynomialSolverBase<_Scalar,_Deg>
+template<typename Scalar_, int _Deg>
+class PolynomialSolver : public PolynomialSolverBase<Scalar_,_Deg>
 {
   public:
-    EIGEN_MAKE_ALIGNED_OPERATOR_NEW_IF_VECTORIZABLE_FIXED_SIZE(_Scalar,_Deg==Dynamic ? Dynamic : _Deg)
+    EIGEN_MAKE_ALIGNED_OPERATOR_NEW_IF_VECTORIZABLE_FIXED_SIZE(Scalar_,_Deg==Dynamic ? Dynamic : _Deg)
 
-    typedef PolynomialSolverBase<_Scalar,_Deg>    PS_Base;
+    typedef PolynomialSolverBase<Scalar_,_Deg>    PS_Base;
     EIGEN_POLYNOMIAL_SOLVER_BASE_INHERITED_TYPES( PS_Base )
 
     typedef Matrix<Scalar,_Deg,_Deg>                 CompanionMatrixType;
@@ -395,11 +395,11 @@
 };
 
 
-template< typename _Scalar >
-class PolynomialSolver<_Scalar,1> : public PolynomialSolverBase<_Scalar,1>
+template< typename Scalar_ >
+class PolynomialSolver<Scalar_,1> : public PolynomialSolverBase<Scalar_,1>
 {
   public:
-    typedef PolynomialSolverBase<_Scalar,1>    PS_Base;
+    typedef PolynomialSolverBase<Scalar_,1>    PS_Base;
     EIGEN_POLYNOMIAL_SOLVER_BASE_INHERITED_TYPES( PS_Base )
 
   public:
diff --git a/unsupported/Eigen/src/Skyline/SkylineInplaceLU.h b/unsupported/Eigen/src/Skyline/SkylineInplaceLU.h
index 6d0370d..7dce840 100644
--- a/unsupported/Eigen/src/Skyline/SkylineInplaceLU.h
+++ b/unsupported/Eigen/src/Skyline/SkylineInplaceLU.h
@@ -116,7 +116,7 @@
  * using the default algorithm.
  */
 template<typename MatrixType>
-//template<typename _Scalar>
+//template<typename Scalar_>
 void SkylineInplaceLU<MatrixType>::compute() {
     const size_t rows = m_lu.rows();
     const size_t cols = m_lu.cols();
diff --git a/unsupported/Eigen/src/Skyline/SkylineMatrix.h b/unsupported/Eigen/src/Skyline/SkylineMatrix.h
index 664a97f..060843f 100644
--- a/unsupported/Eigen/src/Skyline/SkylineMatrix.h
+++ b/unsupported/Eigen/src/Skyline/SkylineMatrix.h
@@ -24,16 +24,16 @@
  * This class implements a skyline matrix using the very uncommon storage
  * scheme.
  *
- * \param _Scalar the scalar type, i.e. the type of the coefficients
- * \param _Options Union of bit flags controlling the storage scheme. Currently the only possibility
+ * \param Scalar_ the scalar type, i.e. the type of the coefficients
+ * \param Options_ Union of bit flags controlling the storage scheme. Currently the only possibility
  *                 is RowMajor. The default is 0 which means column-major.
  *
  *
  */
 namespace internal {
-template<typename _Scalar, int _Options>
-struct traits<SkylineMatrix<_Scalar, _Options> > {
-    typedef _Scalar Scalar;
+template<typename Scalar_, int Options_>
+struct traits<SkylineMatrix<Scalar_, Options_> > {
+    typedef Scalar_ Scalar;
     typedef Sparse StorageKind;
 
     enum {
@@ -41,15 +41,15 @@
         ColsAtCompileTime = Dynamic,
         MaxRowsAtCompileTime = Dynamic,
         MaxColsAtCompileTime = Dynamic,
-        Flags = SkylineBit | _Options,
+        Flags = SkylineBit | Options_,
         CoeffReadCost = NumTraits<Scalar>::ReadCost,
     };
 };
 }
 
-template<typename _Scalar, int _Options>
+template<typename Scalar_, int Options_>
 class SkylineMatrix
-: public SkylineMatrixBase<SkylineMatrix<_Scalar, _Options> > {
+: public SkylineMatrixBase<SkylineMatrix<Scalar_, Options_> > {
 public:
     EIGEN_SKYLINE_GENERIC_PUBLIC_INTERFACE(SkylineMatrix)
     EIGEN_SKYLINE_INHERIT_ASSIGNMENT_OPERATOR(SkylineMatrix, +=)
@@ -731,15 +731,15 @@
     Scalar sum() const;
 };
 
-template<typename Scalar, int _Options>
-class SkylineMatrix<Scalar, _Options>::InnerUpperIterator {
+template<typename Scalar, int Options_>
+class SkylineMatrix<Scalar, Options_>::InnerUpperIterator {
 public:
 
     InnerUpperIterator(const SkylineMatrix& mat, Index outer)
     : m_matrix(mat), m_outer(outer),
-    m_id(_Options == RowMajor ? mat.m_colStartIndex[outer] : mat.m_rowStartIndex[outer] + 1),
+    m_id(Options_ == RowMajor ? mat.m_colStartIndex[outer] : mat.m_rowStartIndex[outer] + 1),
     m_start(m_id),
-    m_end(_Options == RowMajor ? mat.m_colStartIndex[outer + 1] : mat.m_rowStartIndex[outer + 1] + 1) {
+    m_end(Options_ == RowMajor ? mat.m_colStartIndex[outer + 1] : mat.m_rowStartIndex[outer + 1] + 1) {
     }
 
     inline InnerUpperIterator & operator++() {
@@ -793,16 +793,16 @@
     const Index m_end;
 };
 
-template<typename Scalar, int _Options>
-class SkylineMatrix<Scalar, _Options>::InnerLowerIterator {
+template<typename Scalar, int Options_>
+class SkylineMatrix<Scalar, Options_>::InnerLowerIterator {
 public:
 
     InnerLowerIterator(const SkylineMatrix& mat, Index outer)
     : m_matrix(mat),
     m_outer(outer),
-    m_id(_Options == RowMajor ? mat.m_rowStartIndex[outer] : mat.m_colStartIndex[outer] + 1),
+    m_id(Options_ == RowMajor ? mat.m_rowStartIndex[outer] : mat.m_colStartIndex[outer] + 1),
     m_start(m_id),
-    m_end(_Options == RowMajor ? mat.m_rowStartIndex[outer + 1] : mat.m_colStartIndex[outer + 1] + 1) {
+    m_end(Options_ == RowMajor ? mat.m_rowStartIndex[outer + 1] : mat.m_colStartIndex[outer + 1] + 1) {
     }
 
     inline InnerLowerIterator & operator++() {
diff --git a/unsupported/Eigen/src/Skyline/SkylineProduct.h b/unsupported/Eigen/src/Skyline/SkylineProduct.h
index d9eb814..5da66af 100644
--- a/unsupported/Eigen/src/Skyline/SkylineProduct.h
+++ b/unsupported/Eigen/src/Skyline/SkylineProduct.h
@@ -120,17 +120,17 @@
 
 template<typename Lhs, typename Rhs, typename Dest>
 EIGEN_DONT_INLINE void skyline_row_major_time_dense_product(const Lhs& lhs, const Rhs& rhs, Dest& dst) {
-    typedef typename remove_all<Lhs>::type _Lhs;
-    typedef typename remove_all<Rhs>::type _Rhs;
+    typedef typename remove_all<Lhs>::type Lhs_;
+    typedef typename remove_all<Rhs>::type Rhs_;
     typedef typename traits<Lhs>::Scalar Scalar;
 
     enum {
-        LhsIsRowMajor = (_Lhs::Flags & RowMajorBit) == RowMajorBit,
-        LhsIsSelfAdjoint = (_Lhs::Flags & SelfAdjointBit) == SelfAdjointBit,
+        LhsIsRowMajor = (Lhs_::Flags & RowMajorBit) == RowMajorBit,
+        LhsIsSelfAdjoint = (Lhs_::Flags & SelfAdjointBit) == SelfAdjointBit,
         ProcessFirstHalf = LhsIsSelfAdjoint
-        && (((_Lhs::Flags & (UpperTriangularBit | LowerTriangularBit)) == 0)
-        || ((_Lhs::Flags & UpperTriangularBit) && !LhsIsRowMajor)
-        || ((_Lhs::Flags & LowerTriangularBit) && LhsIsRowMajor)),
+        && (((Lhs_::Flags & (UpperTriangularBit | LowerTriangularBit)) == 0)
+        || ((Lhs_::Flags & UpperTriangularBit) && !LhsIsRowMajor)
+        || ((Lhs_::Flags & LowerTriangularBit) && LhsIsRowMajor)),
         ProcessSecondHalf = LhsIsSelfAdjoint && (!ProcessFirstHalf)
     };
 
@@ -142,7 +142,7 @@
     }
     //Use matrix lower triangular part
     for (Index row = 0; row < lhs.rows(); row++) {
-        typename _Lhs::InnerLowerIterator lIt(lhs, row);
+        typename Lhs_::InnerLowerIterator lIt(lhs, row);
         const Index stop = lIt.col() + lIt.size();
         for (Index col = 0; col < rhs.cols(); col++) {
 
@@ -162,7 +162,7 @@
 
     //Use matrix upper triangular part
     for (Index lhscol = 0; lhscol < lhs.cols(); lhscol++) {
-        typename _Lhs::InnerUpperIterator uIt(lhs, lhscol);
+        typename Lhs_::InnerUpperIterator uIt(lhs, lhscol);
         const Index stop = uIt.size() + uIt.row();
         for (Index rhscol = 0; rhscol < rhs.cols(); rhscol++) {
 
@@ -183,17 +183,17 @@
 
 template<typename Lhs, typename Rhs, typename Dest>
 EIGEN_DONT_INLINE void skyline_col_major_time_dense_product(const Lhs& lhs, const Rhs& rhs, Dest& dst) {
-    typedef typename remove_all<Lhs>::type _Lhs;
-    typedef typename remove_all<Rhs>::type _Rhs;
+    typedef typename remove_all<Lhs>::type Lhs_;
+    typedef typename remove_all<Rhs>::type Rhs_;
     typedef typename traits<Lhs>::Scalar Scalar;
 
     enum {
-        LhsIsRowMajor = (_Lhs::Flags & RowMajorBit) == RowMajorBit,
-        LhsIsSelfAdjoint = (_Lhs::Flags & SelfAdjointBit) == SelfAdjointBit,
+        LhsIsRowMajor = (Lhs_::Flags & RowMajorBit) == RowMajorBit,
+        LhsIsSelfAdjoint = (Lhs_::Flags & SelfAdjointBit) == SelfAdjointBit,
         ProcessFirstHalf = LhsIsSelfAdjoint
-        && (((_Lhs::Flags & (UpperTriangularBit | LowerTriangularBit)) == 0)
-        || ((_Lhs::Flags & UpperTriangularBit) && !LhsIsRowMajor)
-        || ((_Lhs::Flags & LowerTriangularBit) && LhsIsRowMajor)),
+        && (((Lhs_::Flags & (UpperTriangularBit | LowerTriangularBit)) == 0)
+        || ((Lhs_::Flags & UpperTriangularBit) && !LhsIsRowMajor)
+        || ((Lhs_::Flags & LowerTriangularBit) && LhsIsRowMajor)),
         ProcessSecondHalf = LhsIsSelfAdjoint && (!ProcessFirstHalf)
     };
 
@@ -206,7 +206,7 @@
 
     //Use matrix upper triangular part
     for (Index row = 0; row < lhs.rows(); row++) {
-        typename _Lhs::InnerUpperIterator uIt(lhs, row);
+        typename Lhs_::InnerUpperIterator uIt(lhs, row);
         const Index stop = uIt.col() + uIt.size();
         for (Index col = 0; col < rhs.cols(); col++) {
 
@@ -227,7 +227,7 @@
 
     //Use matrix lower triangular part
     for (Index lhscol = 0; lhscol < lhs.cols(); lhscol++) {
-        typename _Lhs::InnerLowerIterator lIt(lhs, lhscol);
+        typename Lhs_::InnerLowerIterator lIt(lhs, lhscol);
         const Index stop = lIt.size() + lIt.row();
         for (Index rhscol = 0; rhscol < rhs.cols(); rhscol++) {
 
@@ -272,7 +272,7 @@
 // template<typename Derived>
 // template<typename Lhs, typename Rhs >
 // Derived & MatrixBase<Derived>::lazyAssign(const SkylineProduct<Lhs, Rhs, SkylineTimeDenseProduct>& product) {
-//     typedef typename internal::remove_all<Lhs>::type _Lhs;
+//     typedef typename internal::remove_all<Lhs>::type Lhs_;
 //     internal::skyline_product_selector<typename internal::remove_all<Lhs>::type,
 //             typename internal::remove_all<Rhs>::type,
 //             Derived>::run(product.lhs(), product.rhs(), derived());
diff --git a/unsupported/Eigen/src/Skyline/SkylineUtil.h b/unsupported/Eigen/src/Skyline/SkylineUtil.h
index 75eb612..4446d73 100644
--- a/unsupported/Eigen/src/Skyline/SkylineUtil.h
+++ b/unsupported/Eigen/src/Skyline/SkylineUtil.h
@@ -61,10 +61,10 @@
   _EIGEN_SKYLINE_GENERIC_PUBLIC_INTERFACE(Derived, Eigen::SkylineMatrixBase<Derived>)
 
 template<typename Derived> class SkylineMatrixBase;
-template<typename _Scalar, int _Flags = 0> class SkylineMatrix;
-template<typename _Scalar, int _Flags = 0> class DynamicSkylineMatrix;
-template<typename _Scalar, int _Flags = 0> class SkylineVector;
-template<typename _Scalar, int _Flags = 0> class MappedSkylineMatrix;
+template<typename Scalar_, int _Flags = 0> class SkylineMatrix;
+template<typename Scalar_, int _Flags = 0> class DynamicSkylineMatrix;
+template<typename Scalar_, int _Flags = 0> class SkylineVector;
+template<typename Scalar_, int _Flags = 0> class MappedSkylineMatrix;
 
 namespace internal {
 
@@ -73,13 +73,13 @@
 
 template<typename T> class eval<T,IsSkyline>
 {
-    typedef typename traits<T>::Scalar _Scalar;
+    typedef typename traits<T>::Scalar Scalar_;
     enum {
           _Flags = traits<T>::Flags
     };
 
   public:
-    typedef SkylineMatrix<_Scalar, _Flags> type;
+    typedef SkylineMatrix<Scalar_, _Flags> type;
 };
 
 } // end namespace internal
diff --git a/unsupported/Eigen/src/SparseExtra/BlockOfDynamicSparseMatrix.h b/unsupported/Eigen/src/SparseExtra/BlockOfDynamicSparseMatrix.h
deleted file mode 100644
index e9ec746..0000000
--- a/unsupported/Eigen/src/SparseExtra/BlockOfDynamicSparseMatrix.h
+++ /dev/null
@@ -1,122 +0,0 @@
-// This file is part of Eigen, a lightweight C++ template library
-// for linear algebra.
-//
-// Copyright (C) 2008-2009 Gael Guennebaud <gael.guennebaud@inria.fr>
-//
-// This Source Code Form is subject to the terms of the Mozilla
-// 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_SPARSE_BLOCKFORDYNAMICMATRIX_H
-#define EIGEN_SPARSE_BLOCKFORDYNAMICMATRIX_H
-
-namespace Eigen { 
-
-#if 0
-
-// NOTE Have to be reimplemented as a specialization of BlockImpl< DynamicSparseMatrix<_Scalar, _Options, _Index>, ... >
-// See SparseBlock.h for an example
-
-
-/***************************************************************************
-* specialisation for DynamicSparseMatrix
-***************************************************************************/
-
-template<typename _Scalar, int _Options, typename _Index, int Size>
-class SparseInnerVectorSet<DynamicSparseMatrix<_Scalar, _Options, _Index>, Size>
-  : public SparseMatrixBase<SparseInnerVectorSet<DynamicSparseMatrix<_Scalar, _Options, _Index>, Size> >
-{
-    typedef DynamicSparseMatrix<_Scalar, _Options, _Index> MatrixType;
-  public:
-
-    enum { IsRowMajor = internal::traits<SparseInnerVectorSet>::IsRowMajor };
-
-    EIGEN_SPARSE_PUBLIC_INTERFACE(SparseInnerVectorSet)
-    class InnerIterator: public MatrixType::InnerIterator
-    {
-      public:
-        inline InnerIterator(const SparseInnerVectorSet& xpr, Index outer)
-          : MatrixType::InnerIterator(xpr.m_matrix, xpr.m_outerStart + outer), m_outer(outer)
-        {}
-        inline Index row() const { return IsRowMajor ? m_outer : this->index(); }
-        inline Index col() const { return IsRowMajor ? this->index() : m_outer; }
-      protected:
-        Index m_outer;
-    };
-
-    inline SparseInnerVectorSet(const MatrixType& matrix, Index outerStart, Index outerSize)
-      : m_matrix(matrix), m_outerStart(outerStart), m_outerSize(outerSize)
-    {
-      eigen_assert( (outerStart>=0) && ((outerStart+outerSize)<=matrix.outerSize()) );
-    }
-
-    inline SparseInnerVectorSet(const MatrixType& matrix, Index outer)
-      : m_matrix(matrix), m_outerStart(outer), m_outerSize(Size)
-    {
-      eigen_assert(Size!=Dynamic);
-      eigen_assert( (outer>=0) && (outer<matrix.outerSize()) );
-    }
-
-    template<typename OtherDerived>
-    inline SparseInnerVectorSet& operator=(const SparseMatrixBase<OtherDerived>& other)
-    {
-      if (IsRowMajor != ((OtherDerived::Flags&RowMajorBit)==RowMajorBit))
-      {
-        // need to transpose => perform a block evaluation followed by a big swap
-        DynamicSparseMatrix<Scalar,IsRowMajor?RowMajorBit:0> aux(other);
-        *this = aux.markAsRValue();
-      }
-      else
-      {
-        // evaluate/copy vector per vector
-        for (Index j=0; j<m_outerSize.value(); ++j)
-        {
-          SparseVector<Scalar,IsRowMajor ? RowMajorBit : 0> aux(other.innerVector(j));
-          m_matrix.const_cast_derived()._data()[m_outerStart+j].swap(aux._data());
-        }
-      }
-      return *this;
-    }
-
-    inline SparseInnerVectorSet& operator=(const SparseInnerVectorSet& other)
-    {
-      return operator=<SparseInnerVectorSet>(other);
-    }
-
-    Index nonZeros() const
-    {
-      Index count = 0;
-      for (Index j=0; j<m_outerSize.value(); ++j)
-        count += m_matrix._data()[m_outerStart+j].size();
-      return count;
-    }
-
-    const Scalar& lastCoeff() const
-    {
-      EIGEN_STATIC_ASSERT_VECTOR_ONLY(SparseInnerVectorSet);
-      eigen_assert(m_matrix.data()[m_outerStart].size()>0);
-      return m_matrix.data()[m_outerStart].vale(m_matrix.data()[m_outerStart].size()-1);
-    }
-
-//     template<typename Sparse>
-//     inline SparseInnerVectorSet& operator=(const SparseMatrixBase<OtherDerived>& other)
-//     {
-//       return *this;
-//     }
-
-    EIGEN_STRONG_INLINE Index rows() const { return IsRowMajor ? m_outerSize.value() : m_matrix.rows(); }
-    EIGEN_STRONG_INLINE Index cols() const { return IsRowMajor ? m_matrix.cols() : m_outerSize.value(); }
-
-  protected:
-
-    const typename MatrixType::Nested m_matrix;
-    Index m_outerStart;
-    const internal::variable_if_dynamic<Index, Size> m_outerSize;
-
-};
-
-#endif
-
-} // end namespace Eigen
-
-#endif // EIGEN_SPARSE_BLOCKFORDYNAMICMATRIX_H
diff --git a/unsupported/Eigen/src/SparseExtra/BlockSparseMatrix.h b/unsupported/Eigen/src/SparseExtra/BlockSparseMatrix.h
index 536a0c3..6b4f8a1 100644
--- a/unsupported/Eigen/src/SparseExtra/BlockSparseMatrix.h
+++ b/unsupported/Eigen/src/SparseExtra/BlockSparseMatrix.h
@@ -46,21 +46,21 @@
   * It is obviously required to describe the block layout beforehand by calling either
   * setBlockSize() for fixed-size blocks or setBlockLayout for variable-size blocks.
   *
-  * \tparam _Scalar The Scalar type
+  * \tparam Scalar_ The Scalar type
   * \tparam _BlockAtCompileTime The block layout option. It takes the following values
   * Dynamic : block size known at runtime
   * a numeric number : fixed-size block known at compile time
   */
-template<typename _Scalar, int _BlockAtCompileTime=Dynamic, int _Options=ColMajor, typename _StorageIndex=int> class BlockSparseMatrix;
+template<typename Scalar_, int _BlockAtCompileTime=Dynamic, int Options_=ColMajor, typename StorageIndex_=int> class BlockSparseMatrix;
 
 template<typename BlockSparseMatrixT> class BlockSparseMatrixView;
 
 namespace internal {
-template<typename _Scalar, int _BlockAtCompileTime, int _Options, typename _Index>
-struct traits<BlockSparseMatrix<_Scalar,_BlockAtCompileTime,_Options, _Index> >
+template<typename Scalar_, int _BlockAtCompileTime, int Options_, typename Index_>
+struct traits<BlockSparseMatrix<Scalar_,_BlockAtCompileTime,Options_, Index_> >
 {
-  typedef _Scalar Scalar;
-  typedef _Index Index;
+  typedef Scalar_ Scalar;
+  typedef Index_ Index;
   typedef Sparse StorageKind; // FIXME Where is it used ??
   typedef MatrixXpr XprKind;
   enum {
@@ -69,7 +69,7 @@
     MaxRowsAtCompileTime = Dynamic,
     MaxColsAtCompileTime = Dynamic,
     BlockSize = _BlockAtCompileTime,
-    Flags = _Options | NestByRefBit | LvalueBit,
+    Flags = Options_ | NestByRefBit | LvalueBit,
     CoeffReadCost = NumTraits<Scalar>::ReadCost,
     SupportedAccessPatterns = InnerRandomAccessPattern
   };
@@ -280,17 +280,17 @@
     BlockSparseTimeDenseProduct& operator=(const BlockSparseTimeDenseProduct&);
 };
 
-template<typename _Scalar, int _BlockAtCompileTime, int _Options, typename _StorageIndex>
-class BlockSparseMatrix : public SparseMatrixBase<BlockSparseMatrix<_Scalar,_BlockAtCompileTime, _Options,_StorageIndex> >
+template<typename Scalar_, int _BlockAtCompileTime, int Options_, typename StorageIndex_>
+class BlockSparseMatrix : public SparseMatrixBase<BlockSparseMatrix<Scalar_,_BlockAtCompileTime, Options_,StorageIndex_> >
 {
   public:
-    typedef _Scalar Scalar;
+    typedef Scalar_ Scalar;
     typedef typename NumTraits<Scalar>::Real RealScalar;
-    typedef _StorageIndex StorageIndex;
-    typedef typename internal::ref_selector<BlockSparseMatrix<_Scalar, _BlockAtCompileTime, _Options, _StorageIndex> >::type Nested;
+    typedef StorageIndex_ StorageIndex;
+    typedef typename internal::ref_selector<BlockSparseMatrix<Scalar_, _BlockAtCompileTime, Options_, StorageIndex_> >::type Nested;
 
     enum {
-      Options = _Options,
+      Options = Options_,
       Flags = Options,
       BlockSize=_BlockAtCompileTime,
       RowsAtCompileTime = Dynamic,
@@ -968,13 +968,13 @@
     Index m_blockSize; // Size of a block for fixed-size blocks, otherwise -1
 };
 
-template<typename _Scalar, int _BlockAtCompileTime, int _Options, typename _StorageIndex>
-class BlockSparseMatrix<_Scalar, _BlockAtCompileTime, _Options, _StorageIndex>::BlockInnerIterator
+template<typename Scalar_, int _BlockAtCompileTime, int Options_, typename StorageIndex_>
+class BlockSparseMatrix<Scalar_, _BlockAtCompileTime, Options_, StorageIndex_>::BlockInnerIterator
 {
   public:
 
     enum{
-      Flags = _Options
+      Flags = Options_
     };
 
     BlockInnerIterator(const BlockSparseMatrix& mat, const Index outer)
@@ -1010,14 +1010,14 @@
     inline operator bool() const { return (m_id < m_end); }
 
   protected:
-    const BlockSparseMatrix<_Scalar, _BlockAtCompileTime, _Options, StorageIndex>& m_mat;
+    const BlockSparseMatrix<Scalar_, _BlockAtCompileTime, Options_, StorageIndex>& m_mat;
     const Index m_outer;
     Index m_id;
     Index m_end;
 };
 
-template<typename _Scalar, int _BlockAtCompileTime, int _Options, typename _StorageIndex>
-class BlockSparseMatrix<_Scalar, _BlockAtCompileTime, _Options, _StorageIndex>::InnerIterator
+template<typename Scalar_, int _BlockAtCompileTime, int Options_, typename StorageIndex_>
+class BlockSparseMatrix<Scalar_, _BlockAtCompileTime, Options_, StorageIndex_>::InnerIterator
 {
   public:
     InnerIterator(const BlockSparseMatrix& mat, Index outer)
diff --git a/unsupported/Eigen/src/SparseExtra/DynamicSparseMatrix.h b/unsupported/Eigen/src/SparseExtra/DynamicSparseMatrix.h
deleted file mode 100644
index 42c99e4..0000000
--- a/unsupported/Eigen/src/SparseExtra/DynamicSparseMatrix.h
+++ /dev/null
@@ -1,404 +0,0 @@
-// This file is part of Eigen, a lightweight C++ template library
-// for linear algebra.
-//
-// Copyright (C) 2008-2009 Gael Guennebaud <gael.guennebaud@inria.fr>
-//
-// This Source Code Form is subject to the terms of the Mozilla
-// 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_DYNAMIC_SPARSEMATRIX_H
-#define EIGEN_DYNAMIC_SPARSEMATRIX_H
-
-namespace Eigen { 
-
-/** \deprecated use a SparseMatrix in an uncompressed mode
-  *
-  * \class DynamicSparseMatrix
-  *
-  * \brief A sparse matrix class designed for matrix assembly purpose
-  *
-  * \param _Scalar the scalar type, i.e. the type of the coefficients
-  *
-  * Unlike SparseMatrix, this class provides a much higher degree of flexibility. In particular, it allows
-  * random read/write accesses in log(rho*outer_size) where \c rho is the probability that a coefficient is
-  * nonzero and outer_size is the number of columns if the matrix is column-major and the number of rows
-  * otherwise.
-  *
-  * Internally, the data are stored as a std::vector of compressed vector. The performances of random writes might
-  * decrease as the number of nonzeros per inner-vector increase. In practice, we observed very good performance
-  * till about 100 nonzeros/vector, and the performance remains relatively good till 500 nonzeros/vectors.
-  *
-  * \see SparseMatrix
-  */
-
-namespace internal {
-template<typename _Scalar, int _Options, typename _StorageIndex>
-struct traits<DynamicSparseMatrix<_Scalar, _Options, _StorageIndex> >
-{
-  typedef _Scalar Scalar;
-  typedef _StorageIndex StorageIndex;
-  typedef Sparse StorageKind;
-  typedef MatrixXpr XprKind;
-  enum {
-    RowsAtCompileTime = Dynamic,
-    ColsAtCompileTime = Dynamic,
-    MaxRowsAtCompileTime = Dynamic,
-    MaxColsAtCompileTime = Dynamic,
-    Flags = _Options | NestByRefBit | LvalueBit,
-    CoeffReadCost = NumTraits<Scalar>::ReadCost,
-    SupportedAccessPatterns = OuterRandomAccessPattern
-  };
-};
-}
-
-template<typename _Scalar, int _Options, typename _StorageIndex>
- class  DynamicSparseMatrix
-  : public SparseMatrixBase<DynamicSparseMatrix<_Scalar, _Options, _StorageIndex> >
-{
-    typedef SparseMatrixBase<DynamicSparseMatrix> Base;
-    using Base::convert_index;
-  public:
-    EIGEN_SPARSE_PUBLIC_INTERFACE(DynamicSparseMatrix)
-    // FIXME: why are these operator already alvailable ???
-    // EIGEN_SPARSE_INHERIT_ASSIGNMENT_OPERATOR(DynamicSparseMatrix, +=)
-    // EIGEN_SPARSE_INHERIT_ASSIGNMENT_OPERATOR(DynamicSparseMatrix, -=)
-    typedef MappedSparseMatrix<Scalar,Flags> Map;
-    using Base::IsRowMajor;
-    using Base::operator=;
-    enum {
-      Options = _Options
-    };
-
-  protected:
-
-    typedef DynamicSparseMatrix<Scalar,(Flags&~RowMajorBit)|(IsRowMajor?RowMajorBit:0), StorageIndex> TransposedSparseMatrix;
-
-    Index m_innerSize;
-    std::vector<internal::CompressedStorage<Scalar,StorageIndex> > m_data;
-
-  public:
-
-    inline Index rows() const { return IsRowMajor ? outerSize() : m_innerSize; }
-    inline Index cols() const { return IsRowMajor ? m_innerSize : outerSize(); }
-    inline Index innerSize() const { return m_innerSize; }
-    inline Index outerSize() const { return convert_index(m_data.size()); }
-    inline Index innerNonZeros(Index j) const { return m_data[j].size(); }
-
-    std::vector<internal::CompressedStorage<Scalar,StorageIndex> >& _data() { return m_data; }
-    const std::vector<internal::CompressedStorage<Scalar,StorageIndex> >& _data() const { return m_data; }
-
-    /** \returns the coefficient value at given position \a row, \a col
-      * This operation involes a log(rho*outer_size) binary search.
-      */
-    inline Scalar coeff(Index row, Index col) const
-    {
-      const Index outer = IsRowMajor ? row : col;
-      const Index inner = IsRowMajor ? col : row;
-      return m_data[outer].at(inner);
-    }
-
-    /** \returns a reference to the coefficient value at given position \a row, \a col
-      * This operation involes a log(rho*outer_size) binary search. If the coefficient does not
-      * exist yet, then a sorted insertion into a sequential buffer is performed.
-      */
-    inline Scalar& coeffRef(Index row, Index col)
-    {
-      const Index outer = IsRowMajor ? row : col;
-      const Index inner = IsRowMajor ? col : row;
-      return m_data[outer].atWithInsertion(inner);
-    }
-
-    class InnerIterator;
-    class ReverseInnerIterator;
-
-    void setZero()
-    {
-      for (Index j=0; j<outerSize(); ++j)
-        m_data[j].clear();
-    }
-
-    /** \returns the number of non zero coefficients */
-    Index nonZeros() const
-    {
-      Index res = 0;
-      for (Index j=0; j<outerSize(); ++j)
-        res += m_data[j].size();
-      return res;
-    }
-
-
-
-    void reserve(Index reserveSize = 1000)
-    {
-      if (outerSize()>0)
-      {
-        Index reserveSizePerVector = (std::max)(reserveSize/outerSize(),Index(4));
-        for (Index j=0; j<outerSize(); ++j)
-        {
-          m_data[j].reserve(reserveSizePerVector);
-        }
-      }
-    }
-
-    /** Does nothing: provided for compatibility with SparseMatrix */
-    inline void startVec(Index /*outer*/) {}
-
-    /** \returns a reference to the non zero coefficient at position \a row, \a col assuming that:
-      * - the nonzero does not already exist
-      * - the new coefficient is the last one of the given inner vector.
-      *
-      * \sa insert, insertBackByOuterInner */
-    inline Scalar& insertBack(Index row, Index col)
-    {
-      return insertBackByOuterInner(IsRowMajor?row:col, IsRowMajor?col:row);
-    }
-
-    /** \sa insertBack */
-    inline Scalar& insertBackByOuterInner(Index outer, Index inner)
-    {
-      eigen_assert(outer<Index(m_data.size()) && inner<m_innerSize && "out of range");
-      eigen_assert(((m_data[outer].size()==0) || (m_data[outer].index(m_data[outer].size()-1)<inner))
-                && "wrong sorted insertion");
-      m_data[outer].append(0, inner);
-      return m_data[outer].value(m_data[outer].size()-1);
-    }
-
-    inline Scalar& insert(Index row, Index col)
-    {
-      const Index outer = IsRowMajor ? row : col;
-      const Index inner = IsRowMajor ? col : row;
-
-      Index startId = 0;
-      Index id = static_cast<Index>(m_data[outer].size()) - 1;
-      m_data[outer].resize(id+2,1);
-
-      while ( (id >= startId) && (m_data[outer].index(id) > inner) )
-      {
-        m_data[outer].index(id+1) = m_data[outer].index(id);
-        m_data[outer].value(id+1) = m_data[outer].value(id);
-        --id;
-      }
-      m_data[outer].index(id+1) = inner;
-      m_data[outer].value(id+1) = 0;
-      return m_data[outer].value(id+1);
-    }
-
-    /** Does nothing: provided for compatibility with SparseMatrix */
-    inline void finalize() {}
-
-    /** Suppress all nonzeros which are smaller than \a reference under the tolerance \a epsilon */
-    void prune(Scalar reference, RealScalar epsilon = NumTraits<RealScalar>::dummy_precision())
-    {
-      for (Index j=0; j<outerSize(); ++j)
-        m_data[j].prune(reference,epsilon);
-    }
-
-    /** Resize the matrix without preserving the data (the matrix is set to zero)
-      */
-    void resize(Index rows, Index cols)
-    {
-      const Index outerSize = IsRowMajor ? rows : cols;
-      m_innerSize = convert_index(IsRowMajor ? cols : rows);
-      setZero();
-      if (Index(m_data.size()) != outerSize)
-      {
-        m_data.resize(outerSize);
-      }
-    }
-
-    void resizeAndKeepData(Index rows, Index cols)
-    {
-      const Index outerSize = IsRowMajor ? rows : cols;
-      const Index innerSize = IsRowMajor ? cols : rows;
-      if (m_innerSize>innerSize)
-      {
-        // remove all coefficients with innerCoord>=innerSize
-        // TODO
-        //std::cerr << "not implemented yet\n";
-        exit(2);
-      }
-      if (m_data.size() != outerSize)
-      {
-        m_data.resize(outerSize);
-      }
-    }
-
-    /** The class DynamicSparseMatrix is deprecated */
-    EIGEN_DEPRECATED inline DynamicSparseMatrix()
-      : m_innerSize(0), m_data(0)
-    {
-      #ifdef EIGEN_SPARSE_CREATE_TEMPORARY_PLUGIN
-        EIGEN_SPARSE_CREATE_TEMPORARY_PLUGIN
-      #endif
-      eigen_assert(innerSize()==0 && outerSize()==0);
-    }
-
-    /** The class DynamicSparseMatrix is deprecated */
-    EIGEN_DEPRECATED inline DynamicSparseMatrix(Index rows, Index cols)
-      : m_innerSize(0)
-    {
-      #ifdef EIGEN_SPARSE_CREATE_TEMPORARY_PLUGIN
-        EIGEN_SPARSE_CREATE_TEMPORARY_PLUGIN
-      #endif
-      resize(rows, cols);
-    }
-
-    /** The class DynamicSparseMatrix is deprecated */
-    template<typename OtherDerived>
-    EIGEN_DEPRECATED explicit inline DynamicSparseMatrix(const SparseMatrixBase<OtherDerived>& other)
-      : m_innerSize(0)
-    {
-      #ifdef EIGEN_SPARSE_CREATE_TEMPORARY_PLUGIN
-        EIGEN_SPARSE_CREATE_TEMPORARY_PLUGIN
-      #endif
-      Base::operator=(other.derived());
-    }
-
-    inline DynamicSparseMatrix(const DynamicSparseMatrix& other)
-      : Base(), m_innerSize(0)
-    {
-      #ifdef EIGEN_SPARSE_CREATE_TEMPORARY_PLUGIN
-        EIGEN_SPARSE_CREATE_TEMPORARY_PLUGIN
-      #endif
-      *this = other.derived();
-    }
-
-    inline void swap(DynamicSparseMatrix& other)
-    {
-      //EIGEN_DBG_SPARSE(std::cout << "SparseMatrix:: swap\n");
-      std::swap(m_innerSize, other.m_innerSize);
-      //std::swap(m_outerSize, other.m_outerSize);
-      m_data.swap(other.m_data);
-    }
-
-    inline DynamicSparseMatrix& operator=(const DynamicSparseMatrix& other)
-    {
-      if (other.isRValue())
-      {
-        swap(other.const_cast_derived());
-      }
-      else
-      {
-        resize(other.rows(), other.cols());
-        m_data = other.m_data;
-      }
-      return *this;
-    }
-
-    /** Destructor */
-    inline ~DynamicSparseMatrix() {}
-
-  public:
-
-    /** \deprecated
-      * Set the matrix to zero and reserve the memory for \a reserveSize nonzero coefficients. */
-    EIGEN_DEPRECATED void startFill(Index reserveSize = 1000)
-    {
-      setZero();
-      reserve(reserveSize);
-    }
-
-    /** \deprecated use insert()
-      * inserts a nonzero coefficient at given coordinates \a row, \a col and returns its reference assuming that:
-      *  1 - the coefficient does not exist yet
-      *  2 - this the coefficient with greater inner coordinate for the given outer coordinate.
-      * In other words, assuming \c *this is column-major, then there must not exists any nonzero coefficient of coordinates
-      * \c i \c x \a col such that \c i >= \a row. Otherwise the matrix is invalid.
-      *
-      * \see fillrand(), coeffRef()
-      */
-    EIGEN_DEPRECATED Scalar& fill(Index row, Index col)
-    {
-      const Index outer = IsRowMajor ? row : col;
-      const Index inner = IsRowMajor ? col : row;
-      return insertBack(outer,inner);
-    }
-
-    /** \deprecated use insert()
-      * Like fill() but with random inner coordinates.
-      * Compared to the generic coeffRef(), the unique limitation is that we assume
-      * the coefficient does not exist yet.
-      */
-    EIGEN_DEPRECATED Scalar& fillrand(Index row, Index col)
-    {
-      return insert(row,col);
-    }
-
-    /** \deprecated use finalize()
-      * Does nothing. Provided for compatibility with SparseMatrix. */
-    EIGEN_DEPRECATED void endFill() {}
-    
-#   ifdef EIGEN_DYNAMICSPARSEMATRIX_PLUGIN
-#     include EIGEN_DYNAMICSPARSEMATRIX_PLUGIN
-#   endif
- };
-
-template<typename Scalar, int _Options, typename _StorageIndex>
-class DynamicSparseMatrix<Scalar,_Options,_StorageIndex>::InnerIterator : public SparseVector<Scalar,_Options,_StorageIndex>::InnerIterator
-{
-    typedef typename SparseVector<Scalar,_Options,_StorageIndex>::InnerIterator Base;
-  public:
-    InnerIterator(const DynamicSparseMatrix& mat, Index outer)
-      : Base(mat.m_data[outer]), m_outer(outer)
-    {}
-
-    inline Index row() const { return IsRowMajor ? m_outer : Base::index(); }
-    inline Index col() const { return IsRowMajor ? Base::index() : m_outer; }
-    inline Index outer() const { return m_outer; }
-
-  protected:
-    const Index m_outer;
-};
-
-template<typename Scalar, int _Options, typename _StorageIndex>
-class DynamicSparseMatrix<Scalar,_Options,_StorageIndex>::ReverseInnerIterator : public SparseVector<Scalar,_Options,_StorageIndex>::ReverseInnerIterator
-{
-    typedef typename SparseVector<Scalar,_Options,_StorageIndex>::ReverseInnerIterator Base;
-  public:
-    ReverseInnerIterator(const DynamicSparseMatrix& mat, Index outer)
-      : Base(mat.m_data[outer]), m_outer(outer)
-    {}
-
-    inline Index row() const { return IsRowMajor ? m_outer : Base::index(); }
-    inline Index col() const { return IsRowMajor ? Base::index() : m_outer; }
-    inline Index outer() const { return m_outer; }
-
-  protected:
-    const Index m_outer;
-};
-
-namespace internal {
-
-template<typename _Scalar, int _Options, typename _StorageIndex>
-struct evaluator<DynamicSparseMatrix<_Scalar,_Options,_StorageIndex> >
-  : evaluator_base<DynamicSparseMatrix<_Scalar,_Options,_StorageIndex> >
-{
-  typedef _Scalar Scalar;
-  typedef DynamicSparseMatrix<_Scalar,_Options,_StorageIndex> SparseMatrixType;
-  typedef typename SparseMatrixType::InnerIterator InnerIterator;
-  typedef typename SparseMatrixType::ReverseInnerIterator ReverseInnerIterator;
-  
-  enum {
-    CoeffReadCost = NumTraits<_Scalar>::ReadCost,
-    Flags = SparseMatrixType::Flags
-  };
-  
-  evaluator() : m_matrix(0) {}
-  evaluator(const SparseMatrixType &mat) : m_matrix(&mat) {}
-  
-  operator SparseMatrixType&() { return m_matrix->const_cast_derived(); }
-  operator const SparseMatrixType&() const { return *m_matrix; }
-  
-  Scalar coeff(Index row, Index col) const { return m_matrix->coeff(row,col); }
-  
-  Index nonZerosEstimate() const { return m_matrix->nonZeros(); }
-
-  const SparseMatrixType *m_matrix;
-};
-
-}
-
-} // end namespace Eigen
-
-#endif // EIGEN_DYNAMIC_SPARSEMATRIX_H
diff --git a/unsupported/Eigen/src/SparseExtra/MarketIO.h b/unsupported/Eigen/src/SparseExtra/MarketIO.h
index dd786d5..8df2556 100644
--- a/unsupported/Eigen/src/SparseExtra/MarketIO.h
+++ b/unsupported/Eigen/src/SparseExtra/MarketIO.h
@@ -47,14 +47,14 @@
   }
 
   template <typename RealScalar>
-  inline void  GetVectorElt (const std::string& line, RealScalar& val)
+  inline void  GetDenseElt (const std::string& line, RealScalar& val)
   {
     std::istringstream newline(line);
     newline >> val;  
   }
 
   template <typename RealScalar>
-  inline void GetVectorElt (const std::string& line, std::complex<RealScalar>& val)
+  inline void GetDenseElt (const std::string& line, std::complex<RealScalar>& val)
   {
     RealScalar valR, valI; 
     std::istringstream newline(line);
@@ -94,23 +94,34 @@
 
 
   template<typename Scalar>
-  inline void putVectorElt(Scalar value, std::ofstream& out)
+  inline void putDenseElt(Scalar value, std::ofstream& out)
   {
     out << value << "\n"; 
   }
   template<typename Scalar>
-  inline void putVectorElt(std::complex<Scalar> value, std::ofstream& out)
+  inline void putDenseElt(std::complex<Scalar> value, std::ofstream& out)
   {
     out << value.real() << " " << value.imag()<< "\n"; 
   }
 
 } // end namespace internal
 
-inline bool getMarketHeader(const std::string& filename, int& sym, bool& iscomplex, bool& isvector)
+
+/**
+ * \ingroup SparseExtra_Module
+ * @brief Reads the header of a matrixmarket file and determines the properties of a matrix
+ * 
+ * @param filename of the file
+ * @param sym if the matrix is hermitian,symmetric or none of the latter (sym=0) 
+ * @param iscomplex if the matrix has complex or real coefficients 
+ * @param isdense if the matrix is dense or sparse
+ * @return true if the file was found
+ */
+inline bool getMarketHeader(const std::string& filename, int& sym, bool& iscomplex, bool& isdense)
 {
   sym = 0; 
   iscomplex = false;
-  isvector = false;
+  isdense = false;
   std::ifstream in(filename.c_str(),std::ios::in);
   if(!in)
     return false;
@@ -122,14 +133,22 @@
   std::stringstream fmtline(line); 
   std::string substr[5];
   fmtline>> substr[0] >> substr[1] >> substr[2] >> substr[3] >> substr[4];
-  if(substr[2].compare("array") == 0) isvector = true;
+  if(substr[2].compare("array") == 0) isdense = true;
   if(substr[3].compare("complex") == 0) iscomplex = true;
   if(substr[4].compare("symmetric") == 0) sym = Symmetric;
   else if (substr[4].compare("Hermitian") == 0) sym = SelfAdjoint;
   
   return true;
 }
-  
+/**
+ * \ingroup SparseExtra_Module
+ * @brief Loads a sparse matrix from a matrixmarket format file.
+ * 
+ * @tparam SparseMatrixType to read into, symmetries are not supported
+ * @param mat SparseMatrix to read into, current values are overwritten
+ * @param filename to parse matrix from
+ * @return returns true if file exists. Returns false if the parsing did not succeed.
+ */
 template<typename SparseMatrixType>
 bool loadMarket(SparseMatrixType& mat, const std::string& filename)
 {
@@ -184,50 +203,108 @@
         elements.push_back(T(i,j,value));
       }
       else
-        std::cerr << "Invalid read: " << i << "," << j << "\n";        
+      {
+        std::cerr << "Invalid read: " << i << "," << j << "\n";   
+        return false;
+      }     
     }
   }
 
   mat.setFromTriplets(elements.begin(), elements.end());
-  if(count!=NNZ)
+  if(count!=NNZ){
     std::cerr << count << "!=" << NNZ << "\n";
-  
+    return false;
+  }
   input.close();
   return true;
 }
 
-template<typename VectorType>
-bool loadMarketVector(VectorType& vec, const std::string& filename)
+
+/**
+ * \ingroup SparseExtra_Module
+ * @brief Loads a dense Matrix or Vector from a matrixmarket file. If a statically sized matrix has to be parsed and the file contains the wrong dimensions it is undefined behaviour.
+ * 
+ * @tparam DenseMatrixType to read into
+ * @param mat DenseMatrix to read into, current values are overwritten, symmetries are not supported
+ * @param filename to parse matrix from
+ * @return true if parsing was successful. Returns false if the parsing did not succeed.
+ */
+template<typename DenseType>
+bool loadMarketDense(DenseType& mat, const std::string& filename)
 {
-   typedef typename VectorType::Scalar Scalar;
+   typedef typename DenseType::Scalar Scalar;
   std::ifstream in(filename.c_str(), std::ios::in);
   if(!in)
     return false;
   
   std::string line; 
-  int n(0), col(0); 
+  Index rows(0), cols(0); 
   do 
   { // Skip comments
     std::getline(in, line); eigen_assert(in.good());
   } while (line[0] == '%');
   std::istringstream newline(line);
-  newline  >> n >> col; 
-  eigen_assert(n>0 && col>0);
-  vec.resize(n);
-  int i = 0; 
+  newline  >> rows >> cols; 
+
+  bool sizes_not_positive=(rows<1 || cols<1);
+  bool wrong_input_rows = (DenseType::MaxRowsAtCompileTime != Dynamic && rows > DenseType::MaxRowsAtCompileTime) ||
+                          (DenseType::RowsAtCompileTime!=Dynamic && rows!=DenseType::RowsAtCompileTime);
+  bool wrong_input_cols = (DenseType::MaxColsAtCompileTime != Dynamic && cols > DenseType::MaxColsAtCompileTime) ||
+                          (DenseType::ColsAtCompileTime!=Dynamic && cols!=DenseType::ColsAtCompileTime);
+
+  if(sizes_not_positive || wrong_input_rows || wrong_input_cols){
+    if(sizes_not_positive){
+      std::cerr<< "non-positive row or column size in file" << filename << "\n";
+    }else{
+      std::cerr<< "Input matrix can not be resized to"<<rows<<" x "<<cols<< "as given in " << filename << "\n";
+    }
+    in.close();
+    return false;
+  }
+
+  mat.resize(rows,cols);
+  Index row = 0;
+  Index col = 0; 
+  Index n=0;
   Scalar value; 
-  while ( std::getline(in, line) && (i < n) ){
-    internal::GetVectorElt(line, value); 
-    vec(i++) = value; 
+  while ( std::getline(in, line) && (row < rows) && (col < cols)){
+    internal::GetDenseElt(line, value); 
+    //matrixmarket format is column major
+    mat(row,col) = value; 
+    row++;
+    if(row==rows){
+      row=0;
+      col++;
+    }
+    n++;
   }
   in.close();
-  if (i!=n){
+  if (n!=mat.size()){
     std::cerr<< "Unable to read all elements from file " << filename << "\n";
     return false;
   }
   return true;
 }
+/**
+ * \ingroup SparseExtra_Module
+ * @brief Same functionality as loadMarketDense, deprecated
+ */
+template<typename VectorType>
+bool loadMarketVector(VectorType& vec, const std::string& filename)
+{
+ return loadMarketDense(vec, filename);
+}
 
+/**
+ * \ingroup SparseExtra_Module
+ * @brief writes a sparse Matrix to a marketmarket format file
+ * 
+ * @tparam SparseMatrixType to write to file
+ * @param mat matrix to write to file
+ * @param filename filename to write to 
+ * @param sym at the moment no symmetry operations are supported
+ * @return true if writing succeeded
+ */
 template<typename SparseMatrixType>
 bool saveMarket(const SparseMatrixType& mat, const std::string& filename, int sym = 0)
 {
@@ -254,11 +331,22 @@
   return true;
 }
 
-template<typename VectorType>
-bool saveMarketVector (const VectorType& vec, const std::string& filename)
+
+/**
+ * \ingroup SparseExtra_Module
+ * @brief writes a dense Matrix or vector to a marketmarket format file
+ * 
+ * @tparam DenseMatrixType to write to file
+ * @param mat matrix to write to file
+ * @param filename filename to write to 
+ * @return true if writing succeeded
+ */
+
+template<typename DenseType>
+bool saveMarketDense (const DenseType& mat, const std::string& filename)
 {
- typedef typename VectorType::Scalar Scalar;
- typedef typename VectorType::RealScalar RealScalar;
+ typedef typename DenseType::Scalar Scalar;
+ typedef typename DenseType::RealScalar RealScalar;
  std::ofstream out(filename.c_str(),std::ios::out);
   if(!out)
     return false;
@@ -269,14 +357,26 @@
       out << "%%MatrixMarket matrix array complex general\n"; 
   else
     out << "%%MatrixMarket matrix array real general\n"; 
-  out << vec.size() << " "<< 1 << "\n";
-  for (int i=0; i < vec.size(); i++){
-    internal::putVectorElt(vec(i), out); 
+  out << mat.rows() << " "<< mat.cols() << "\n";
+  for (Index i=0; i < mat.cols(); i++){
+    for (Index j=0; j < mat.rows(); j++){
+      internal::putDenseElt(mat(j,i), out); 
+    }
   }
   out.close();
   return true; 
 }
 
+/**
+ * \ingroup SparseExtra_Module
+ * @brief Same functionality as saveMarketDense, deprecated
+ */
+template<typename VectorType>
+bool saveMarketVector (const VectorType& vec, const std::string& filename)
+{
+  return saveMarketDense(vec, filename);
+}
+
 } // end namespace Eigen
 
 #endif // EIGEN_SPARSE_MARKET_IO_H
diff --git a/unsupported/Eigen/src/SparseExtra/RandomSetter.h b/unsupported/Eigen/src/SparseExtra/RandomSetter.h
index 985702b..f6ab095 100644
--- a/unsupported/Eigen/src/SparseExtra/RandomSetter.h
+++ b/unsupported/Eigen/src/SparseExtra/RandomSetter.h
@@ -33,21 +33,8 @@
   static void setInvalidKey(Type&, const KeyType&) {}
 };
 
-#ifdef EIGEN_UNORDERED_MAP_SUPPORT
+
 /** Represents a std::unordered_map
-  *
-  * To use it you need to both define EIGEN_UNORDERED_MAP_SUPPORT and include the unordered_map header file
-  * yourself making sure that unordered_map is defined in the std namespace.
-  *
-  * For instance, with current version of gcc you can either enable C++0x standard (-std=c++0x) or do:
-  * \code
-  * #include <tr1/unordered_map>
-  * #define EIGEN_UNORDERED_MAP_SUPPORT
-  * namespace std {
-  *   using std::tr1::unordered_map;
-  * }
-  * \endcode
-  *
   * \see RandomSetter
   */
 template<typename Scalar> struct StdUnorderedMapTraits
@@ -60,7 +47,6 @@
 
   static void setInvalidKey(Type&, const KeyType&) {}
 };
-#endif // EIGEN_UNORDERED_MAP_SUPPORT
 
 #if defined(EIGEN_GOOGLEHASH_SUPPORT)
 
@@ -115,7 +101,7 @@
 #endif
 
 /** \class RandomSetter
-  *
+  * \ingroup SparseExtra_Module
   * \brief The RandomSetter is a wrapper object allowing to set/update a sparse matrix with random access
   *
   * \tparam SparseMatrixType the type of the sparse matrix we are updating
@@ -149,12 +135,12 @@
   *
   * The possible values for the template parameter MapTraits are:
   *  - \b StdMapTraits: corresponds to std::map. (does not perform very well)
-  *  - \b GnuHashMapTraits: corresponds to __gnu_cxx::hash_map (available only with GCC)
+  *  - \b StdUnorderedMapTraits: corresponds to std::unordered_map
   *  - \b GoogleDenseHashMapTraits: corresponds to google::dense_hash_map (best efficiency, reasonable memory consumption)
   *  - \b GoogleSparseHashMapTraits: corresponds to google::sparse_hash_map (best memory consumption, relatively good performance)
   *
   * The default map implementation depends on the availability, and the preferred order is:
-  * GoogleSparseHashMapTraits, GnuHashMapTraits, and finally StdMapTraits.
+  * GoogleSparseHashMapTraits, StdUnorderedMapTraits, and finally StdMapTraits.
   *
   * For performance and memory consumption reasons it is highly recommended to use one of
   * Google's hash_map implementations. To enable the support for them, you must define
@@ -167,10 +153,8 @@
          template <typename T> class MapTraits =
 #if defined(EIGEN_GOOGLEHASH_SUPPORT)
           GoogleDenseHashMapTraits
-#elif defined(_HASH_MAP)
-          GnuHashMapTraits
 #else
-          StdMapTraits
+          StdUnorderedMapTraits
 #endif
          ,int OuterPacketBits = 6>
 class RandomSetter
diff --git a/unsupported/Eigen/src/Splines/Spline.h b/unsupported/Eigen/src/Splines/Spline.h
index 79edd52..e61ee30 100644
--- a/unsupported/Eigen/src/Splines/Spline.h
+++ b/unsupported/Eigen/src/Splines/Spline.h
@@ -25,18 +25,18 @@
      *   C(u) & = \sum_{i=0}^{n}N_{i,p}(u)P_i
      * \f}
      *
-     * \tparam _Scalar The underlying data type (typically float or double)
-     * \tparam _Dim The curve dimension (e.g. 2 or 3)
+     * \tparam Scalar_ The underlying data type (typically float or double)
+     * \tparam Dim_ The curve dimension (e.g. 2 or 3)
      * \tparam _Degree Per default set to Dynamic; could be set to the actual desired
      *                degree for optimization purposes (would result in stack allocation
      *                of several temporary variables).
      **/
-  template <typename _Scalar, int _Dim, int _Degree>
+  template <typename Scalar_, int Dim_, int _Degree>
   class Spline
   {
   public:
-    typedef _Scalar Scalar; /*!< The spline curve's scalar type. */
-    enum { Dimension = _Dim /*!< The spline curve's dimension. */ };
+    typedef Scalar_ Scalar; /*!< The spline curve's scalar type. */
+    enum { Dimension = Dim_ /*!< The spline curve's dimension. */ };
     enum { Degree = _Degree /*!< The spline curve's degree. */ };
 
     /** \brief The point type the spline is representing. */
@@ -223,18 +223,18 @@
 
     template <typename DerivativeType>
     static void BasisFunctionDerivativesImpl(
-      const typename Spline<_Scalar, _Dim, _Degree>::Scalar u,
+      const typename Spline<Scalar_, Dim_, _Degree>::Scalar u,
       const DenseIndex order,
       const DenseIndex p, 
-      const typename Spline<_Scalar, _Dim, _Degree>::KnotVectorType& U,
+      const typename Spline<Scalar_, Dim_, _Degree>::KnotVectorType& U,
       DerivativeType& N_);
   };
 
-  template <typename _Scalar, int _Dim, int _Degree>
-  DenseIndex Spline<_Scalar, _Dim, _Degree>::Span(
-    typename SplineTraits< Spline<_Scalar, _Dim, _Degree> >::Scalar u,
+  template <typename Scalar_, int Dim_, int _Degree>
+  DenseIndex Spline<Scalar_, Dim_, _Degree>::Span(
+    typename SplineTraits< Spline<Scalar_, Dim_, _Degree> >::Scalar u,
     DenseIndex degree,
-    const typename SplineTraits< Spline<_Scalar, _Dim, _Degree> >::KnotVectorType& knots)
+    const typename SplineTraits< Spline<Scalar_, Dim_, _Degree> >::KnotVectorType& knots)
   {
     // Piegl & Tiller, "The NURBS Book", A2.1 (p. 68)
     if (u <= knots(0)) return degree;
@@ -242,12 +242,12 @@
     return static_cast<DenseIndex>( std::distance(knots.data(), pos) - 1 );
   }
 
-  template <typename _Scalar, int _Dim, int _Degree>
-  typename Spline<_Scalar, _Dim, _Degree>::BasisVectorType
-    Spline<_Scalar, _Dim, _Degree>::BasisFunctions(
-    typename Spline<_Scalar, _Dim, _Degree>::Scalar u,
+  template <typename Scalar_, int Dim_, int _Degree>
+  typename Spline<Scalar_, Dim_, _Degree>::BasisVectorType
+    Spline<Scalar_, Dim_, _Degree>::BasisFunctions(
+    typename Spline<Scalar_, Dim_, _Degree>::Scalar u,
     DenseIndex degree,
-    const typename Spline<_Scalar, _Dim, _Degree>::KnotVectorType& knots)
+    const typename Spline<Scalar_, Dim_, _Degree>::KnotVectorType& knots)
   {
     const DenseIndex p = degree;
     const DenseIndex i = Spline::Span(u, degree, knots);
@@ -276,8 +276,8 @@
     return N;
   }
 
-  template <typename _Scalar, int _Dim, int _Degree>
-  DenseIndex Spline<_Scalar, _Dim, _Degree>::degree() const
+  template <typename Scalar_, int Dim_, int _Degree>
+  DenseIndex Spline<Scalar_, Dim_, _Degree>::degree() const
   {
     if (_Degree == Dynamic)
       return m_knots.size() - m_ctrls.cols() - 1;
@@ -285,14 +285,14 @@
       return _Degree;
   }
 
-  template <typename _Scalar, int _Dim, int _Degree>
-  DenseIndex Spline<_Scalar, _Dim, _Degree>::span(Scalar u) const
+  template <typename Scalar_, int Dim_, int _Degree>
+  DenseIndex Spline<Scalar_, Dim_, _Degree>::span(Scalar u) const
   {
     return Spline::Span(u, degree(), knots());
   }
 
-  template <typename _Scalar, int _Dim, int _Degree>
-  typename Spline<_Scalar, _Dim, _Degree>::PointType Spline<_Scalar, _Dim, _Degree>::operator()(Scalar u) const
+  template <typename Scalar_, int Dim_, int _Degree>
+  typename Spline<Scalar_, Dim_, _Degree>::PointType Spline<Scalar_, Dim_, _Degree>::operator()(Scalar u) const
   {
     enum { Order = SplineTraits<Spline>::OrderAtCompileTime };
 
@@ -337,28 +337,28 @@
     }
   }
 
-  template <typename _Scalar, int _Dim, int _Degree>
-  typename SplineTraits< Spline<_Scalar, _Dim, _Degree> >::DerivativeType
-    Spline<_Scalar, _Dim, _Degree>::derivatives(Scalar u, DenseIndex order) const
+  template <typename Scalar_, int Dim_, int _Degree>
+  typename SplineTraits< Spline<Scalar_, Dim_, _Degree> >::DerivativeType
+    Spline<Scalar_, Dim_, _Degree>::derivatives(Scalar u, DenseIndex order) const
   {
     typename SplineTraits< Spline >::DerivativeType res;
     derivativesImpl(*this, u, order, res);
     return res;
   }
 
-  template <typename _Scalar, int _Dim, int _Degree>
+  template <typename Scalar_, int Dim_, int _Degree>
   template <int DerivativeOrder>
-  typename SplineTraits< Spline<_Scalar, _Dim, _Degree>, DerivativeOrder >::DerivativeType
-    Spline<_Scalar, _Dim, _Degree>::derivatives(Scalar u, DenseIndex order) const
+  typename SplineTraits< Spline<Scalar_, Dim_, _Degree>, DerivativeOrder >::DerivativeType
+    Spline<Scalar_, Dim_, _Degree>::derivatives(Scalar u, DenseIndex order) const
   {
     typename SplineTraits< Spline, DerivativeOrder >::DerivativeType res;
     derivativesImpl(*this, u, order, res);
     return res;
   }
 
-  template <typename _Scalar, int _Dim, int _Degree>
-  typename SplineTraits< Spline<_Scalar, _Dim, _Degree> >::BasisVectorType
-    Spline<_Scalar, _Dim, _Degree>::basisFunctions(Scalar u) const
+  template <typename Scalar_, int Dim_, int _Degree>
+  typename SplineTraits< Spline<Scalar_, Dim_, _Degree> >::BasisVectorType
+    Spline<Scalar_, Dim_, _Degree>::basisFunctions(Scalar u) const
   {
     return Spline::BasisFunctions(u, degree(), knots());
   }
@@ -366,16 +366,16 @@
   /* --------------------------------------------------------------------------------------------- */
   
   
-  template <typename _Scalar, int _Dim, int _Degree>
+  template <typename Scalar_, int Dim_, int _Degree>
   template <typename DerivativeType>
-  void Spline<_Scalar, _Dim, _Degree>::BasisFunctionDerivativesImpl(
-    const typename Spline<_Scalar, _Dim, _Degree>::Scalar u,
+  void Spline<Scalar_, Dim_, _Degree>::BasisFunctionDerivativesImpl(
+    const typename Spline<Scalar_, Dim_, _Degree>::Scalar u,
     const DenseIndex order,
     const DenseIndex p, 
-    const typename Spline<_Scalar, _Dim, _Degree>::KnotVectorType& U,
+    const typename Spline<Scalar_, Dim_, _Degree>::KnotVectorType& U,
     DerivativeType& N_)
   {
-    typedef Spline<_Scalar, _Dim, _Degree> SplineType;
+    typedef Spline<Scalar_, Dim_, _Degree> SplineType;
     enum { Order = SplineTraits<SplineType>::OrderAtCompileTime };
 
     const DenseIndex span = SplineType::Span(u, p, U);
@@ -471,32 +471,32 @@
     }
   }
 
-  template <typename _Scalar, int _Dim, int _Degree>
-  typename SplineTraits< Spline<_Scalar, _Dim, _Degree> >::BasisDerivativeType
-    Spline<_Scalar, _Dim, _Degree>::basisFunctionDerivatives(Scalar u, DenseIndex order) const
+  template <typename Scalar_, int Dim_, int _Degree>
+  typename SplineTraits< Spline<Scalar_, Dim_, _Degree> >::BasisDerivativeType
+    Spline<Scalar_, Dim_, _Degree>::basisFunctionDerivatives(Scalar u, DenseIndex order) const
   {
-    typename SplineTraits<Spline<_Scalar, _Dim, _Degree> >::BasisDerivativeType der;
+    typename SplineTraits<Spline<Scalar_, Dim_, _Degree> >::BasisDerivativeType der;
     BasisFunctionDerivativesImpl(u, order, degree(), knots(), der);
     return der;
   }
 
-  template <typename _Scalar, int _Dim, int _Degree>
+  template <typename Scalar_, int Dim_, int _Degree>
   template <int DerivativeOrder>
-  typename SplineTraits< Spline<_Scalar, _Dim, _Degree>, DerivativeOrder >::BasisDerivativeType
-    Spline<_Scalar, _Dim, _Degree>::basisFunctionDerivatives(Scalar u, DenseIndex order) const
+  typename SplineTraits< Spline<Scalar_, Dim_, _Degree>, DerivativeOrder >::BasisDerivativeType
+    Spline<Scalar_, Dim_, _Degree>::basisFunctionDerivatives(Scalar u, DenseIndex order) const
   {
-    typename SplineTraits< Spline<_Scalar, _Dim, _Degree>, DerivativeOrder >::BasisDerivativeType der;
+    typename SplineTraits< Spline<Scalar_, Dim_, _Degree>, DerivativeOrder >::BasisDerivativeType der;
     BasisFunctionDerivativesImpl(u, order, degree(), knots(), der);
     return der;
   }
 
-  template <typename _Scalar, int _Dim, int _Degree>
-  typename SplineTraits<Spline<_Scalar, _Dim, _Degree> >::BasisDerivativeType
-  Spline<_Scalar, _Dim, _Degree>::BasisFunctionDerivatives(
-    const typename Spline<_Scalar, _Dim, _Degree>::Scalar u,
+  template <typename Scalar_, int Dim_, int _Degree>
+  typename SplineTraits<Spline<Scalar_, Dim_, _Degree> >::BasisDerivativeType
+  Spline<Scalar_, Dim_, _Degree>::BasisFunctionDerivatives(
+    const typename Spline<Scalar_, Dim_, _Degree>::Scalar u,
     const DenseIndex order,
     const DenseIndex degree,
-    const typename Spline<_Scalar, _Dim, _Degree>::KnotVectorType& knots)
+    const typename Spline<Scalar_, Dim_, _Degree>::KnotVectorType& knots)
   {
     typename SplineTraits<Spline>::BasisDerivativeType der;
     BasisFunctionDerivativesImpl(u, order, degree, knots, der);
diff --git a/unsupported/Eigen/src/Splines/SplineFwd.h b/unsupported/Eigen/src/Splines/SplineFwd.h
index 00d6b49..35b31f3 100644
--- a/unsupported/Eigen/src/Splines/SplineFwd.h
+++ b/unsupported/Eigen/src/Splines/SplineFwd.h
@@ -22,11 +22,11 @@
      * \ingroup Splines_Module
      * \brief Compile-time attributes of the Spline class for Dynamic degree.
      **/
-    template <typename _Scalar, int _Dim, int _Degree>
-    struct SplineTraits< Spline<_Scalar, _Dim, _Degree>, Dynamic >
+    template <typename Scalar_, int Dim_, int _Degree>
+    struct SplineTraits< Spline<Scalar_, Dim_, _Degree>, Dynamic >
     {
-      typedef _Scalar Scalar; /*!< The spline curve's scalar type. */
-      enum { Dimension = _Dim /*!< The spline curve's dimension. */ };
+      typedef Scalar_ Scalar; /*!< The spline curve's scalar type. */
+      enum { Dimension = Dim_ /*!< The spline curve's dimension. */ };
       enum { Degree = _Degree /*!< The spline curve's degree. */ };
 
       enum { OrderAtCompileTime = _Degree==Dynamic ? Dynamic : _Degree+1 /*!< The spline curve's order at compile-time. */ };
@@ -62,19 +62,19 @@
      *
      * The traits class inherits all attributes from the SplineTraits of Dynamic degree.
      **/
-    template < typename _Scalar, int _Dim, int _Degree, int _DerivativeOrder >
-    struct SplineTraits< Spline<_Scalar, _Dim, _Degree>, _DerivativeOrder > : public SplineTraits< Spline<_Scalar, _Dim, _Degree> >
+    template < typename Scalar_, int Dim_, int _Degree, int _DerivativeOrder >
+    struct SplineTraits< Spline<Scalar_, Dim_, _Degree>, _DerivativeOrder > : public SplineTraits< Spline<Scalar_, Dim_, _Degree> >
     {
       enum { OrderAtCompileTime = _Degree==Dynamic ? Dynamic : _Degree+1 /*!< The spline curve's order at compile-time. */ };
       enum { NumOfDerivativesAtCompileTime = _DerivativeOrder==Dynamic ? Dynamic : _DerivativeOrder+1 /*!< The number of derivatives defined for the current spline. */ };
       
-      enum { DerivativeMemoryLayout = _Dim==1 ? RowMajor : ColMajor /*!< The derivative type's memory layout. */ };
+      enum { DerivativeMemoryLayout = Dim_==1 ? RowMajor : ColMajor /*!< The derivative type's memory layout. */ };
 
       /** \brief The data type used to store the values of the basis function derivatives. */
-      typedef Array<_Scalar,Dynamic,Dynamic,RowMajor,NumOfDerivativesAtCompileTime,OrderAtCompileTime> BasisDerivativeType;
+      typedef Array<Scalar_,Dynamic,Dynamic,RowMajor,NumOfDerivativesAtCompileTime,OrderAtCompileTime> BasisDerivativeType;
       
       /** \brief The data type used to store the spline's derivative values. */      
-      typedef Array<_Scalar,_Dim,Dynamic,DerivativeMemoryLayout,_Dim,NumOfDerivativesAtCompileTime> DerivativeType;
+      typedef Array<Scalar_,Dim_,Dynamic,DerivativeMemoryLayout,Dim_,NumOfDerivativesAtCompileTime> DerivativeType;
     };
 
     /** \brief 2D float B-spline with dynamic degree. */
diff --git a/unsupported/doc/examples/SYCL/CMakeLists.txt b/unsupported/doc/examples/SYCL/CMakeLists.txt
index 1d0f721..863fc11 100644
--- a/unsupported/doc/examples/SYCL/CMakeLists.txt
+++ b/unsupported/doc/examples/SYCL/CMakeLists.txt
@@ -20,7 +20,6 @@
     set(CMAKE_CXX_COMPILER ${ComputeCpp_DEVICE_COMPILER_EXECUTABLE})
     string(REPLACE "-Wlogical-op" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
     string(REPLACE "-Wno-psabi" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
-    string(REPLACE "-ansi" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
   endif()
   list(APPEND COMPUTECPP_USER_FLAGS
       -DEIGEN_NO_ASSERTION_CHECKING=1
diff --git a/unsupported/test/CMakeLists.txt b/unsupported/test/CMakeLists.txt
index d30fa62..fffd001 100644
--- a/unsupported/test/CMakeLists.txt
+++ b/unsupported/test/CMakeLists.txt
@@ -26,11 +26,7 @@
 if(Adolc_FOUND)
   include_directories(${ADOLC_INCLUDES})
   ei_add_property(EIGEN_TESTED_BACKENDS "Adolc, ")
-  if(EIGEN_TEST_CXX11)
-    ei_add_test(forward_adolc "" ${ADOLC_LIBRARIES})
-  else()
-    message(STATUS "Adolc found, but tests require C++11 mode")
-  endif()
+  ei_add_test(forward_adolc "" ${ADOLC_LIBRARIES})
 else()
   ei_add_property(EIGEN_MISSING_BACKENDS "Adolc, ")
 endif()
@@ -56,10 +52,10 @@
 ei_add_test(EulerAngles)
 
 find_package(MPREAL)
-if(MPREAL_FOUND AND EIGEN_COMPILER_SUPPORT_CPP11)
+if(MPREAL_FOUND)
   ei_add_property(EIGEN_TESTED_BACKENDS "MPFR C++, ")
   include_directories(${MPREAL_INCLUDES})
-  ei_add_test(mpreal_support "-std=c++11" "${MPREAL_LIBRARIES}" )
+  ei_add_test(mpreal_support "" "${MPREAL_LIBRARIES}" )
 else()
   ei_add_property(EIGEN_MISSING_BACKENDS "MPFR C++, ")
 endif()
@@ -147,8 +143,8 @@
       add_definitions(-DEIGEN_SYCL_DISABLE_SKINNY=${EIGEN_SYCL_DISABLE_SKINNY})
     endif()
     if(EIGEN_SYCL_DISABLE_DOUBLE_BUFFER)
-    add_definitions(-DEIGEN_SYCL_DISABLE_DOUBLE_BUFFER=${EIGEN_SYCL_DISABLE_DOUBLE_BUFFER})
-  endif()
+      add_definitions(-DEIGEN_SYCL_DISABLE_DOUBLE_BUFFER=${EIGEN_SYCL_DISABLE_DOUBLE_BUFFER})
+    endif()
     if(EIGEN_SYCL_DISABLE_RANK1)
       add_definitions(-DEIGEN_SYCL_DISABLE_RANK1=${EIGEN_SYCL_DISABLE_RANK1})
     endif()
@@ -181,7 +177,6 @@
         set(CMAKE_CXX_COMPILER ${ComputeCpp_DEVICE_COMPILER_EXECUTABLE})
         string(REPLACE "-Wlogical-op" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
         string(REPLACE "-Wno-psabi" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
-        string(REPLACE "-ansi" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
       endif()
       list(APPEND COMPUTECPP_USER_FLAGS
           -DEIGEN_NO_ASSERTION_CHECKING=1
@@ -281,11 +276,11 @@
   ei_add_test(cxx11_tensor_thread_pool "-pthread" "${CMAKE_THREAD_LIBS_INIT}")
   ei_add_test(cxx11_tensor_trace)
   ei_add_test(cxx11_tensor_volume_patch)
-#  ei_add_test(cxx11_tensor_symmetry)
-if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8" AND NOT CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
-  # This test requires __uint128_t which is only available on 64bit systems
-  ei_add_test(cxx11_tensor_uint128)
-endif()
+  #  ei_add_test(cxx11_tensor_symmetry)
+  if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8" AND NOT CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
+    # This test requires __uint128_t which is only available on 64bit systems
+    ei_add_test(cxx11_tensor_uint128)
+  endif()
 
 endif()
 
@@ -295,12 +290,10 @@
   # Make sure to compile without the -pedantic, -Wundef, -Wnon-virtual-dtor
   # and -fno-check-new flags since they trigger thousands of compilation warnings
   # in the CUDA runtime
-  # Also remove -ansi that is incompatible with std=c++11.
   string(REPLACE "-pedantic" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
   string(REPLACE "-Wundef" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
   string(REPLACE "-Wnon-virtual-dtor" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
   string(REPLACE "-fno-check-new" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
-  string(REPLACE "-ansi" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
 
   message(STATUS "Flags used to compile cuda code: " ${CMAKE_CXX_FLAGS})
 
@@ -308,7 +301,6 @@
     set(CUDA_NVCC_FLAGS "-ccbin ${CMAKE_C_COMPILER}" CACHE STRING "nvcc flags" FORCE)
   endif()
   if(EIGEN_TEST_CUDA_CLANG)
-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
     string(APPEND CMAKE_CXX_FLAGS " --cuda-path=${CUDA_TOOLKIT_ROOT_DIR}")
     foreach(ARCH IN LISTS EIGEN_CUDA_COMPUTE_ARCH)
         string(APPEND CMAKE_CXX_FLAGS " --cuda-gpu-arch=sm_${ARCH}")
@@ -355,7 +347,6 @@
     ei_add_test(cxx11_tensor_random_gpu)
   endif()
 
-
   unset(EIGEN_ADD_TEST_FILENAME_EXTENSION)
 endif()
 
@@ -365,52 +356,45 @@
   set(HIP_PATH "/opt/rocm/hip" CACHE STRING "Path to the HIP installation.")
 
   if (EXISTS ${HIP_PATH})
-
     list(APPEND CMAKE_MODULE_PATH ${HIP_PATH}/cmake)
 
     find_package(HIP REQUIRED)
     if (HIP_FOUND)
-
       execute_process(COMMAND ${HIP_PATH}/bin/hipconfig --platform OUTPUT_VARIABLE HIP_PLATFORM)
 
       if ((${HIP_PLATFORM} STREQUAL "hcc") OR (${HIP_PLATFORM} STREQUAL "amd"))
+        include_directories(${CMAKE_CURRENT_BINARY_DIR})
+        include_directories(${HIP_PATH}/include)
 
-	include_directories(${CMAKE_CURRENT_BINARY_DIR})
-	include_directories(${HIP_PATH}/include)
+        set(EIGEN_ADD_TEST_FILENAME_EXTENSION  "cu")
+        #
+        # complex datatype is not yet supported by HIP
+        # so leaving out those tests for now
+        #
+        # ei_add_test(cxx11_tensor_complex_gpu)
+        # ei_add_test(cxx11_tensor_complex_cwise_ops_gpu)
+        #
+        ei_add_test(cxx11_tensor_reduction_gpu)
+        ei_add_test(cxx11_tensor_argmax_gpu)
+        ei_add_test(cxx11_tensor_cast_float16_gpu)
+        ei_add_test(cxx11_tensor_scan_gpu)
+        ei_add_test(cxx11_tensor_device)
 
-	set(EIGEN_ADD_TEST_FILENAME_EXTENSION  "cu")
-	#
-	# complex datatype is not yet supported by HIP
-	# so leaving out those tests for now
-	#
-	# ei_add_test(cxx11_tensor_complex_gpu)
-	# ei_add_test(cxx11_tensor_complex_cwise_ops_gpu)
-	#
-	ei_add_test(cxx11_tensor_reduction_gpu)
-	ei_add_test(cxx11_tensor_argmax_gpu)
-	ei_add_test(cxx11_tensor_cast_float16_gpu)
-	ei_add_test(cxx11_tensor_scan_gpu)
-	ei_add_test(cxx11_tensor_device)
+        ei_add_test(cxx11_tensor_gpu)
+        ei_add_test(cxx11_tensor_contract_gpu)
+        ei_add_test(cxx11_tensor_of_float16_gpu)
+        ei_add_test(cxx11_tensor_random_gpu)
 
-	ei_add_test(cxx11_tensor_gpu)
-	ei_add_test(cxx11_tensor_contract_gpu)
-	ei_add_test(cxx11_tensor_of_float16_gpu)
-	ei_add_test(cxx11_tensor_random_gpu)
-
-	unset(EIGEN_ADD_TEST_FILENAME_EXTENSION)
+        unset(EIGEN_ADD_TEST_FILENAME_EXTENSION)
 
       elseif ((${HIP_PLATFORM} STREQUAL "nvcc") OR (${HIP_PLATFORM} STREQUAL "nvidia"))
-	message(FATAL_ERROR "HIP_PLATFORM = nvcc is not supported within Eigen")
+        message(FATAL_ERROR "HIP_PLATFORM = nvcc is not supported within Eigen")
       else ()
-	message(FATAL_ERROR "Unknown HIP_PLATFORM = ${HIP_PLATFORM}")
+        message(FATAL_ERROR "Unknown HIP_PLATFORM = ${HIP_PLATFORM}")
       endif()
-
     endif()
-
   else ()
-
     message(FATAL_ERROR "EIGEN_TEST_HIP is ON, but the specified HIP_PATH (${HIP_PATH}) does not exist")
-
   endif()
 
 endif()
diff --git a/unsupported/test/NonLinearOptimization.cpp b/unsupported/test/NonLinearOptimization.cpp
index c667b72..f1c1384 100644
--- a/unsupported/test/NonLinearOptimization.cpp
+++ b/unsupported/test/NonLinearOptimization.cpp
@@ -113,10 +113,10 @@
 }
 
 // Generic functor
-template<typename _Scalar, int NX=Dynamic, int NY=Dynamic>
+template<typename Scalar_, int NX=Dynamic, int NY=Dynamic>
 struct Functor
 {
-  typedef _Scalar Scalar;
+  typedef Scalar_ Scalar;
   enum {
     InputsAtCompileTime = NX,
     ValuesAtCompileTime = NY
diff --git a/unsupported/test/NumericalDiff.cpp b/unsupported/test/NumericalDiff.cpp
index 6d83641..96e7f19 100644
--- a/unsupported/test/NumericalDiff.cpp
+++ b/unsupported/test/NumericalDiff.cpp
@@ -9,10 +9,10 @@
 #include <unsupported/Eigen/NumericalDiff>
     
 // Generic functor
-template<typename _Scalar, int NX=Dynamic, int NY=Dynamic>
+template<typename Scalar_, int NX=Dynamic, int NY=Dynamic>
 struct Functor
 {
-  typedef _Scalar Scalar;
+  typedef Scalar_ Scalar;
   enum {
     InputsAtCompileTime = NX,
     ValuesAtCompileTime = NY
diff --git a/unsupported/test/autodiff.cpp b/unsupported/test/autodiff.cpp
index 2cea56b..fded7b8 100644
--- a/unsupported/test/autodiff.cpp
+++ b/unsupported/test/autodiff.cpp
@@ -29,10 +29,10 @@
   return (p-Vector(Scalar(-1),Scalar(1.))).norm() + (p.array() * p.array()).sum() + p.dot(p);
 }
 
-template<typename _Scalar, int NX=Dynamic, int NY=Dynamic>
+template<typename Scalar_, int NX=Dynamic, int NY=Dynamic>
 struct TestFunc1
 {
-  typedef _Scalar Scalar;
+  typedef Scalar_ Scalar;
   enum {
     InputsAtCompileTime = NX,
     ValuesAtCompileTime = NY
diff --git a/unsupported/test/cxx11_tensor_argmax.cpp b/unsupported/test/cxx11_tensor_argmax.cpp
index 4a0c896..8be622b 100644
--- a/unsupported/test/cxx11_tensor_argmax.cpp
+++ b/unsupported/test/cxx11_tensor_argmax.cpp
@@ -14,57 +14,57 @@
 
 using Eigen::Tensor;
 using Eigen::array;
-using Eigen::Tuple;
+using Eigen::Pair;
 
 template <int DataLayout>
-static void test_simple_index_tuples()
+static void test_simple_index_pairs()
 {
   Tensor<float, 4, DataLayout> tensor(2,3,5,7);
   tensor.setRandom();
   tensor = (tensor + tensor.constant(0.5)).log();
 
-  Tensor<Tuple<DenseIndex, float>, 4, DataLayout> index_tuples(2,3,5,7);
-  index_tuples = tensor.index_tuples();
+  Tensor<Pair<DenseIndex, float>, 4, DataLayout> index_pairs(2,3,5,7);
+  index_pairs = tensor.index_pairs();
 
   for (DenseIndex n = 0; n < 2*3*5*7; ++n) {
-    const Tuple<DenseIndex, float>& v = index_tuples.coeff(n);
+    const Pair<DenseIndex, float>& v = index_pairs.coeff(n);
     VERIFY_IS_EQUAL(v.first, n);
     VERIFY_IS_EQUAL(v.second, tensor.coeff(n));
   }
 }
 
 template <int DataLayout>
-static void test_index_tuples_dim()
+static void test_index_pairs_dim()
 {
   Tensor<float, 4, DataLayout> tensor(2,3,5,7);
   tensor.setRandom();
   tensor = (tensor + tensor.constant(0.5)).log();
 
-  Tensor<Tuple<DenseIndex, float>, 4, DataLayout> index_tuples(2,3,5,7);
+  Tensor<Pair<DenseIndex, float>, 4, DataLayout> index_pairs(2,3,5,7);
 
-  index_tuples = tensor.index_tuples();
+  index_pairs = tensor.index_pairs();
 
   for (Eigen::DenseIndex n = 0; n < tensor.size(); ++n) {
-    const Tuple<DenseIndex, float>& v = index_tuples(n); //(i, j, k, l);
+    const Pair<DenseIndex, float>& v = index_pairs(n); //(i, j, k, l);
     VERIFY_IS_EQUAL(v.first, n);
     VERIFY_IS_EQUAL(v.second, tensor(n));
   }
 }
 
 template <int DataLayout>
-static void test_argmax_tuple_reducer()
+static void test_argmax_pair_reducer()
 {
   Tensor<float, 4, DataLayout> tensor(2,3,5,7);
   tensor.setRandom();
   tensor = (tensor + tensor.constant(0.5)).log();
 
-  Tensor<Tuple<DenseIndex, float>, 4, DataLayout> index_tuples(2,3,5,7);
-  index_tuples = tensor.index_tuples();
+  Tensor<Pair<DenseIndex, float>, 4, DataLayout> index_pairs(2,3,5,7);
+  index_pairs = tensor.index_pairs();
 
-  Tensor<Tuple<DenseIndex, float>, 0, DataLayout> reduced;
+  Tensor<Pair<DenseIndex, float>, 0, DataLayout> reduced;
   DimensionList<DenseIndex, 4> dims;
-  reduced = index_tuples.reduce(
-      dims, internal::ArgMaxTupleReducer<Tuple<DenseIndex, float> >());
+  reduced = index_pairs.reduce(
+      dims, internal::ArgMaxPairReducer<Pair<DenseIndex, float> >());
 
   Tensor<float, 0, DataLayout> maxi = tensor.maximum();
 
@@ -72,9 +72,9 @@
 
   array<DenseIndex, 3> reduce_dims;
   for (int d = 0; d < 3; ++d) reduce_dims[d] = d;
-  Tensor<Tuple<DenseIndex, float>, 1, DataLayout> reduced_by_dims(7);
-  reduced_by_dims = index_tuples.reduce(
-      reduce_dims, internal::ArgMaxTupleReducer<Tuple<DenseIndex, float> >());
+  Tensor<Pair<DenseIndex, float>, 1, DataLayout> reduced_by_dims(7);
+  reduced_by_dims = index_pairs.reduce(
+      reduce_dims, internal::ArgMaxPairReducer<Pair<DenseIndex, float> >());
 
   Tensor<float, 1, DataLayout> max_by_dims = tensor.maximum(reduce_dims);
 
@@ -84,19 +84,19 @@
 }
 
 template <int DataLayout>
-static void test_argmin_tuple_reducer()
+static void test_argmin_pair_reducer()
 {
   Tensor<float, 4, DataLayout> tensor(2,3,5,7);
   tensor.setRandom();
   tensor = (tensor + tensor.constant(0.5)).log();
 
-  Tensor<Tuple<DenseIndex, float>, 4, DataLayout> index_tuples(2,3,5,7);
-  index_tuples = tensor.index_tuples();
+  Tensor<Pair<DenseIndex, float>, 4, DataLayout> index_pairs(2,3,5,7);
+  index_pairs = tensor.index_pairs();
 
-  Tensor<Tuple<DenseIndex, float>, 0, DataLayout> reduced;
+  Tensor<Pair<DenseIndex, float>, 0, DataLayout> reduced;
   DimensionList<DenseIndex, 4> dims;
-  reduced = index_tuples.reduce(
-      dims, internal::ArgMinTupleReducer<Tuple<DenseIndex, float> >());
+  reduced = index_pairs.reduce(
+      dims, internal::ArgMinPairReducer<Pair<DenseIndex, float> >());
 
   Tensor<float, 0, DataLayout> mini = tensor.minimum();
 
@@ -104,9 +104,9 @@
 
   array<DenseIndex, 3> reduce_dims;
   for (int d = 0; d < 3; ++d) reduce_dims[d] = d;
-  Tensor<Tuple<DenseIndex, float>, 1, DataLayout> reduced_by_dims(7);
-  reduced_by_dims = index_tuples.reduce(
-      reduce_dims, internal::ArgMinTupleReducer<Tuple<DenseIndex, float> >());
+  Tensor<Pair<DenseIndex, float>, 1, DataLayout> reduced_by_dims(7);
+  reduced_by_dims = index_pairs.reduce(
+      reduce_dims, internal::ArgMinPairReducer<Pair<DenseIndex, float> >());
 
   Tensor<float, 1, DataLayout> min_by_dims = tensor.minimum(reduce_dims);
 
@@ -275,14 +275,14 @@
 
 EIGEN_DECLARE_TEST(cxx11_tensor_argmax)
 {
-  CALL_SUBTEST(test_simple_index_tuples<RowMajor>());
-  CALL_SUBTEST(test_simple_index_tuples<ColMajor>());
-  CALL_SUBTEST(test_index_tuples_dim<RowMajor>());
-  CALL_SUBTEST(test_index_tuples_dim<ColMajor>());
-  CALL_SUBTEST(test_argmax_tuple_reducer<RowMajor>());
-  CALL_SUBTEST(test_argmax_tuple_reducer<ColMajor>());
-  CALL_SUBTEST(test_argmin_tuple_reducer<RowMajor>());
-  CALL_SUBTEST(test_argmin_tuple_reducer<ColMajor>());
+  CALL_SUBTEST(test_simple_index_pairs<RowMajor>());
+  CALL_SUBTEST(test_simple_index_pairs<ColMajor>());
+  CALL_SUBTEST(test_index_pairs_dim<RowMajor>());
+  CALL_SUBTEST(test_index_pairs_dim<ColMajor>());
+  CALL_SUBTEST(test_argmax_pair_reducer<RowMajor>());
+  CALL_SUBTEST(test_argmax_pair_reducer<ColMajor>());
+  CALL_SUBTEST(test_argmin_pair_reducer<RowMajor>());
+  CALL_SUBTEST(test_argmin_pair_reducer<ColMajor>());
   CALL_SUBTEST(test_simple_argmax<RowMajor>());
   CALL_SUBTEST(test_simple_argmax<ColMajor>());
   CALL_SUBTEST(test_simple_argmin<RowMajor>());
diff --git a/unsupported/test/cxx11_tensor_expr.cpp b/unsupported/test/cxx11_tensor_expr.cpp
index 169fc18..27c2845 100644
--- a/unsupported/test/cxx11_tensor_expr.cpp
+++ b/unsupported/test/cxx11_tensor_expr.cpp
@@ -305,10 +305,10 @@
     const Scalar kNaN = std::numeric_limits<Scalar>::quiet_NaN();
     const Scalar kInf = std::numeric_limits<Scalar>::infinity();
     const Scalar kZero(0);
-    Tensor<Scalar, 1> vec_all_nan(size);
+    Tensor<Scalar, 1> vec_full_nan(size);
     Tensor<Scalar, 1> vec_one_nan(size);
     Tensor<Scalar, 1> vec_zero(size);
-    vec_all_nan.setConstant(kNaN);
+    vec_full_nan.setConstant(kNaN);
     vec_zero.setZero();
     vec_one_nan.setZero();
     vec_one_nan(size/2) = kNaN;
@@ -330,12 +330,12 @@
     // max(nan, 0) = nan
     // max(0, nan) = nan
     // max(0, 0) = 0
-    verify_all_nan(vec_all_nan.template cwiseMax<PropagateNaN>(kNaN));
-    verify_all_nan(vec_all_nan.template cwiseMax<PropagateNaN>(vec_all_nan));
-    verify_all_nan(vec_all_nan.template cwiseMax<PropagateNaN>(kZero));
-    verify_all_nan(vec_all_nan.template cwiseMax<PropagateNaN>(vec_zero));
+    verify_all_nan(vec_full_nan.template cwiseMax<PropagateNaN>(kNaN));
+    verify_all_nan(vec_full_nan.template cwiseMax<PropagateNaN>(vec_full_nan));
+    verify_all_nan(vec_full_nan.template cwiseMax<PropagateNaN>(kZero));
+    verify_all_nan(vec_full_nan.template cwiseMax<PropagateNaN>(vec_zero));
     verify_all_nan(vec_zero.template cwiseMax<PropagateNaN>(kNaN));
-    verify_all_nan(vec_zero.template cwiseMax<PropagateNaN>(vec_all_nan));
+    verify_all_nan(vec_zero.template cwiseMax<PropagateNaN>(vec_full_nan));
     verify_all_zero(vec_zero.template cwiseMax<PropagateNaN>(kZero));
     verify_all_zero(vec_zero.template cwiseMax<PropagateNaN>(vec_zero));
 
@@ -344,12 +344,12 @@
     // max(nan, 0) = 0
     // max(0, nan) = 0
     // max(0, 0) = 0
-    verify_all_nan(vec_all_nan.template cwiseMax<PropagateNumbers>(kNaN));
-    verify_all_nan(vec_all_nan.template cwiseMax<PropagateNumbers>(vec_all_nan));
-    verify_all_zero(vec_all_nan.template cwiseMax<PropagateNumbers>(kZero));
-    verify_all_zero(vec_all_nan.template cwiseMax<PropagateNumbers>(vec_zero));
+    verify_all_nan(vec_full_nan.template cwiseMax<PropagateNumbers>(kNaN));
+    verify_all_nan(vec_full_nan.template cwiseMax<PropagateNumbers>(vec_full_nan));
+    verify_all_zero(vec_full_nan.template cwiseMax<PropagateNumbers>(kZero));
+    verify_all_zero(vec_full_nan.template cwiseMax<PropagateNumbers>(vec_zero));
     verify_all_zero(vec_zero.template cwiseMax<PropagateNumbers>(kNaN));
-    verify_all_zero(vec_zero.template cwiseMax<PropagateNumbers>(vec_all_nan));
+    verify_all_zero(vec_zero.template cwiseMax<PropagateNumbers>(vec_full_nan));
     verify_all_zero(vec_zero.template cwiseMax<PropagateNumbers>(kZero));
     verify_all_zero(vec_zero.template cwiseMax<PropagateNumbers>(vec_zero));
 
@@ -358,12 +358,12 @@
     // min(nan, 0) = nan
     // min(0, nan) = nan
     // min(0, 0) = 0
-    verify_all_nan(vec_all_nan.template cwiseMin<PropagateNaN>(kNaN));
-    verify_all_nan(vec_all_nan.template cwiseMin<PropagateNaN>(vec_all_nan));
-    verify_all_nan(vec_all_nan.template cwiseMin<PropagateNaN>(kZero));
-    verify_all_nan(vec_all_nan.template cwiseMin<PropagateNaN>(vec_zero));
+    verify_all_nan(vec_full_nan.template cwiseMin<PropagateNaN>(kNaN));
+    verify_all_nan(vec_full_nan.template cwiseMin<PropagateNaN>(vec_full_nan));
+    verify_all_nan(vec_full_nan.template cwiseMin<PropagateNaN>(kZero));
+    verify_all_nan(vec_full_nan.template cwiseMin<PropagateNaN>(vec_zero));
     verify_all_nan(vec_zero.template cwiseMin<PropagateNaN>(kNaN));
-    verify_all_nan(vec_zero.template cwiseMin<PropagateNaN>(vec_all_nan));
+    verify_all_nan(vec_zero.template cwiseMin<PropagateNaN>(vec_full_nan));
     verify_all_zero(vec_zero.template cwiseMin<PropagateNaN>(kZero));
     verify_all_zero(vec_zero.template cwiseMin<PropagateNaN>(vec_zero));
 
@@ -372,12 +372,12 @@
     // min(nan, 0) = 0
     // min(0, nan) = 0
     // min(0, 0) = 0
-    verify_all_nan(vec_all_nan.template cwiseMin<PropagateNumbers>(kNaN));
-    verify_all_nan(vec_all_nan.template cwiseMin<PropagateNumbers>(vec_all_nan));
-    verify_all_zero(vec_all_nan.template cwiseMin<PropagateNumbers>(kZero));
-    verify_all_zero(vec_all_nan.template cwiseMin<PropagateNumbers>(vec_zero));
+    verify_all_nan(vec_full_nan.template cwiseMin<PropagateNumbers>(kNaN));
+    verify_all_nan(vec_full_nan.template cwiseMin<PropagateNumbers>(vec_full_nan));
+    verify_all_zero(vec_full_nan.template cwiseMin<PropagateNumbers>(kZero));
+    verify_all_zero(vec_full_nan.template cwiseMin<PropagateNumbers>(vec_zero));
     verify_all_zero(vec_zero.template cwiseMin<PropagateNumbers>(kNaN));
-    verify_all_zero(vec_zero.template cwiseMin<PropagateNumbers>(vec_all_nan));
+    verify_all_zero(vec_zero.template cwiseMin<PropagateNumbers>(vec_full_nan));
     verify_all_zero(vec_zero.template cwiseMin<PropagateNumbers>(kZero));
     verify_all_zero(vec_zero.template cwiseMin<PropagateNumbers>(vec_zero));
 
@@ -397,13 +397,13 @@
     VERIFY_IS_EQUAL(val(), kZero);
 
     // Test NaN propagation for tensor of all NaNs.
-    val = vec_all_nan.template minimum<PropagateNaN>();
+    val = vec_full_nan.template minimum<PropagateNaN>();
     VERIFY((numext::isnan)(val()));
-    val = vec_all_nan.template minimum<PropagateNumbers>();
+    val = vec_full_nan.template minimum<PropagateNumbers>();
     VERIFY_IS_EQUAL(val(), kInf);
-    val = vec_all_nan.template maximum<PropagateNaN>();
+    val = vec_full_nan.template maximum<PropagateNaN>();
     VERIFY((numext::isnan)(val()));
-    val = vec_all_nan.template maximum<PropagateNumbers>();
+    val = vec_full_nan.template maximum<PropagateNumbers>();
     VERIFY_IS_EQUAL(val(), -kInf);
 
     // Test NaN propagation for tensor with a single NaN.
diff --git a/unsupported/test/forward_adolc.cpp b/unsupported/test/forward_adolc.cpp
index 14a909d..27d09dd 100644
--- a/unsupported/test/forward_adolc.cpp
+++ b/unsupported/test/forward_adolc.cpp
@@ -20,10 +20,10 @@
   return (p-Vector(Scalar(-1),Scalar(1.))).norm() + (p.array().sqrt().abs() * p.array().sin()).sum() + p.dot(p);
 }
 
-template<typename _Scalar, int NX=Dynamic, int NY=Dynamic>
+template<typename Scalar_, int NX=Dynamic, int NY=Dynamic>
 struct TestFunc1
 {
-  typedef _Scalar Scalar;
+  typedef Scalar_ Scalar;
   enum {
     InputsAtCompileTime = NX,
     ValuesAtCompileTime = NY
diff --git a/unsupported/test/polynomialsolver.cpp b/unsupported/test/polynomialsolver.cpp
index 4ff9bda..4cf4bc2 100644
--- a/unsupported/test/polynomialsolver.cpp
+++ b/unsupported/test/polynomialsolver.cpp
@@ -179,13 +179,13 @@
 }
 
 
-template<typename _Scalar, int _Deg>
+template<typename Scalar_, int _Deg>
 void polynomialsolver(int deg)
 {
-  typedef typename NumTraits<_Scalar>::Real RealScalar;
+  typedef typename NumTraits<Scalar_>::Real RealScalar;
   typedef internal::increment_if_fixed_size<_Deg>     Dim;
-  typedef Matrix<_Scalar,Dim::ret,1>                  PolynomialType;
-  typedef Matrix<_Scalar,_Deg,1>                      EvalRootsType;
+  typedef Matrix<Scalar_,Dim::ret,1>                  PolynomialType;
+  typedef Matrix<Scalar_,_Deg,1>                      EvalRootsType;
   typedef Matrix<RealScalar,_Deg,1>                   RealRootsType;
 
   cout << "Standard cases" << endl;
@@ -193,7 +193,7 @@
   evalSolver<_Deg,PolynomialType>( pols );
 
   cout << "Hard cases" << endl;
-  _Scalar multipleRoot = internal::random<_Scalar>();
+  Scalar_ multipleRoot = internal::random<Scalar_>();
   EvalRootsType allRoots = EvalRootsType::Constant(deg,multipleRoot);
   roots_to_monicPolynomial( allRoots, pols );
   evalSolver<_Deg,PolynomialType>( pols );
diff --git a/unsupported/test/polynomialutils.cpp b/unsupported/test/polynomialutils.cpp
index 8ff4519..fb86913 100644
--- a/unsupported/test/polynomialutils.cpp
+++ b/unsupported/test/polynomialutils.cpp
@@ -25,12 +25,12 @@
 }
 }
 
-template<typename _Scalar, int _Deg>
+template<typename Scalar_, int _Deg>
 void realRoots_to_monicPolynomial_test(int deg)
 {
   typedef internal::increment_if_fixed_size<_Deg>            Dim;
-  typedef Matrix<_Scalar,Dim::ret,1>                  PolynomialType;
-  typedef Matrix<_Scalar,_Deg,1>                      EvalRootsType;
+  typedef Matrix<Scalar_,Dim::ret,1>                  PolynomialType;
+  typedef Matrix<Scalar_,_Deg,1>                      EvalRootsType;
 
   PolynomialType pols(deg+1);
   EvalRootsType roots = EvalRootsType::Random(deg);
@@ -40,43 +40,43 @@
   for( int i=0; i<roots.size(); ++i ){
     evr[i] = std::abs( poly_eval( pols, roots[i] ) ); }
 
-  bool evalToZero = evr.isZero( test_precision<_Scalar>() );
+  bool evalToZero = evr.isZero( test_precision<Scalar_>() );
   if( !evalToZero ){
     cerr << evr.transpose() << endl; }
   VERIFY( evalToZero );
 }
 
-template<typename _Scalar> void realRoots_to_monicPolynomial_scalar()
+template<typename Scalar_> void realRoots_to_monicPolynomial_scalar()
 {
-  CALL_SUBTEST_2( (realRoots_to_monicPolynomial_test<_Scalar,2>(2)) );
-  CALL_SUBTEST_3( (realRoots_to_monicPolynomial_test<_Scalar,3>(3)) );
-  CALL_SUBTEST_4( (realRoots_to_monicPolynomial_test<_Scalar,4>(4)) );
-  CALL_SUBTEST_5( (realRoots_to_monicPolynomial_test<_Scalar,5>(5)) );
-  CALL_SUBTEST_6( (realRoots_to_monicPolynomial_test<_Scalar,6>(6)) );
-  CALL_SUBTEST_7( (realRoots_to_monicPolynomial_test<_Scalar,7>(7)) );
-  CALL_SUBTEST_8( (realRoots_to_monicPolynomial_test<_Scalar,17>(17)) );
+  CALL_SUBTEST_2( (realRoots_to_monicPolynomial_test<Scalar_,2>(2)) );
+  CALL_SUBTEST_3( (realRoots_to_monicPolynomial_test<Scalar_,3>(3)) );
+  CALL_SUBTEST_4( (realRoots_to_monicPolynomial_test<Scalar_,4>(4)) );
+  CALL_SUBTEST_5( (realRoots_to_monicPolynomial_test<Scalar_,5>(5)) );
+  CALL_SUBTEST_6( (realRoots_to_monicPolynomial_test<Scalar_,6>(6)) );
+  CALL_SUBTEST_7( (realRoots_to_monicPolynomial_test<Scalar_,7>(7)) );
+  CALL_SUBTEST_8( (realRoots_to_monicPolynomial_test<Scalar_,17>(17)) );
 
-  CALL_SUBTEST_9( (realRoots_to_monicPolynomial_test<_Scalar,Dynamic>(
+  CALL_SUBTEST_9( (realRoots_to_monicPolynomial_test<Scalar_,Dynamic>(
           internal::random<int>(18,26) )) );
 }
 
 
 
 
-template<typename _Scalar, int _Deg>
+template<typename Scalar_, int _Deg>
 void CauchyBounds(int deg)
 {
   typedef internal::increment_if_fixed_size<_Deg>            Dim;
-  typedef Matrix<_Scalar,Dim::ret,1>                  PolynomialType;
-  typedef Matrix<_Scalar,_Deg,1>                      EvalRootsType;
+  typedef Matrix<Scalar_,Dim::ret,1>                  PolynomialType;
+  typedef Matrix<Scalar_,_Deg,1>                      EvalRootsType;
 
   PolynomialType pols(deg+1);
   EvalRootsType roots = EvalRootsType::Random(deg);
   roots_to_monicPolynomial( roots, pols );
-  _Scalar M = cauchy_max_bound( pols );
-  _Scalar m = cauchy_min_bound( pols );
-  _Scalar Max = roots.array().abs().maxCoeff();
-  _Scalar min = roots.array().abs().minCoeff();
+  Scalar_ M = cauchy_max_bound( pols );
+  Scalar_ m = cauchy_min_bound( pols );
+  Scalar_ Max = roots.array().abs().maxCoeff();
+  Scalar_ min = roots.array().abs().minCoeff();
   bool eval = (M >= Max) && (m <= min);
   if( !eval )
   {
@@ -87,17 +87,17 @@
   VERIFY( eval );
 }
 
-template<typename _Scalar> void CauchyBounds_scalar()
+template<typename Scalar_> void CauchyBounds_scalar()
 {
-  CALL_SUBTEST_2( (CauchyBounds<_Scalar,2>(2)) );
-  CALL_SUBTEST_3( (CauchyBounds<_Scalar,3>(3)) );
-  CALL_SUBTEST_4( (CauchyBounds<_Scalar,4>(4)) );
-  CALL_SUBTEST_5( (CauchyBounds<_Scalar,5>(5)) );
-  CALL_SUBTEST_6( (CauchyBounds<_Scalar,6>(6)) );
-  CALL_SUBTEST_7( (CauchyBounds<_Scalar,7>(7)) );
-  CALL_SUBTEST_8( (CauchyBounds<_Scalar,17>(17)) );
+  CALL_SUBTEST_2( (CauchyBounds<Scalar_,2>(2)) );
+  CALL_SUBTEST_3( (CauchyBounds<Scalar_,3>(3)) );
+  CALL_SUBTEST_4( (CauchyBounds<Scalar_,4>(4)) );
+  CALL_SUBTEST_5( (CauchyBounds<Scalar_,5>(5)) );
+  CALL_SUBTEST_6( (CauchyBounds<Scalar_,6>(6)) );
+  CALL_SUBTEST_7( (CauchyBounds<Scalar_,7>(7)) );
+  CALL_SUBTEST_8( (CauchyBounds<Scalar_,17>(17)) );
 
-  CALL_SUBTEST_9( (CauchyBounds<_Scalar,Dynamic>(
+  CALL_SUBTEST_9( (CauchyBounds<Scalar_,Dynamic>(
           internal::random<int>(18,26) )) );
 }
 
diff --git a/unsupported/test/sparse_extra.cpp b/unsupported/test/sparse_extra.cpp
index cdfd10c..744545b 100644
--- a/unsupported/test/sparse_extra.cpp
+++ b/unsupported/test/sparse_extra.cpp
@@ -7,28 +7,14 @@
 // 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/.
 
-
-// import basic and product tests for deprecated DynamicSparseMatrix
-#if 0 // sparse_basic(DynamicSparseMatrix) does not compile at all -> disabled
-static long g_realloc_count = 0;
-#define EIGEN_SPARSE_COMPRESSED_STORAGE_REALLOCATE_PLUGIN g_realloc_count++;
-
-static long g_dense_op_sparse_count = 0;
-#define EIGEN_SPARSE_ASSIGNMENT_FROM_DENSE_OP_SPARSE_PLUGIN g_dense_op_sparse_count++;
-#define EIGEN_SPARSE_ASSIGNMENT_FROM_SPARSE_ADD_DENSE_PLUGIN g_dense_op_sparse_count+=10;
-#define EIGEN_SPARSE_ASSIGNMENT_FROM_SPARSE_SUB_DENSE_PLUGIN g_dense_op_sparse_count+=20;
-
-#define EIGEN_SPARSE_TEST_INCLUDED_FROM_SPARSE_EXTRA 1
-#endif
-
-#define EIGEN_NO_DEPRECATED_WARNING
-// Disable counting of temporaries, since sparse_product(DynamicSparseMatrix)
-// has an extra copy-assignment.
-#define EIGEN_SPARSE_PRODUCT_IGNORE_TEMPORARY_COUNT
 #include "sparse_product.cpp"
 
-#if 0 // sparse_basic(DynamicSparseMatrix) does not compile at all -> disabled
-#include "sparse_basic.cpp"
+#ifdef min
+#undef min
+#endif
+
+#ifdef max
+#undef max
 #endif
 
 #include <Eigen/SparseExtra>
@@ -51,21 +37,6 @@
   return sm.isApprox(ref);
 }
 
-template<typename SetterType,typename DenseType, typename T>
-bool test_random_setter(DynamicSparseMatrix<T>& sm, const DenseType& ref, const std::vector<Vector2i>& nonzeroCoords)
-{
-  sm.setZero();
-  std::vector<Vector2i> remaining = nonzeroCoords;
-  while(!remaining.empty())
-  {
-    int i = internal::random<int>(0,static_cast<int>(remaining.size())-1);
-    sm.coeffRef(remaining[i].x(),remaining[i].y()) = ref.coeff(remaining[i].x(),remaining[i].y());
-    remaining[i] = remaining.back();
-    remaining.pop_back();
-  }
-  return sm.isApprox(ref);
-}
-
 template<typename SparseMatrixType> void sparse_extra(const SparseMatrixType& ref)
 {
   const Index rows = ref.rows();
@@ -120,9 +91,7 @@
 //   VERIFY_IS_APPROX(m, refMat);
 
     VERIFY(( test_random_setter<RandomSetter<SparseMatrixType, StdMapTraits> >(m,refMat,nonzeroCoords) ));
-    #ifdef EIGEN_UNORDERED_MAP_SUPPORT
     VERIFY(( test_random_setter<RandomSetter<SparseMatrixType, StdUnorderedMapTraits> >(m,refMat,nonzeroCoords) ));
-    #endif
     #ifdef EIGEN_GOOGLEHASH_SUPPORT
     VERIFY(( test_random_setter<RandomSetter<SparseMatrixType, GoogleDenseHashMapTraits> >(m,refMat,nonzeroCoords) ));
     VERIFY(( test_random_setter<RandomSetter<SparseMatrixType, GoogleSparseHashMapTraits> >(m,refMat,nonzeroCoords) ));
@@ -146,6 +115,7 @@
 
 }
 
+
 template<typename SparseMatrixType>
 void check_marketio()
 {
@@ -170,6 +140,30 @@
   VERIFY_IS_EQUAL(v1,v2);
 }
 
+template<typename DenseMatrixType>
+void check_marketio_dense()
+{
+  Index rows=DenseMatrixType::MaxRowsAtCompileTime;
+  if (DenseMatrixType::MaxRowsAtCompileTime==Dynamic){
+    rows=internal::random<Index>(1,100);
+  }else if(DenseMatrixType::RowsAtCompileTime==Dynamic){
+    rows=internal::random<Index>(1,DenseMatrixType::MaxRowsAtCompileTime);
+  }
+
+  Index cols =DenseMatrixType::MaxColsAtCompileTime; 
+  if (DenseMatrixType::MaxColsAtCompileTime==Dynamic){
+    cols=internal::random<Index>(1,100);
+  }else if(DenseMatrixType::ColsAtCompileTime==Dynamic){
+    cols=internal::random<Index>(1,DenseMatrixType::MaxColsAtCompileTime);
+  }
+
+  DenseMatrixType m1, m2;
+  m1= DenseMatrixType::Random(rows,cols);
+  saveMarketDense(m1, "dense_extra.mtx");
+  loadMarketDense(m2, "dense_extra.mtx");
+  VERIFY_IS_EQUAL(m1,m2);
+}
+
 EIGEN_DECLARE_TEST(sparse_extra)
 {
   for(int i = 0; i < g_repeat; i++) {
@@ -178,22 +172,24 @@
     CALL_SUBTEST_2( sparse_extra(SparseMatrix<std::complex<double> >(s, s)) );
     CALL_SUBTEST_1( sparse_extra(SparseMatrix<double>(s, s)) );
 
-    CALL_SUBTEST_3( sparse_extra(DynamicSparseMatrix<double>(s, s)) );
-//    CALL_SUBTEST_3(( sparse_basic(DynamicSparseMatrix<double>(s, s)) ));
-//    CALL_SUBTEST_3(( sparse_basic(DynamicSparseMatrix<double,ColMajor,long int>(s, s)) ));
+    CALL_SUBTEST_3( (check_marketio<SparseMatrix<float,ColMajor,int> >()) );
+    CALL_SUBTEST_3( (check_marketio<SparseMatrix<double,ColMajor,int> >()) );
+    CALL_SUBTEST_3( (check_marketio<SparseMatrix<std::complex<float>,ColMajor,int> >()) );
+    CALL_SUBTEST_3( (check_marketio<SparseMatrix<std::complex<double>,ColMajor,int> >()) );
+    CALL_SUBTEST_3( (check_marketio<SparseMatrix<float,ColMajor,long int> >()) );
+    CALL_SUBTEST_3( (check_marketio<SparseMatrix<double,ColMajor,long int> >()) );
+    CALL_SUBTEST_3( (check_marketio<SparseMatrix<std::complex<float>,ColMajor,long int> >()) );
+    CALL_SUBTEST_3( (check_marketio<SparseMatrix<std::complex<double>,ColMajor,long int> >()) );
 
-    CALL_SUBTEST_3( (sparse_product<DynamicSparseMatrix<float, ColMajor> >()) );
-    CALL_SUBTEST_3( (sparse_product<DynamicSparseMatrix<float, RowMajor> >()) );
-
-    CALL_SUBTEST_4( (check_marketio<SparseMatrix<float,ColMajor,int> >()) );
-    CALL_SUBTEST_4( (check_marketio<SparseMatrix<double,ColMajor,int> >()) );
-    CALL_SUBTEST_4( (check_marketio<SparseMatrix<std::complex<float>,ColMajor,int> >()) );
-    CALL_SUBTEST_4( (check_marketio<SparseMatrix<std::complex<double>,ColMajor,int> >()) );
-    CALL_SUBTEST_4( (check_marketio<SparseMatrix<float,ColMajor,long int> >()) );
-    CALL_SUBTEST_4( (check_marketio<SparseMatrix<double,ColMajor,long int> >()) );
-    CALL_SUBTEST_4( (check_marketio<SparseMatrix<std::complex<float>,ColMajor,long int> >()) );
-    CALL_SUBTEST_4( (check_marketio<SparseMatrix<std::complex<double>,ColMajor,long int> >()) );
-
+    CALL_SUBTEST_4( (check_marketio_dense<Matrix<float,Dynamic,Dynamic> >()) );
+    CALL_SUBTEST_4( (check_marketio_dense<Matrix<float,Dynamic,Dynamic,RowMajor> >()) );
+    CALL_SUBTEST_4( (check_marketio_dense<Matrix<double,Dynamic,Dynamic> >()) );
+    CALL_SUBTEST_4( (check_marketio_dense<Matrix<std::complex<float>,Dynamic,Dynamic> >()) );
+    CALL_SUBTEST_4( (check_marketio_dense<Matrix<std::complex<double>,Dynamic,Dynamic> >()) );
+    CALL_SUBTEST_4( (check_marketio_dense<Matrix<float,Dynamic,3> >()) );
+    CALL_SUBTEST_4( (check_marketio_dense<Matrix<double,3,Dynamic> >()) );
+    CALL_SUBTEST_4( (check_marketio_dense<Matrix<double,3,4> >()) );
+    CALL_SUBTEST_4( (check_marketio_dense<Matrix<double,Dynamic,Dynamic,ColMajor,5,5> >()) );
 
     CALL_SUBTEST_5( (check_marketio_vector<Matrix<float,1,Dynamic> >()) );
     CALL_SUBTEST_5( (check_marketio_vector<Matrix<double,1,Dynamic> >()) );