generalized ei_traits<>.
Finally the importing macro is named EIGEN_BASIC_PUBLIC_INTERFACE
because it does not only import the ei_traits, it also makes the base class
a friend, etc.
diff --git a/Eigen/src/Core/Block.h b/Eigen/src/Core/Block.h
index f9f893f..8db636e 100644
--- a/Eigen/src/Core/Block.h
+++ b/Eigen/src/Core/Block.h
@@ -57,18 +57,27 @@
   * \sa MatrixBase::block(int,int,int,int), MatrixBase::block(int,int), class VectorBlock
   */
 template<typename MatrixType, int BlockRows, int BlockCols>
-struct Scalar<Block<MatrixType, BlockRows, BlockCols> >
-{ typedef typename Scalar<MatrixType>::Type Type; };
+struct ei_traits<Block<MatrixType, BlockRows, BlockCols> >
+{
+  typedef typename MatrixType::Scalar Scalar;
+  enum{
+    RowsAtCompileTime = MatrixType::RowsAtCompileTime == 1 ? 1 : BlockRows,
+    ColsAtCompileTime = MatrixType::ColsAtCompileTime == 1 ? 1 : BlockCols,
+    MaxRowsAtCompileTime = RowsAtCompileTime == 1 ? 1
+      : (BlockRows==Dynamic ? MatrixType::MaxRowsAtCompileTime : BlockRows),
+    MaxColsAtCompileTime = ColsAtCompileTime == 1 ? 1
+      : (BlockCols==Dynamic ? MatrixType::MaxColsAtCompileTime : BlockCols)
+  };
+};
 
 template<typename MatrixType, int BlockRows, int BlockCols> class Block
   : public MatrixBase<Block<MatrixType, BlockRows, BlockCols> >
 {
   public:
-    typedef typename Scalar<MatrixType>::Type Scalar;
+
+    EIGEN_BASIC_PUBLIC_INTERFACE(Block)
+
     typedef typename MatrixType::AsArg MatRef;
-    friend class MatrixBase<Block>;
-    friend class MatrixBase<Block>::Traits;
-    typedef MatrixBase<Block> Base;
 
     /** Fixed-size constructor
       */
@@ -97,14 +106,6 @@
     EIGEN_INHERIT_ASSIGNMENT_OPERATORS(Block)
 
   private:
-    enum{
-      RowsAtCompileTime = MatrixType::Traits::RowsAtCompileTime == 1 ? 1 : BlockRows,
-      ColsAtCompileTime = MatrixType::Traits::ColsAtCompileTime == 1 ? 1 : BlockCols,
-      MaxRowsAtCompileTime = RowsAtCompileTime == 1 ? 1
-        : (BlockRows==Dynamic ? MatrixType::Traits::MaxRowsAtCompileTime : BlockRows),
-      MaxColsAtCompileTime = ColsAtCompileTime == 1 ? 1
-        : (BlockCols==Dynamic ? MatrixType::Traits::MaxColsAtCompileTime : BlockCols)
-    };
 
     const Block& _asArg() const { return *this; }
     int _rows() const { return m_blockRows.value(); }
@@ -123,8 +124,8 @@
   protected:
 
     MatRef m_matrix;
-    IntAtRunTimeIfDynamic<MatrixType::Traits::RowsAtCompileTime == 1 ? 0 : Dynamic> m_startRow;
-    IntAtRunTimeIfDynamic<MatrixType::Traits::ColsAtCompileTime == 1 ? 0 : Dynamic> m_startCol;
+    IntAtRunTimeIfDynamic<MatrixType::RowsAtCompileTime == 1 ? 0 : Dynamic> m_startRow;
+    IntAtRunTimeIfDynamic<MatrixType::ColsAtCompileTime == 1 ? 0 : Dynamic> m_startCol;
     IntAtRunTimeIfDynamic<RowsAtCompileTime> m_blockRows;
     IntAtRunTimeIfDynamic<ColsAtCompileTime> m_blockCols;
 };
@@ -180,11 +181,11 @@
 Block<Derived> MatrixBase<Derived>
   ::block(int start, int size)
 {
-  assert(Traits::IsVectorAtCompileTime);
-  return Block<Derived>(asArg(), Traits::RowsAtCompileTime == 1 ? 0 : start,
-                               Traits::ColsAtCompileTime == 1 ? 0 : start,
-                               Traits::RowsAtCompileTime == 1 ? 1 : size,
-                               Traits::ColsAtCompileTime == 1 ? 1 : size);
+  assert(IsVectorAtCompileTime);
+  return Block<Derived>(asArg(), RowsAtCompileTime == 1 ? 0 : start,
+                               ColsAtCompileTime == 1 ? 0 : start,
+                               RowsAtCompileTime == 1 ? 1 : size,
+                               ColsAtCompileTime == 1 ? 1 : size);
 }
 
 /** This is the const version of block(int,int).*/
@@ -192,11 +193,11 @@
 const Block<Derived> MatrixBase<Derived>
   ::block(int start, int size) const
 {
-  assert(Traits::IsVectorAtCompileTime);
-  return Block<Derived>(asArg(), Traits::RowsAtCompileTime == 1 ? 0 : start,
-                               Traits::ColsAtCompileTime == 1 ? 0 : start,
-                               Traits::RowsAtCompileTime == 1 ? 1 : size,
-                               Traits::ColsAtCompileTime == 1 ? 1 : size);
+  assert(IsVectorAtCompileTime);
+  return Block<Derived>(asArg(), RowsAtCompileTime == 1 ? 0 : start,
+                               ColsAtCompileTime == 1 ? 0 : start,
+                               RowsAtCompileTime == 1 ? 1 : size,
+                               ColsAtCompileTime == 1 ? 1 : size);
 }
 
 /** \returns a dynamic-size expression of the first coefficients of *this.
@@ -218,10 +219,10 @@
 Block<Derived> MatrixBase<Derived>
   ::start(int size)
 {
-  assert(Traits::IsVectorAtCompileTime);
+  assert(IsVectorAtCompileTime);
   return Block<Derived>(asArg(), 0, 0,
-                        Traits::RowsAtCompileTime == 1 ? 1 : size,
-                        Traits::ColsAtCompileTime == 1 ? 1 : size);
+                        RowsAtCompileTime == 1 ? 1 : size,
+                        ColsAtCompileTime == 1 ? 1 : size);
 }
 
 /** This is the const version of start(int).*/
@@ -229,10 +230,10 @@
 const Block<Derived> MatrixBase<Derived>
   ::start(int size) const
 {
-  assert(Traits::IsVectorAtCompileTime);
+  assert(IsVectorAtCompileTime);
   return Block<Derived>(asArg(), 0, 0,
-                        Traits::RowsAtCompileTime == 1 ? 1 : size,
-                        Traits::ColsAtCompileTime == 1 ? 1 : size);
+                        RowsAtCompileTime == 1 ? 1 : size,
+                        ColsAtCompileTime == 1 ? 1 : size);
 }
 
 /** \returns a dynamic-size expression of the last coefficients of *this.
@@ -254,12 +255,12 @@
 Block<Derived> MatrixBase<Derived>
   ::end(int size)
 {
-  assert(Traits::IsVectorAtCompileTime);
+  assert(IsVectorAtCompileTime);
   return Block<Derived>(asArg(),
-                        Traits::RowsAtCompileTime == 1 ? 0 : rows() - size,
-                        Traits::ColsAtCompileTime == 1 ? 0 : cols() - size,
-                        Traits::RowsAtCompileTime == 1 ? 1 : size,
-                        Traits::ColsAtCompileTime == 1 ? 1 : size);
+                        RowsAtCompileTime == 1 ? 0 : rows() - size,
+                        ColsAtCompileTime == 1 ? 0 : cols() - size,
+                        RowsAtCompileTime == 1 ? 1 : size,
+                        ColsAtCompileTime == 1 ? 1 : size);
 }
 
 /** This is the const version of end(int).*/
@@ -267,12 +268,12 @@
 const Block<Derived> MatrixBase<Derived>
   ::end(int size) const
 {
-  assert(Traits::IsVectorAtCompileTime);
+  assert(IsVectorAtCompileTime);
   return Block<Derived>(asArg(),
-                        Traits::RowsAtCompileTime == 1 ? 0 : rows() - size,
-                        Traits::ColsAtCompileTime == 1 ? 0 : cols() - size,
-                        Traits::RowsAtCompileTime == 1 ? 1 : size,
-                        Traits::ColsAtCompileTime == 1 ? 1 : size);
+                        RowsAtCompileTime == 1 ? 0 : rows() - size,
+                        ColsAtCompileTime == 1 ? 0 : cols() - size,
+                        RowsAtCompileTime == 1 ? 1 : size,
+                        ColsAtCompileTime == 1 ? 1 : size);
 }
 
 /** \returns a dynamic-size expression of a corner of *this.
diff --git a/Eigen/src/Core/Coeffs.h b/Eigen/src/Core/Coeffs.h
index 6ee45c2..bbaa3d3 100644
--- a/Eigen/src/Core/Coeffs.h
+++ b/Eigen/src/Core/Coeffs.h
@@ -40,7 +40,7 @@
   * \sa operator()(int,int) const, coeffRef(int,int), coeff(int) const
   */
 template<typename Derived>
-typename Scalar<Derived>::Type MatrixBase<Derived>
+typename ei_traits<Derived>::Scalar MatrixBase<Derived>
   ::coeff(int row, int col) const
 {
   eigen_internal_assert(row >= 0 && row < rows()
@@ -53,7 +53,7 @@
   * \sa operator()(int,int), operator[](int) const
   */
 template<typename Derived>
-typename Scalar<Derived>::Type MatrixBase<Derived>
+typename ei_traits<Derived>::Scalar MatrixBase<Derived>
   ::operator()(int row, int col) const
 {
   assert(row >= 0 && row < rows()
@@ -76,7 +76,7 @@
   * \sa operator()(int,int), coeff(int, int) const, coeffRef(int)
   */
 template<typename Derived>
-typename Scalar<Derived>::Type& MatrixBase<Derived>
+typename ei_traits<Derived>::Scalar& MatrixBase<Derived>
   ::coeffRef(int row, int col)
 {
   eigen_internal_assert(row >= 0 && row < rows()
@@ -89,7 +89,7 @@
   * \sa operator()(int,int) const, operator[](int)
   */
 template<typename Derived>
-typename Scalar<Derived>::Type& MatrixBase<Derived>
+typename ei_traits<Derived>::Scalar& MatrixBase<Derived>
   ::operator()(int row, int col)
 {
   assert(row >= 0 && row < rows()
@@ -112,11 +112,11 @@
   * \sa operator[](int) const, coeffRef(int), coeff(int,int) const
   */
 template<typename Derived>
-typename Scalar<Derived>::Type MatrixBase<Derived>
+typename ei_traits<Derived>::Scalar MatrixBase<Derived>
   ::coeff(int index) const
 {
-  eigen_internal_assert(Traits::IsVectorAtCompileTime);
-  if(Traits::RowsAtCompileTime == 1)
+  eigen_internal_assert(IsVectorAtCompileTime);
+  if(RowsAtCompileTime == 1)
   {
     eigen_internal_assert(index >= 0 && index < cols());
     return coeff(0, index);
@@ -136,11 +136,11 @@
   * z() const, w() const
   */
 template<typename Derived>
-typename Scalar<Derived>::Type MatrixBase<Derived>
+typename ei_traits<Derived>::Scalar MatrixBase<Derived>
   ::operator[](int index) const
 {
-  assert(Traits::IsVectorAtCompileTime);
-  if(Traits::RowsAtCompileTime == 1)
+  assert(IsVectorAtCompileTime);
+  if(RowsAtCompileTime == 1)
   {
     assert(index >= 0 && index < cols());
     return coeff(0, index);
@@ -167,11 +167,11 @@
   * \sa operator[](int), coeff(int) const, coeffRef(int,int)
   */
 template<typename Derived>
-typename Scalar<Derived>::Type& MatrixBase<Derived>
+typename ei_traits<Derived>::Scalar& MatrixBase<Derived>
   ::coeffRef(int index)
 {
-  eigen_internal_assert(Traits::IsVectorAtCompileTime);
-  if(Traits::RowsAtCompileTime == 1)
+  eigen_internal_assert(IsVectorAtCompileTime);
+  if(RowsAtCompileTime == 1)
   {
     eigen_internal_assert(index >= 0 && index < cols());
     return coeffRef(0, index);
@@ -190,11 +190,11 @@
   * \sa operator[](int) const, operator()(int,int), x(), y(), z(), w()
   */
 template<typename Derived>
-typename Scalar<Derived>::Type& MatrixBase<Derived>
+typename ei_traits<Derived>::Scalar& MatrixBase<Derived>
   ::operator[](int index)
 {
-  assert(Traits::IsVectorAtCompileTime);
-  if(Traits::RowsAtCompileTime == 1)
+  assert(IsVectorAtCompileTime);
+  if(RowsAtCompileTime == 1)
   {
     assert(index >= 0 && index < cols());
     return coeffRef(0, index);
@@ -208,42 +208,42 @@
 
 /** equivalent to operator[](0). \only_for_vectors */
 template<typename Derived>
-typename Scalar<Derived>::Type MatrixBase<Derived>
+typename ei_traits<Derived>::Scalar MatrixBase<Derived>
   ::x() const { return (*this)[0]; }
 
 /** equivalent to operator[](1). \only_for_vectors */
 template<typename Derived>
-typename Scalar<Derived>::Type MatrixBase<Derived>
+typename ei_traits<Derived>::Scalar MatrixBase<Derived>
   ::y() const { return (*this)[1]; }
 
 /** equivalent to operator[](2). \only_for_vectors */
 template<typename Derived>
-typename Scalar<Derived>::Type MatrixBase<Derived>
+typename ei_traits<Derived>::Scalar MatrixBase<Derived>
   ::z() const { return (*this)[2]; }
 
 /** equivalent to operator[](3). \only_for_vectors */
 template<typename Derived>
-typename Scalar<Derived>::Type MatrixBase<Derived>
+typename ei_traits<Derived>::Scalar MatrixBase<Derived>
   ::w() const { return (*this)[3]; }
 
 /** equivalent to operator[](0). \only_for_vectors */
 template<typename Derived>
-typename Scalar<Derived>::Type& MatrixBase<Derived>
+typename ei_traits<Derived>::Scalar& MatrixBase<Derived>
   ::x() { return (*this)[0]; }
 
 /** equivalent to operator[](1). \only_for_vectors */
 template<typename Derived>
-typename Scalar<Derived>::Type& MatrixBase<Derived>
+typename ei_traits<Derived>::Scalar& MatrixBase<Derived>
   ::y() { return (*this)[1]; }
 
 /** equivalent to operator[](2). \only_for_vectors */
 template<typename Derived>
-typename Scalar<Derived>::Type& MatrixBase<Derived>
+typename ei_traits<Derived>::Scalar& MatrixBase<Derived>
   ::z() { return (*this)[2]; }
 
 /** equivalent to operator[](3). \only_for_vectors */
 template<typename Derived>
-typename Scalar<Derived>::Type& MatrixBase<Derived>
+typename ei_traits<Derived>::Scalar& MatrixBase<Derived>
   ::w() { return (*this)[3]; }
 
 #endif // EIGEN_COEFFS_H
diff --git a/Eigen/src/Core/Column.h b/Eigen/src/Core/Column.h
index 7eee89d..9430956 100644
--- a/Eigen/src/Core/Column.h
+++ b/Eigen/src/Core/Column.h
@@ -46,18 +46,25 @@
   * \sa MatrixBase::col()
   */
 template<typename MatrixType>
-struct Scalar<Column<MatrixType> >
-{ typedef typename Scalar<MatrixType>::Type Type; };
+struct ei_traits<Column<MatrixType> >
+{
+  typedef typename MatrixType::Scalar Scalar;
+  enum {
+    RowsAtCompileTime = MatrixType::RowsAtCompileTime,
+    ColsAtCompileTime = 1,
+    MaxRowsAtCompileTime = MatrixType::MaxRowsAtCompileTime,
+    MaxColsAtCompileTime = 1
+  };
+};
 
 template<typename MatrixType> class Column
   : public MatrixBase<Column<MatrixType> >
 {
   public:
-    typedef typename Scalar<MatrixType>::Type Scalar;
+
+    EIGEN_BASIC_PUBLIC_INTERFACE(Column)
+
     typedef typename MatrixType::AsArg MatRef;
-    friend class MatrixBase<Column>;
-    friend class MatrixBase<Column>::Traits;
-    typedef MatrixBase<Column> Base;
 
     Column(const MatRef& matrix, int col)
       : m_matrix(matrix), m_col(col)
@@ -68,12 +75,6 @@
     EIGEN_INHERIT_ASSIGNMENT_OPERATORS(Column)
 
   private:
-    enum {
-      RowsAtCompileTime = MatrixType::Traits::RowsAtCompileTime,
-      ColsAtCompileTime = 1,
-      MaxRowsAtCompileTime = MatrixType::Traits::MaxRowsAtCompileTime,
-      MaxColsAtCompileTime = 1
-    };
 
     const Column& _asArg() const { return *this; }
     int _rows() const { return m_matrix.rows(); }
diff --git a/Eigen/src/Core/CommaInitializer.h b/Eigen/src/Core/CommaInitializer.h
index b7de3b3..5456eb7 100644
--- a/Eigen/src/Core/CommaInitializer.h
+++ b/Eigen/src/Core/CommaInitializer.h
@@ -55,7 +55,7 @@
     }
     assert(m_col<m_matrix.cols() && "Too many coefficients passed to Matrix::operator<<");
     assert(m_currentBlockRows==1);
-    m_matrix._coeffRef(m_row, m_col++) = s;
+    m_matrix.coeffRef(m_row, m_col++) = s;
     return *this;
   }
 
@@ -77,7 +77,9 @@
 
   ~CommaInitializer(void)
   {
-    assert((m_row+m_currentBlockRows)==m_matrix.rows() && m_col==m_matrix.cols() && "Too few coefficients passed to Matrix::operator<<");
+    assert((m_row+m_currentBlockRows) == m_matrix.rows()
+         && m_col == m_matrix.cols()
+         && "Too few coefficients passed to Matrix::operator<<");
   }
 
   Derived& m_matrix;
diff --git a/Eigen/src/Core/CwiseBinaryOp.h b/Eigen/src/Core/CwiseBinaryOp.h
index 5314eb7..63e0fba 100644
--- a/Eigen/src/Core/CwiseBinaryOp.h
+++ b/Eigen/src/Core/CwiseBinaryOp.h
@@ -47,20 +47,32 @@
   * \sa class ScalarProductOp, class ScalarQuotientOp
   */
 template<typename BinaryOp, typename Lhs, typename Rhs>
-struct Scalar<CwiseBinaryOp<BinaryOp, Lhs, Rhs> >
-{ typedef typename ei_result_of<BinaryOp(typename Lhs::Scalar,typename Rhs::Scalar)>::type Type; };
+struct ei_traits<CwiseBinaryOp<BinaryOp, Lhs, Rhs> >
+{
+  typedef typename ei_result_of<
+                     BinaryOp(
+                       typename Lhs::Scalar,
+                       typename Rhs::Scalar
+                     )
+                   >::type Scalar;
+  enum {
+    RowsAtCompileTime = Lhs::RowsAtCompileTime,
+    ColsAtCompileTime = Lhs::ColsAtCompileTime,
+    MaxRowsAtCompileTime = Lhs::MaxRowsAtCompileTime,
+    MaxColsAtCompileTime = Lhs::MaxColsAtCompileTime
+  };
+};
 
 template<typename BinaryOp, typename Lhs, typename Rhs>
 class CwiseBinaryOp : NoOperatorEquals,
   public MatrixBase<CwiseBinaryOp<BinaryOp, Lhs, Rhs> >
 {
   public:
-    typedef typename Scalar<CwiseBinaryOp>::Type Scalar;
+
+    EIGEN_BASIC_PUBLIC_INTERFACE(CwiseBinaryOp)
+
     typedef typename Lhs::AsArg LhsRef;
     typedef typename Rhs::AsArg RhsRef;
-    friend class MatrixBase<CwiseBinaryOp>;
-    friend class MatrixBase<CwiseBinaryOp>::Traits;
-    typedef MatrixBase<CwiseBinaryOp> Base;
 
     CwiseBinaryOp(const LhsRef& lhs, const RhsRef& rhs, const BinaryOp& func = BinaryOp())
       : m_lhs(lhs), m_rhs(rhs), m_functor(func)
@@ -69,12 +81,6 @@
     }
 
   private:
-    enum {
-      RowsAtCompileTime = Lhs::Traits::RowsAtCompileTime,
-      ColsAtCompileTime = Lhs::Traits::ColsAtCompileTime,
-      MaxRowsAtCompileTime = Lhs::Traits::MaxRowsAtCompileTime,
-      MaxColsAtCompileTime = Lhs::Traits::MaxColsAtCompileTime
-    };
 
     const CwiseBinaryOp& _asArg() const { return *this; }
     int _rows() const { return m_lhs.rows(); }
diff --git a/Eigen/src/Core/CwiseUnaryOp.h b/Eigen/src/Core/CwiseUnaryOp.h
index 55ff7e1..a2ad55a 100644
--- a/Eigen/src/Core/CwiseUnaryOp.h
+++ b/Eigen/src/Core/CwiseUnaryOp.h
@@ -40,29 +40,32 @@
   * \sa class CwiseBinaryOp
   */
 template<typename UnaryOp, typename MatrixType>
-struct Scalar<CwiseUnaryOp<UnaryOp, MatrixType> >
-{ typedef typename ei_result_of<UnaryOp(typename MatrixType::Scalar)>::type Type; };
+struct ei_traits<CwiseUnaryOp<UnaryOp, MatrixType> >
+{
+  typedef typename ei_result_of<
+                     UnaryOp(typename MatrixType::Scalar)
+                   >::type Scalar;
+  enum {
+    RowsAtCompileTime = MatrixType::RowsAtCompileTime,
+    ColsAtCompileTime = MatrixType::ColsAtCompileTime,
+    MaxRowsAtCompileTime = MatrixType::MaxRowsAtCompileTime,
+    MaxColsAtCompileTime = MatrixType::MaxColsAtCompileTime
+  };
+};
 
 template<typename UnaryOp, typename MatrixType>
 class CwiseUnaryOp : NoOperatorEquals,
   public MatrixBase<CwiseUnaryOp<UnaryOp, MatrixType> >
 {
   public:
-    typedef typename ei_result_of<UnaryOp(typename MatrixType::Scalar)>::type Scalar;
+
+    EIGEN_BASIC_PUBLIC_INTERFACE(CwiseUnaryOp)
+
     typedef typename MatrixType::AsArg MatRef;
-    friend class MatrixBase<CwiseUnaryOp>;
-    friend class MatrixBase<CwiseUnaryOp>::Traits;
-    typedef MatrixBase<CwiseUnaryOp> Base;
 
     CwiseUnaryOp(const MatRef& mat, const UnaryOp& func = UnaryOp()) : m_matrix(mat), m_functor(func) {}
 
   private:
-    enum {
-      RowsAtCompileTime = MatrixType::Traits::RowsAtCompileTime,
-      ColsAtCompileTime = MatrixType::Traits::ColsAtCompileTime,
-      MaxRowsAtCompileTime = MatrixType::Traits::MaxRowsAtCompileTime,
-      MaxColsAtCompileTime = MatrixType::Traits::MaxColsAtCompileTime
-    };
 
     const CwiseUnaryOp& _asArg() const { return *this; }
     int _rows() const { return m_matrix.rows(); }
@@ -155,7 +158,7 @@
 }
 
 /** \internal
-  * \brief Template functor to cast a scalar to another
+  * \brief Template functor to cast a scalar to another type
   *
   * \sa class CwiseUnaryOp, MatrixBase::cast()
   */
@@ -183,9 +186,8 @@
   return CwiseUnaryOp<ScalarCastOp<NewType>, Derived>(asArg());
 }
 
-
 /** \internal
-  * \brief Template functor to multiply a scalar by a fixed another one
+  * \brief Template functor to multiply a scalar by a fixed other one
   *
   * \sa class CwiseUnaryOp, MatrixBase::operator*, MatrixBase::operator/
   */
@@ -198,7 +200,7 @@
 
 /** \relates MatrixBase \sa class ScalarMultipleOp */
 template<typename Derived>
-const CwiseUnaryOp<ScalarMultipleOp<typename Scalar<Derived>::Type>, Derived>
+const CwiseUnaryOp<ScalarMultipleOp<typename ei_traits<Derived>::Scalar>, Derived>
 MatrixBase<Derived>::operator*(const Scalar& scalar) const
 {
   return CwiseUnaryOp<ScalarMultipleOp<Scalar>, Derived>(asArg(), ScalarMultipleOp<Scalar>(scalar));
@@ -206,7 +208,7 @@
 
 /** \relates MatrixBase \sa class ScalarMultipleOp */
 template<typename Derived>
-const CwiseUnaryOp<ScalarMultipleOp<typename Scalar<Derived>::Type>, Derived>
+const CwiseUnaryOp<ScalarMultipleOp<typename ei_traits<Derived>::Scalar>, Derived>
 MatrixBase<Derived>::operator/(const Scalar& scalar) const
 {
   assert(NumTraits<Scalar>::HasFloatingPoint);
diff --git a/Eigen/src/Core/DiagonalCoeffs.h b/Eigen/src/Core/DiagonalCoeffs.h
index a03241e..e8bc041 100644
--- a/Eigen/src/Core/DiagonalCoeffs.h
+++ b/Eigen/src/Core/DiagonalCoeffs.h
@@ -38,34 +38,35 @@
   * \sa MatrixBase::diagonal()
   */
 template<typename MatrixType>
-struct Scalar<DiagonalCoeffs<MatrixType> >
-{ typedef typename Scalar<MatrixType>::Type Type; };
+struct ei_traits<DiagonalCoeffs<MatrixType> >
+{
+  typedef typename MatrixType::Scalar Scalar;
+  enum {
+    RowsAtCompileTime = MatrixType::SizeAtCompileTime == Dynamic ? Dynamic
+                      : EIGEN_ENUM_MIN(MatrixType::RowsAtCompileTime,
+                                       MatrixType::ColsAtCompileTime),
+    ColsAtCompileTime = 1,
+    MaxRowsAtCompileTime = MatrixType::MaxSizeAtCompileTime == Dynamic ? Dynamic
+                            : EIGEN_ENUM_MIN(MatrixType::MaxRowsAtCompileTime,
+                                             MatrixType::MaxColsAtCompileTime),
+    MaxColsAtCompileTime = 1
+  };
+};
 
 template<typename MatrixType> class DiagonalCoeffs
   : public MatrixBase<DiagonalCoeffs<MatrixType> >
 {
   public:
-    typedef typename Scalar<MatrixType>::Type Scalar;
+
+    EIGEN_BASIC_PUBLIC_INTERFACE(DiagonalCoeffs)
+
     typedef typename MatrixType::AsArg MatRef;
-    friend class MatrixBase<DiagonalCoeffs>;
-    friend class MatrixBase<DiagonalCoeffs>::Traits;
-    typedef MatrixBase<DiagonalCoeffs> Base;
 
     DiagonalCoeffs(const MatRef& matrix) : m_matrix(matrix) {}
 
     EIGEN_INHERIT_ASSIGNMENT_OPERATORS(DiagonalCoeffs)
 
   private:
-    enum {
-      RowsAtCompileTime = MatrixType::Traits::SizeAtCompileTime == Dynamic ? Dynamic
-                        : EIGEN_ENUM_MIN(MatrixType::Traits::RowsAtCompileTime,
-                                         MatrixType::Traits::ColsAtCompileTime),
-      ColsAtCompileTime = 1,
-      MaxRowsAtCompileTime = MatrixType::Traits::MaxSizeAtCompileTime == Dynamic ? Dynamic
-                             : EIGEN_ENUM_MIN(MatrixType::Traits::MaxRowsAtCompileTime,
-                                              MatrixType::Traits::MaxColsAtCompileTime),
-      MaxColsAtCompileTime = 1
-    };
 
     const DiagonalCoeffs& _asArg() const { return *this; }
     int _rows() const { return std::min(m_matrix.rows(), m_matrix.cols()); }
diff --git a/Eigen/src/Core/DiagonalMatrix.h b/Eigen/src/Core/DiagonalMatrix.h
index 6b4e0b1..e27d2c3 100644
--- a/Eigen/src/Core/DiagonalMatrix.h
+++ b/Eigen/src/Core/DiagonalMatrix.h
@@ -39,33 +39,34 @@
   * \sa MatrixBase::diagonal(const OtherDerived&)
   */
 template<typename CoeffsVectorType>
-struct Scalar<DiagonalMatrix<CoeffsVectorType> >
-{ typedef typename Scalar<CoeffsVectorType>::Type Type; };
+struct ei_traits<DiagonalMatrix<CoeffsVectorType> >
+{
+  typedef typename CoeffsVectorType::Scalar Scalar;
+  enum {
+    RowsAtCompileTime = CoeffsVectorType::SizeAtCompileTime,
+    ColsAtCompileTime = CoeffsVectorType::SizeAtCompileTime,
+    MaxRowsAtCompileTime = CoeffsVectorType::MaxSizeAtCompileTime,
+    MaxColsAtCompileTime = CoeffsVectorType::MaxSizeAtCompileTime
+  };
+};
 
 template<typename CoeffsVectorType>
 class DiagonalMatrix : NoOperatorEquals,
   public MatrixBase<DiagonalMatrix<CoeffsVectorType> >
 {
   public:
-    typedef typename Scalar<CoeffsVectorType>::Type Scalar;
+
+    EIGEN_BASIC_PUBLIC_INTERFACE(DiagonalMatrix)
+
     typedef typename CoeffsVectorType::AsArg CoeffsVecRef;
-    friend class MatrixBase<DiagonalMatrix>;
-    friend class MatrixBase<DiagonalMatrix>::Traits;
-    typedef MatrixBase<DiagonalMatrix> Base;
 
     DiagonalMatrix(const CoeffsVecRef& coeffs) : m_coeffs(coeffs)
     {
-      assert(CoeffsVectorType::Traits::IsVectorAtCompileTime
+      assert(CoeffsVectorType::IsVectorAtCompileTime
           && coeffs.size() > 0);
     }
 
   private:
-    enum {
-      RowsAtCompileTime = CoeffsVectorType::Traits::SizeAtCompileTime,
-      ColsAtCompileTime = CoeffsVectorType::Traits::SizeAtCompileTime,
-      MaxRowsAtCompileTime = CoeffsVectorType::Traits::MaxSizeAtCompileTime,
-      MaxColsAtCompileTime = CoeffsVectorType::Traits::MaxSizeAtCompileTime
-    };
 
     const DiagonalMatrix& _asArg() const { return *this; }
     int _rows() const { return m_coeffs.size(); }
diff --git a/Eigen/src/Core/Dot.h b/Eigen/src/Core/Dot.h
index 03764ba..f4d13e5 100644
--- a/Eigen/src/Core/Dot.h
+++ b/Eigen/src/Core/Dot.h
@@ -69,18 +69,18 @@
   */
 template<typename Derived>
 template<typename OtherDerived>
-typename Scalar<Derived>::Type
+typename ei_traits<Derived>::Scalar
 MatrixBase<Derived>::dot(const MatrixBase<OtherDerived>& other) const
 {
-  assert(Traits::IsVectorAtCompileTime
-      && OtherDerived::Traits::IsVectorAtCompileTime
+  assert(IsVectorAtCompileTime
+      && OtherDerived::IsVectorAtCompileTime
       && size() == other.size());
   Scalar res;
   if(EIGEN_UNROLLED_LOOPS
-  && Traits::SizeAtCompileTime != Dynamic
-  && Traits::SizeAtCompileTime <= EIGEN_UNROLLING_LIMIT_PRODUCT)
-    DotUnroller<Traits::SizeAtCompileTime-1,
-                Traits::SizeAtCompileTime <= EIGEN_UNROLLING_LIMIT_PRODUCT ? Traits::SizeAtCompileTime : Dynamic,
+  && SizeAtCompileTime != Dynamic
+  && SizeAtCompileTime <= EIGEN_UNROLLING_LIMIT_PRODUCT)
+    DotUnroller<SizeAtCompileTime-1,
+                SizeAtCompileTime <= EIGEN_UNROLLING_LIMIT_PRODUCT ? SizeAtCompileTime : Dynamic,
                 Derived, MatrixBase<OtherDerived> >
       ::run(*static_cast<const Derived*>(this), other, res);
   else
@@ -99,7 +99,7 @@
   * \sa dot(), norm()
   */
 template<typename Derived>
-typename NumTraits<typename Scalar<Derived>::Type>::Real MatrixBase<Derived>::norm2() const
+typename NumTraits<typename ei_traits<Derived>::Scalar>::Real MatrixBase<Derived>::norm2() const
 {
   return ei_real(dot(*this));
 }
@@ -111,7 +111,7 @@
   * \sa dot(), norm2()
   */
 template<typename Derived>
-typename NumTraits<typename Scalar<Derived>::Type>::Real MatrixBase<Derived>::norm() const
+typename NumTraits<typename ei_traits<Derived>::Scalar>::Real MatrixBase<Derived>::norm() const
 {
   return ei_sqrt(norm2());
 }
@@ -123,7 +123,7 @@
   * \sa norm()
   */
 template<typename Derived>
-const CwiseUnaryOp<ScalarMultipleOp<typename Scalar<Derived>::Type>, Derived>
+const CwiseUnaryOp<ScalarMultipleOp<typename ei_traits<Derived>::Scalar>, Derived>
 MatrixBase<Derived>::normalized() const
 {
   return (*this) / norm();
diff --git a/Eigen/src/Core/Eval.h b/Eigen/src/Core/Eval.h
index 85a9d0a..ece372a 100644
--- a/Eigen/src/Core/Eval.h
+++ b/Eigen/src/Core/Eval.h
@@ -45,19 +45,26 @@
   * \sa MatrixBase::eval()
   */
 template<typename ExpressionType>
-struct Scalar<Eval<ExpressionType> >
-{ typedef typename Scalar<ExpressionType>::Type Type; };
+struct ei_traits<Eval<ExpressionType> >
+{
+  typedef typename ExpressionType::Scalar Scalar;
+  enum {
+    RowsAtCompileTime = ExpressionType::RowsAtCompileTime,
+    ColsAtCompileTime = ExpressionType::ColsAtCompileTime,
+    MaxRowsAtCompileTime = ExpressionType::MaxRowsAtCompileTime,
+    MaxColsAtCompileTime = ExpressionType::MaxColsAtCompileTime
+  };
+};
 
 template<typename ExpressionType> class Eval : NoOperatorEquals,
   public Matrix< typename ExpressionType::Scalar,
-                 ExpressionType::Traits::RowsAtCompileTime,
-                 ExpressionType::Traits::ColsAtCompileTime,
+                 ExpressionType::RowsAtCompileTime,
+                 ExpressionType::ColsAtCompileTime,
                  EIGEN_DEFAULT_MATRIX_STORAGE_ORDER,
-                 ExpressionType::Traits::MaxRowsAtCompileTime,
-                 ExpressionType::Traits::MaxColsAtCompileTime>
+                 ExpressionType::MaxRowsAtCompileTime,
+                 ExpressionType::MaxColsAtCompileTime>
 {
   public:
-    typedef typename Scalar<ExpressionType>::Type Scalar;
 
     /** The actual matrix type to evaluate to. This type can be used independently
       * of the rest of this class to get the actual matrix type to evaluate and store
@@ -67,12 +74,14 @@
       * \include Eval_MatrixType.cpp
       * Output: \verbinclude Eval_MatrixType.out
       */
-    typedef Matrix<Scalar,
-                   ExpressionType::Traits::RowsAtCompileTime,
-                   ExpressionType::Traits::ColsAtCompileTime,
+    typedef Matrix<typename ExpressionType::Scalar,
+                   ExpressionType::RowsAtCompileTime,
+                   ExpressionType::ColsAtCompileTime,
                    EIGEN_DEFAULT_MATRIX_STORAGE_ORDER,
-                   ExpressionType::Traits::MaxRowsAtCompileTime,
-                   ExpressionType::Traits::MaxColsAtCompileTime> MatrixType;
+                   ExpressionType::MaxRowsAtCompileTime,
+                   ExpressionType::MaxColsAtCompileTime> MatrixType;
+
+    _EIGEN_BASIC_PUBLIC_INTERFACE(Eval, MatrixType)
 
     explicit Eval(const ExpressionType& expr) : MatrixType(expr) {}
 };
diff --git a/Eigen/src/Core/EvalOMP.h b/Eigen/src/Core/EvalOMP.h
index 7bc006d..929e451 100644
--- a/Eigen/src/Core/EvalOMP.h
+++ b/Eigen/src/Core/EvalOMP.h
@@ -39,27 +39,40 @@
   *
   * \sa MatrixBase::evalOMP(), class Eval, MatrixBase::eval()
   */
+template<typename ExpressionType>
+struct ei_traits<EvalOMP<ExpressionType> >
+{
+  typedef typename ExpressionType::Scalar Scalar;
+  enum {
+    RowsAtCompileTime = ExpressionType::RowsAtCompileTime,
+    ColsAtCompileTime = ExpressionType::ColsAtCompileTime,
+    MaxRowsAtCompileTime = ExpressionType::MaxRowsAtCompileTime,
+    MaxColsAtCompileTime = ExpressionType::MaxColsAtCompileTime
+  };
+};
+
 template<typename ExpressionType> class EvalOMP : NoOperatorEquals,
   public Matrix< typename ExpressionType::Scalar,
-                 ExpressionType::Traits::RowsAtCompileTime,
-                 ExpressionType::Traits::ColsAtCompileTime,
+                 ExpressionType::RowsAtCompileTime,
+                 ExpressionType::ColsAtCompileTime,
                  EIGEN_DEFAULT_MATRIX_STORAGE_ORDER,
-                 ExpressionType::Traits::MaxRowsAtCompileTime,
-                 ExpressionType::Traits::MaxColsAtCompileTime>
+                 ExpressionType::MaxRowsAtCompileTime,
+                 ExpressionType::MaxColsAtCompileTime>
 {
   public:
-    typedef typename ExpressionType::Scalar Scalar;
 
     /** The actual matrix type to evaluate to. This type can be used independently
       * of the rest of this class to get the actual matrix type to evaluate and store
       * the value of an expression.
       */
-    typedef Matrix<Scalar,
-                   ExpressionType::Traits::RowsAtCompileTime,
-                   ExpressionType::Traits::ColsAtCompileTime,
+    typedef Matrix<typename ExpressionType::Scalar,
+                   ExpressionType::RowsAtCompileTime,
+                   ExpressionType::ColsAtCompileTime,
                    EIGEN_DEFAULT_MATRIX_STORAGE_ORDER,
-                   ExpressionType::Traits::MaxRowsAtCompileTime,
-                   ExpressionType::Traits::MaxColsAtCompileTime> MatrixType;
+                   ExpressionType::MaxRowsAtCompileTime,
+                   ExpressionType::MaxColsAtCompileTime> MatrixType;
+
+    _EIGEN_BASIC_PUBLIC_INTERFACE(EvalOMP, MatrixType)
 
     #ifdef _OPENMP
     explicit EvalOMP(const ExpressionType& other)
diff --git a/Eigen/src/Core/ForwardDeclarations.h b/Eigen/src/Core/ForwardDeclarations.h
index 5bed1f1..a548cd4 100644
--- a/Eigen/src/Core/ForwardDeclarations.h
+++ b/Eigen/src/Core/ForwardDeclarations.h
@@ -25,7 +25,7 @@
 #ifndef EIGEN_FORWARDDECLARATIONS_H
 #define EIGEN_FORWARDDECLARATIONS_H
 
-template<typename T> struct Scalar;
+template<typename T> struct ei_traits;
 
 template<typename _Scalar, int _Rows, int _Cols, int _StorageOrder, int _MaxRows, int _MaxCols> class Matrix;
 template<typename MatrixType> class MatrixRef;
diff --git a/Eigen/src/Core/Fuzzy.h b/Eigen/src/Core/Fuzzy.h
index a7a2763..0f601a8 100644
--- a/Eigen/src/Core/Fuzzy.h
+++ b/Eigen/src/Core/Fuzzy.h
@@ -49,7 +49,7 @@
 ) const
 {
   assert(rows() == other.rows() && cols() == other.cols());
-  if(Traits::IsVectorAtCompileTime)
+  if(IsVectorAtCompileTime)
   {
     return((*this - other).norm2() <= std::min(norm2(), other.norm2()) * prec * prec);
   }
@@ -79,7 +79,7 @@
   typename NumTraits<Scalar>::Real prec
 ) const
 {
-  if(Traits::IsVectorAtCompileTime)
+  if(IsVectorAtCompileTime)
   {
     return(norm2() <= ei_abs2(other * prec));
   }
@@ -110,7 +110,7 @@
 ) const
 {
   assert(rows() == other.rows() && cols() == other.cols());
-  if(Traits::IsVectorAtCompileTime)
+  if(IsVectorAtCompileTime)
   {
     return(norm2() <= other.norm2() * prec * prec);
   }
diff --git a/Eigen/src/Core/Identity.h b/Eigen/src/Core/Identity.h
index 38c8d0d..5dd3ec6 100644
--- a/Eigen/src/Core/Identity.h
+++ b/Eigen/src/Core/Identity.h
@@ -32,17 +32,23 @@
   * \sa MatrixBase::identity(), MatrixBase::identity(int,int), MatrixBase::setIdentity()
   */
 template<typename MatrixType>
-struct Scalar<Identity<MatrixType> >
-{ typedef typename Scalar<MatrixType>::Type Type; };
+struct ei_traits<Identity<MatrixType> >
+{
+  typedef typename MatrixType::Scalar Scalar;
+  enum {
+    RowsAtCompileTime = MatrixType::RowsAtCompileTime,
+    ColsAtCompileTime = MatrixType::ColsAtCompileTime,
+    MaxRowsAtCompileTime = MatrixType::MaxRowsAtCompileTime,
+    MaxColsAtCompileTime = MatrixType::MaxColsAtCompileTime
+  };
+};
 
 template<typename MatrixType> class Identity : NoOperatorEquals,
   public MatrixBase<Identity<MatrixType> >
 {
   public:
-    typedef typename Scalar<MatrixType>::Type Scalar;
-    friend class MatrixBase<Identity>;
-    friend class MatrixBase<Identity>::Traits;
-    typedef MatrixBase<Identity> Base;
+
+    EIGEN_BASIC_PUBLIC_INTERFACE(Identity)
 
     Identity(int rows, int cols) : m_rows(rows), m_cols(cols)
     {
@@ -53,12 +59,6 @@
     }
 
   private:
-    enum {
-      RowsAtCompileTime = MatrixType::Traits::RowsAtCompileTime,
-      ColsAtCompileTime = MatrixType::Traits::ColsAtCompileTime,
-      MaxRowsAtCompileTime = MatrixType::Traits::MaxRowsAtCompileTime,
-      MaxColsAtCompileTime = MatrixType::Traits::MaxColsAtCompileTime
-    };
 
     const Identity& _asArg() const { return *this; }
     int _rows() const { return m_rows.value(); }
@@ -107,7 +107,7 @@
 template<typename Derived>
 const Identity<Derived> MatrixBase<Derived>::identity()
 {
-  return Identity<Derived>(Traits::RowsAtCompileTime, Traits::ColsAtCompileTime);
+  return Identity<Derived>(RowsAtCompileTime, ColsAtCompileTime);
 }
 
 /** \returns true if *this is approximately equal to the identity matrix
diff --git a/Eigen/src/Core/Map.h b/Eigen/src/Core/Map.h
index 634a171..e1b7195 100644
--- a/Eigen/src/Core/Map.h
+++ b/Eigen/src/Core/Map.h
@@ -39,26 +39,25 @@
   * \sa Matrix::map()
   */
 template<typename MatrixType>
-struct Scalar<Map<MatrixType> >
-{ typedef typename Scalar<MatrixType>::Type Type; };
+struct ei_traits<Map<MatrixType> >
+{
+  typedef typename MatrixType::Scalar Scalar;
+  enum {
+    RowsAtCompileTime = MatrixType::RowsAtCompileTime,
+    ColsAtCompileTime = MatrixType::ColsAtCompileTime,
+    MaxRowsAtCompileTime = MatrixType::MaxRowsAtCompileTime,
+    MaxColsAtCompileTime = MatrixType::MaxColsAtCompileTime
+  };
+};
 
 template<typename MatrixType> class Map
   : public MatrixBase<Map<MatrixType> >
 {
   public:
-    typedef typename Scalar<MatrixType>::Type Scalar;
-    friend class MatrixBase<Map>;
-    friend class MatrixBase<Map>::Traits;
-    typedef MatrixBase<Map> Base;
+
+    EIGEN_BASIC_PUBLIC_INTERFACE(Map)
 
   private:
-    enum {
-      RowsAtCompileTime = MatrixType::Traits::RowsAtCompileTime,
-      ColsAtCompileTime = MatrixType::Traits::ColsAtCompileTime,
-      Order = MatrixType::StorageOrder,
-      MaxRowsAtCompileTime = MatrixType::Traits::MaxRowsAtCompileTime,
-      MaxColsAtCompileTime = MatrixType::Traits::MaxColsAtCompileTime
-    };
 
     const Map& _asArg() const { return *this; }
     int _rows() const { return m_rows; }
@@ -66,7 +65,7 @@
 
     const Scalar& _coeff(int row, int col) const
     {
-      if(Order == ColumnMajor)
+      if(MatrixType::StorageOrder == ColumnMajor)
         return m_data[row + col * m_rows];
       else // RowMajor
         return m_data[col + row * m_cols];
@@ -74,7 +73,7 @@
 
     Scalar& _coeffRef(int row, int col)
     {
-      if(Order == ColumnMajor)
+      if(MatrixType::StorageOrder == ColumnMajor)
         return const_cast<Scalar*>(m_data)[row + col * m_rows];
       else // RowMajor
         return const_cast<Scalar*>(m_data)[col + row * m_cols];
diff --git a/Eigen/src/Core/Matrix.h b/Eigen/src/Core/Matrix.h
index 68ccef1..ffb9604 100644
--- a/Eigen/src/Core/Matrix.h
+++ b/Eigen/src/Core/Matrix.h
@@ -72,8 +72,16 @@
   * Note that most of the API is in the base class MatrixBase.
   */
 template<typename _Scalar, int _Rows, int _Cols, int _StorageOrder, int _MaxRows, int _MaxCols>
-struct Scalar<Matrix<_Scalar, _Rows, _Cols, _StorageOrder, _MaxRows, _MaxCols> >
-{ typedef _Scalar Type; };
+struct ei_traits<Matrix<_Scalar, _Rows, _Cols, _StorageOrder, _MaxRows, _MaxCols> >
+{
+  typedef _Scalar Scalar;
+  enum {
+    RowsAtCompileTime = _Rows,
+    ColsAtCompileTime = _Cols,
+    MaxRowsAtCompileTime = _MaxRows,
+    MaxColsAtCompileTime = _MaxCols,
+  };
+};
 
 template<typename _Scalar, int _Rows, int _Cols,
          int _StorageOrder = EIGEN_DEFAULT_MATRIX_STORAGE_ORDER,
@@ -82,26 +90,17 @@
                                         _StorageOrder, _MaxRows, _MaxCols> >
 {
   public:
-    friend class MatrixBase<Matrix>;
-    friend class MatrixBase<Matrix>::Traits;
+
+    EIGEN_BASIC_PUBLIC_INTERFACE(Matrix)
+
+    enum { StorageOrder = _StorageOrder };
+
     friend class Map<Matrix>;
 
-    typedef MatrixBase<Matrix> Base;
-    typedef typename Scalar<Matrix>::Type Scalar;
     typedef MatrixRef<Matrix> AsArg;
     friend class MatrixRef<Matrix>;
 
   private:
-    enum {
-      RowsAtCompileTime = _Rows,
-      ColsAtCompileTime = _Cols,
-      StorageOrder = _StorageOrder,
-      MaxRowsAtCompileTime = _MaxRows,
-      MaxColsAtCompileTime = _MaxCols,
-      MaxSizeAtCompileTime = _MaxRows == Dynamic || _MaxCols == Dynamic
-                               ? Dynamic
-                               : _MaxRows * _MaxCols
-    };
 
     MatrixStorage<Scalar, MaxSizeAtCompileTime, RowsAtCompileTime, ColsAtCompileTime> m_storage;
 
@@ -167,7 +166,7 @@
         resize(other.size(), 1);
       }
       else resize(other.rows(), other.cols());
-      return Base::operator=(other);
+      return MatrixBase<Matrix>::operator=(other);
     }
 
     /** This is a special case of the templated operator=. Its purpose is to
diff --git a/Eigen/src/Core/MatrixBase.h b/Eigen/src/Core/MatrixBase.h
index 57ef465..62dfc6b 100644
--- a/Eigen/src/Core/MatrixBase.h
+++ b/Eigen/src/Core/MatrixBase.h
@@ -55,76 +55,74 @@
 
   public:
 
-    typedef typename Scalar<Derived>::Type Scalar;
+    typedef typename ei_traits<Derived>::Scalar Scalar;
 
-    /** \brief Some traits provided by the Derived type.
+    /** The number of rows at compile-time. This is just a copy of the value provided
+      * by the \a Derived type. If a value is not known at compile-time,
+      * it is set to the \a Dynamic constant.
+      * \sa MatrixBase::rows(), MatrixBase::cols(), ColsAtCompileTime, SizeAtCompileTime */
+    enum { RowsAtCompileTime = ei_traits<Derived>::RowsAtCompileTime };
+
+    /** The number of columns at compile-time. This is just a copy of the value provided
+      * by the \a Derived type. If a value is not known at compile-time,
+      * it is set to the \a Dynamic constant.
+      * \sa MatrixBase::rows(), MatrixBase::cols(), RowsAtCompileTime, SizeAtCompileTime */
+    enum { ColsAtCompileTime = ei_traits<Derived>::ColsAtCompileTime };
+
+    /** This is equal to the number of coefficients, i.e. the number of
+      * rows times the number of columns, or to \a Dynamic if this is not
+      * known at compile-time. \sa RowsAtCompileTime, ColsAtCompileTime */
+    enum { SizeAtCompileTime
+      = ei_traits<Derived>::RowsAtCompileTime == Dynamic
+      || ei_traits<Derived>::ColsAtCompileTime == Dynamic
+      ? Dynamic
+      : ei_traits<Derived>::RowsAtCompileTime * ei_traits<Derived>::ColsAtCompileTime
+    };
+
+    /** This value is equal to the maximum possible number of rows that this expression
+      * might have. If this expression might have an arbitrarily high number of rows,
+      * this value is set to \a Dynamic.
       *
-      * Grouping these in a nested subclass is what was needed for ICC compatibility. */
-    struct Traits
-    {
-      /** The number of rows at compile-time. This is just a copy of the value provided
-        * by the \a Derived type. If a value is not known at compile-time,
-        * it is set to the \a Dynamic constant.
-        * \sa MatrixBase::rows(), MatrixBase::cols(), ColsAtCompileTime, SizeAtCompileTime */
-      enum { RowsAtCompileTime = Derived::RowsAtCompileTime };
+      * This value is useful to know when evaluating an expression, in order to determine
+      * whether it is possible to avoid doing a dynamic memory allocation.
+      *
+      * \sa RowsAtCompileTime, MaxColsAtCompileTime, MaxSizeAtCompileTime
+      */
+    enum { MaxRowsAtCompileTime = ei_traits<Derived>::MaxRowsAtCompileTime };
 
-      /** The number of columns at compile-time. This is just a copy of the value provided
-        * by the \a Derived type. If a value is not known at compile-time,
-        * it is set to the \a Dynamic constant.
-        * \sa MatrixBase::rows(), MatrixBase::cols(), RowsAtCompileTime, SizeAtCompileTime */
-      enum { ColsAtCompileTime = Derived::ColsAtCompileTime };
+    /** This value is equal to the maximum possible number of columns that this expression
+      * might have. If this expression might have an arbitrarily high number of columns,
+      * this value is set to \a Dynamic.
+      *
+      * This value is useful to know when evaluating an expression, in order to determine
+      * whether it is possible to avoid doing a dynamic memory allocation.
+      *
+      * \sa ColsAtCompileTime, MaxRowsAtCompileTime, MaxSizeAtCompileTime
+      */
+    enum { MaxColsAtCompileTime = ei_traits<Derived>::MaxColsAtCompileTime };
 
-      /** This is equal to the number of coefficients, i.e. the number of
-        * rows times the number of columns, or to \a Dynamic if this is not
-        * known at compile-time. \sa RowsAtCompileTime, ColsAtCompileTime */
-      enum { SizeAtCompileTime
-        = Derived::RowsAtCompileTime == Dynamic || Derived::ColsAtCompileTime == Dynamic
-        ? Dynamic : Derived::RowsAtCompileTime * Derived::ColsAtCompileTime
-      };
+    /** This value is equal to the maximum possible number of coefficients that this expression
+      * might have. If this expression might have an arbitrarily high number of coefficients,
+      * this value is set to \a Dynamic.
+      *
+      * This value is useful to know when evaluating an expression, in order to determine
+      * whether it is possible to avoid doing a dynamic memory allocation.
+      *
+      * \sa SizeAtCompileTime, MaxRowsAtCompileTime, MaxColsAtCompileTime
+      */
+    enum { MaxSizeAtCompileTime
+      = ei_traits<Derived>::MaxRowsAtCompileTime == Dynamic
+      || ei_traits<Derived>::MaxColsAtCompileTime == Dynamic
+      ? Dynamic
+      : ei_traits<Derived>::MaxRowsAtCompileTime * ei_traits<Derived>::MaxColsAtCompileTime
+    };
 
-      /** This value is equal to the maximum possible number of rows that this expression
-        * might have. If this expression might have an arbitrarily high number of rows,
-        * this value is set to \a Dynamic.
-        *
-        * This value is useful to know when evaluating an expression, in order to determine
-        * whether it is possible to avoid doing a dynamic memory allocation.
-        *
-        * \sa RowsAtCompileTime, MaxColsAtCompileTime, MaxSizeAtCompileTime
-        */
-      enum { MaxRowsAtCompileTime = Derived::MaxRowsAtCompileTime };
-
-      /** This value is equal to the maximum possible number of columns that this expression
-        * might have. If this expression might have an arbitrarily high number of columns,
-        * this value is set to \a Dynamic.
-        *
-        * This value is useful to know when evaluating an expression, in order to determine
-        * whether it is possible to avoid doing a dynamic memory allocation.
-        *
-        * \sa ColsAtCompileTime, MaxRowsAtCompileTime, MaxSizeAtCompileTime
-        */
-      enum { MaxColsAtCompileTime = Derived::MaxColsAtCompileTime };
-
-      /** This value is equal to the maximum possible number of coefficients that this expression
-        * might have. If this expression might have an arbitrarily high number of coefficients,
-        * this value is set to \a Dynamic.
-        *
-        * This value is useful to know when evaluating an expression, in order to determine
-        * whether it is possible to avoid doing a dynamic memory allocation.
-        *
-        * \sa SizeAtCompileTime, MaxRowsAtCompileTime, MaxColsAtCompileTime
-        */
-      enum { MaxSizeAtCompileTime
-        = Derived::MaxRowsAtCompileTime == Dynamic || Derived::MaxColsAtCompileTime == Dynamic
-        ? Dynamic : Derived::MaxRowsAtCompileTime * Derived::MaxColsAtCompileTime
-      };
-
-      /** This is set to true if either the number of rows or the number of
-        * columns is known at compile-time to be equal to 1. Indeed, in that case,
-        * we are dealing with a column-vector (if there is only one column) or with
-        * a row-vector (if there is only one row). */
-      enum { IsVectorAtCompileTime
-        = Derived::RowsAtCompileTime == 1 || Derived::ColsAtCompileTime == 1
-      };
+    /** This is set to true if either the number of rows or the number of
+      * columns is known at compile-time to be equal to 1. Indeed, in that case,
+      * we are dealing with a column-vector (if there is only one column) or with
+      * a row-vector (if there is only one row). */
+    enum { IsVectorAtCompileTime
+      = ei_traits<Derived>::RowsAtCompileTime == 1 || ei_traits<Derived>::ColsAtCompileTime == 1
     };
 
     /** This is the "reference type" used to pass objects of type MatrixBase as arguments
@@ -149,17 +147,17 @@
 
     /// \name matrix properties
     //@{
-    /** \returns the number of rows. \sa cols(), Traits::RowsAtCompileTime */
+    /** \returns the number of rows. \sa cols(), RowsAtCompileTime */
     int rows() const { return static_cast<const Derived *>(this)->_rows(); }
-    /** \returns the number of columns. \sa row(), Traits::ColsAtCompileTime*/
+    /** \returns the number of columns. \sa row(), ColsAtCompileTime*/
     int cols() const { return static_cast<const Derived *>(this)->_cols(); }
     /** \returns the number of coefficients, which is \a rows()*cols().
-      * \sa rows(), cols(), Traits::SizeAtCompileTime. */
+      * \sa rows(), cols(), SizeAtCompileTime. */
     int size() const { return rows() * cols(); }
     /** \returns true if either the number of rows or the number of columns is equal to 1.
       * In other words, this function returns
       * \code rows()==1 || cols()==1 \endcode
-      * \sa rows(), cols(), Traits::IsVectorAtCompileTime. */
+      * \sa rows(), cols(), IsVectorAtCompileTime. */
     bool isVector() const { return rows()==1 || cols()==1; }
     //@}
 
diff --git a/Eigen/src/Core/MatrixRef.h b/Eigen/src/Core/MatrixRef.h
index 5d3100d..0d0f13f 100644
--- a/Eigen/src/Core/MatrixRef.h
+++ b/Eigen/src/Core/MatrixRef.h
@@ -26,17 +26,23 @@
 #define EIGEN_MATRIXREF_H
 
 template<typename MatrixType>
-struct Scalar<MatrixRef<MatrixType> >
-{ typedef typename Scalar<MatrixType>::Type Type; };
+struct ei_traits<MatrixRef<MatrixType> >
+{
+  typedef typename MatrixType::Scalar Scalar;
+  enum {
+    RowsAtCompileTime = MatrixType::RowsAtCompileTime,
+    ColsAtCompileTime = MatrixType::ColsAtCompileTime,
+    MaxRowsAtCompileTime = MatrixType::MaxRowsAtCompileTime,
+    MaxColsAtCompileTime = MatrixType::MaxColsAtCompileTime
+  };
+};
 
 template<typename MatrixType> class MatrixRef
  : public MatrixBase<MatrixRef<MatrixType> >
 {
   public:
-    typedef typename Scalar<MatrixRef>::Type Scalar;
-    friend class MatrixBase<MatrixRef>;
-    friend class MatrixBase<MatrixRef>::Traits;
-    typedef MatrixBase<MatrixRef> Base;
+
+    EIGEN_BASIC_PUBLIC_INTERFACE(MatrixRef)
 
     MatrixRef(const MatrixType& matrix) : m_matrix(matrix) {}
     ~MatrixRef() {}
@@ -44,12 +50,6 @@
     EIGEN_INHERIT_ASSIGNMENT_OPERATORS(MatrixRef)
 
   private:
-    enum {
-      RowsAtCompileTime = MatrixType::Traits::RowsAtCompileTime,
-      ColsAtCompileTime = MatrixType::Traits::ColsAtCompileTime,
-      MaxRowsAtCompileTime = MatrixType::Traits::MaxRowsAtCompileTime,
-      MaxColsAtCompileTime = MatrixType::Traits::MaxColsAtCompileTime
-    };
 
     MatrixRef _asArg() const { return *this; }
     int _rows() const { return m_matrix.rows(); }
diff --git a/Eigen/src/Core/Minor.h b/Eigen/src/Core/Minor.h
index faab9c8..bb957b1 100644
--- a/Eigen/src/Core/Minor.h
+++ b/Eigen/src/Core/Minor.h
@@ -38,18 +38,29 @@
   * \sa MatrixBase::minor()
   */
 template<typename MatrixType>
-struct Scalar<Minor<MatrixType> >
-{ typedef typename Scalar<MatrixType>::Type Type; };
+struct ei_traits<Minor<MatrixType> >
+{
+  typedef typename MatrixType::Scalar Scalar;
+  enum {
+    RowsAtCompileTime = (MatrixType::RowsAtCompileTime != Dynamic) ?
+                          MatrixType::RowsAtCompileTime - 1 : Dynamic,
+    ColsAtCompileTime = (MatrixType::ColsAtCompileTime != Dynamic) ?
+                          MatrixType::ColsAtCompileTime - 1 : Dynamic,
+    MaxRowsAtCompileTime = (MatrixType::MaxRowsAtCompileTime != Dynamic) ?
+                                MatrixType::MaxRowsAtCompileTime - 1 : Dynamic,
+    MaxColsAtCompileTime = (MatrixType::MaxColsAtCompileTime != Dynamic) ?
+                                MatrixType::MaxColsAtCompileTime - 1 : Dynamic
+  };
+};
 
 template<typename MatrixType> class Minor
   : public MatrixBase<Minor<MatrixType> >
 {
   public:
-    typedef typename Scalar<MatrixType>::Type Scalar;
+
+    EIGEN_BASIC_PUBLIC_INTERFACE(Minor)
+
     typedef typename MatrixType::AsArg MatRef;
-    friend class MatrixBase<Minor>;
-    friend class MatrixBase<Minor>::Traits;
-    typedef MatrixBase<Minor> Base;
 
     Minor(const MatRef& matrix,
                 int row, int col)
@@ -62,16 +73,6 @@
     EIGEN_INHERIT_ASSIGNMENT_OPERATORS(Minor)
 
   private:
-    enum {
-      RowsAtCompileTime = (MatrixType::Traits::RowsAtCompileTime != Dynamic) ?
-                            MatrixType::Traits::RowsAtCompileTime - 1 : Dynamic,
-      ColsAtCompileTime = (MatrixType::Traits::ColsAtCompileTime != Dynamic) ?
-                            MatrixType::Traits::ColsAtCompileTime - 1 : Dynamic,
-      MaxRowsAtCompileTime = (MatrixType::Traits::MaxRowsAtCompileTime != Dynamic) ?
-                                 MatrixType::Traits::MaxRowsAtCompileTime - 1 : Dynamic,
-      MaxColsAtCompileTime = (MatrixType::Traits::MaxColsAtCompileTime != Dynamic) ?
-                                 MatrixType::Traits::MaxColsAtCompileTime - 1 : Dynamic
-    };
 
     const Minor& _asArg() const { return *this; }
     int _rows() const { return m_matrix.rows() - 1; }
diff --git a/Eigen/src/Core/Ones.h b/Eigen/src/Core/Ones.h
index b77542d..34bc3e8 100644
--- a/Eigen/src/Core/Ones.h
+++ b/Eigen/src/Core/Ones.h
@@ -33,25 +33,25 @@
   *     MatrixBase::setOnes(), MatrixBase::isOnes()
   */
 template<typename MatrixType>
-struct Scalar<Ones<MatrixType> >
-{ typedef typename Scalar<MatrixType>::Type Type; };
+struct ei_traits<Ones<MatrixType> >
+{
+  typedef typename MatrixType::Scalar Scalar;
+  enum {
+    RowsAtCompileTime = MatrixType::RowsAtCompileTime,
+    ColsAtCompileTime = MatrixType::ColsAtCompileTime,
+    MaxRowsAtCompileTime = MatrixType::MaxRowsAtCompileTime,
+    MaxColsAtCompileTime = MatrixType::MaxColsAtCompileTime
+  };
+};
 
 template<typename MatrixType> class Ones : NoOperatorEquals,
   public MatrixBase<Ones<MatrixType> >
 {
   public:
-    typedef typename Scalar<MatrixType>::Type Scalar;
-    friend class MatrixBase<Ones>;
-    friend class MatrixBase<Ones>::Traits;
-    typedef MatrixBase<Ones> Base;
+
+    EIGEN_BASIC_PUBLIC_INTERFACE(Ones)
 
   private:
-    enum {
-      RowsAtCompileTime = MatrixType::Traits::RowsAtCompileTime,
-      ColsAtCompileTime = MatrixType::Traits::ColsAtCompileTime,
-      MaxRowsAtCompileTime = MatrixType::Traits::MaxRowsAtCompileTime,
-      MaxColsAtCompileTime = MatrixType::Traits::MaxColsAtCompileTime
-    };
 
     const Ones& _asArg() const { return *this; }
     int _rows() const { return m_rows.value(); }
@@ -115,8 +115,8 @@
 template<typename Derived>
 const Ones<Derived> MatrixBase<Derived>::ones(int size)
 {
-  assert(Traits::IsVectorAtCompileTime);
-  if(Traits::RowsAtCompileTime == 1) return Ones<Derived>(1, size);
+  assert(IsVectorAtCompileTime);
+  if(RowsAtCompileTime == 1) return Ones<Derived>(1, size);
   else return Ones<Derived>(size, 1);
 }
 
@@ -133,7 +133,7 @@
 template<typename Derived>
 const Ones<Derived> MatrixBase<Derived>::ones()
 {
-  return Ones<Derived>(Traits::RowsAtCompileTime, Traits::ColsAtCompileTime);
+  return Ones<Derived>(RowsAtCompileTime, ColsAtCompileTime);
 }
 
 /** \returns true if *this is approximately equal to the matrix where all coefficients
diff --git a/Eigen/src/Core/OperatorEquals.h b/Eigen/src/Core/OperatorEquals.h
index ebad3fd..42d8ed9 100644
--- a/Eigen/src/Core/OperatorEquals.h
+++ b/Eigen/src/Core/OperatorEquals.h
@@ -30,8 +30,8 @@
 struct MatrixOperatorEqualsUnroller
 {
   enum {
-    col = (UnrollCount-1) / Derived1::Traits::RowsAtCompileTime,
-    row = (UnrollCount-1) % Derived1::Traits::RowsAtCompileTime
+    col = (UnrollCount-1) / Derived1::RowsAtCompileTime,
+    row = (UnrollCount-1) % Derived1::RowsAtCompileTime
   };
 
   static void run(Derived1 &dst, const Derived2 &src)
@@ -102,16 +102,16 @@
 Derived& MatrixBase<Derived>
   ::operator=(const MatrixBase<OtherDerived>& other)
 {
-  if(Traits::IsVectorAtCompileTime && OtherDerived::Traits::IsVectorAtCompileTime)
+  if(IsVectorAtCompileTime && OtherDerived::IsVectorAtCompileTime)
     // copying a vector expression into a vector
   {
     assert(size() == other.size());
     if(EIGEN_UNROLLED_LOOPS
-    && Traits::SizeAtCompileTime != Dynamic
-    && Traits::SizeAtCompileTime <= EIGEN_UNROLLING_LIMIT_OPEQUAL)
+    && SizeAtCompileTime != Dynamic
+    && SizeAtCompileTime <= EIGEN_UNROLLING_LIMIT_OPEQUAL)
       VectorOperatorEqualsUnroller
         <Derived, OtherDerived,
-          Traits::SizeAtCompileTime <= EIGEN_UNROLLING_LIMIT_OPEQUAL ? Traits::SizeAtCompileTime : Dynamic>::run
+          SizeAtCompileTime <= EIGEN_UNROLLING_LIMIT_OPEQUAL ? SizeAtCompileTime : Dynamic>::run
           (*static_cast<Derived*>(this), *static_cast<const OtherDerived*>(&other));
     else
       for(int i = 0; i < size(); i++)
@@ -122,17 +122,17 @@
   {
     assert(rows() == other.rows() && cols() == other.cols());
     if(EIGEN_UNROLLED_LOOPS
-    && Traits::SizeAtCompileTime != Dynamic
-    && Traits::SizeAtCompileTime <= EIGEN_UNROLLING_LIMIT_OPEQUAL)
+    && SizeAtCompileTime != Dynamic
+    && SizeAtCompileTime <= EIGEN_UNROLLING_LIMIT_OPEQUAL)
     {
       MatrixOperatorEqualsUnroller
         <Derived, OtherDerived,
-          Traits::SizeAtCompileTime <= EIGEN_UNROLLING_LIMIT_OPEQUAL ? Traits::SizeAtCompileTime : Dynamic>::run
+          SizeAtCompileTime <= EIGEN_UNROLLING_LIMIT_OPEQUAL ? SizeAtCompileTime : Dynamic>::run
           (*static_cast<Derived*>(this), *static_cast<const OtherDerived*>(&other));
     }
     else
     {
-      if(Traits::ColsAtCompileTime == Dynamic || Traits::RowsAtCompileTime != Dynamic)
+      if(ColsAtCompileTime == Dynamic || RowsAtCompileTime != Dynamic)
       {
         // traverse in column-major order
         for(int j = 0; j < cols(); j++)
diff --git a/Eigen/src/Core/Product.h b/Eigen/src/Core/Product.h
index 56ea4b3..f0f4120 100644
--- a/Eigen/src/Core/Product.h
+++ b/Eigen/src/Core/Product.h
@@ -1,4 +1,4 @@
-// // This file is part of Eigen, a lightweight C++ template library
+// This file is part of Eigen, a lightweight C++ template library
 // for linear algebra. Eigen itself is part of the KDE project.
 //
 // Copyright (C) 2006-2008 Benoit Jacob <jacob@math.jussieu.fr>
@@ -73,19 +73,26 @@
   * \sa class Sum, class Difference
   */
 template<typename Lhs, typename Rhs>
-struct Scalar<Product<Lhs, Rhs> >
-{ typedef typename Scalar<Lhs>::Type Type; };
+struct ei_traits<Product<Lhs, Rhs> >
+{
+  typedef typename Lhs::Scalar Scalar;
+  enum {
+    RowsAtCompileTime = Lhs::RowsAtCompileTime,
+    ColsAtCompileTime = Rhs::ColsAtCompileTime,
+    MaxRowsAtCompileTime = Lhs::MaxRowsAtCompileTime,
+    MaxColsAtCompileTime = Rhs::MaxColsAtCompileTime
+  };
+};
 
 template<typename Lhs, typename Rhs> class Product : NoOperatorEquals,
   public MatrixBase<Product<Lhs, Rhs> >
 {
   public:
-    typedef typename Scalar<Lhs>::Type Scalar;
+
+    EIGEN_BASIC_PUBLIC_INTERFACE(Product)
+
     typedef typename Lhs::AsArg LhsRef;
     typedef typename Rhs::AsArg RhsRef;
-    friend class MatrixBase<Product>;
-    friend class MatrixBase<Product>::Traits;
-    typedef MatrixBase<Product> Base;
 
     Product(const LhsRef& lhs, const RhsRef& rhs)
       : m_lhs(lhs), m_rhs(rhs)
@@ -94,12 +101,6 @@
     }
 
   private:
-    enum {
-      RowsAtCompileTime = Lhs::Traits::RowsAtCompileTime,
-      ColsAtCompileTime = Rhs::Traits::ColsAtCompileTime,
-      MaxRowsAtCompileTime = Lhs::Traits::MaxRowsAtCompileTime,
-      MaxColsAtCompileTime = Rhs::Traits::MaxColsAtCompileTime
-    };
 
     const Product& _asArg() const { return *this; }
     int _rows() const { return m_lhs.rows(); }
@@ -109,10 +110,10 @@
     {
       Scalar res;
       if(EIGEN_UNROLLED_LOOPS
-      && Lhs::Traits::ColsAtCompileTime != Dynamic
-      && Lhs::Traits::ColsAtCompileTime <= EIGEN_UNROLLING_LIMIT_PRODUCT)
-        ProductUnroller<Lhs::Traits::ColsAtCompileTime-1,
-                        Lhs::Traits::ColsAtCompileTime <= EIGEN_UNROLLING_LIMIT_PRODUCT ? Lhs::Traits::ColsAtCompileTime : Dynamic,
+      && Lhs::ColsAtCompileTime != Dynamic
+      && Lhs::ColsAtCompileTime <= EIGEN_UNROLLING_LIMIT_PRODUCT)
+        ProductUnroller<Lhs::ColsAtCompileTime-1,
+                        Lhs::ColsAtCompileTime <= EIGEN_UNROLLING_LIMIT_PRODUCT ? Lhs::ColsAtCompileTime : Dynamic,
                         LhsRef, RhsRef>
           ::run(row, col, m_lhs, m_rhs, res);
       else
diff --git a/Eigen/src/Core/Random.h b/Eigen/src/Core/Random.h
index 364b8f4..1c2154b 100644
--- a/Eigen/src/Core/Random.h
+++ b/Eigen/src/Core/Random.h
@@ -33,25 +33,23 @@
   *     MatrixBase::setRandom()
   */
 template<typename MatrixType>
-struct Scalar<Random<MatrixType> >
-{ typedef typename Scalar<MatrixType>::Type Type; };
+struct ei_traits<Random<MatrixType> >
+{
+  typedef typename MatrixType::Scalar Scalar;
+  enum {
+    RowsAtCompileTime = MatrixType::RowsAtCompileTime,
+    ColsAtCompileTime = MatrixType::ColsAtCompileTime,
+    MaxRowsAtCompileTime = MatrixType::MaxRowsAtCompileTime,
+    MaxColsAtCompileTime = MatrixType::MaxColsAtCompileTime
+  };
+};
 
 template<typename MatrixType> class Random : NoOperatorEquals,
   public MatrixBase<Random<MatrixType> >
 {
   public:
-    typedef typename MatrixType::Scalar Scalar;
-    friend class MatrixBase<Random>;
-    friend class MatrixBase<Random>::Traits;
-    typedef MatrixBase<Random> Base;
 
-  private:
-    enum {
-      RowsAtCompileTime = MatrixType::Traits::RowsAtCompileTime,
-      ColsAtCompileTime = MatrixType::Traits::ColsAtCompileTime,
-      MaxRowsAtCompileTime = MatrixType::Traits::MaxRowsAtCompileTime,
-      MaxColsAtCompileTime = MatrixType::Traits::MaxColsAtCompileTime
-    };
+    EIGEN_BASIC_PUBLIC_INTERFACE(Random)
 
     const Random& _asArg() const { return *this; }
     int _rows() const { return m_rows.value(); }
@@ -117,8 +115,8 @@
 const Eval<Random<Derived> >
 MatrixBase<Derived>::random(int size)
 {
-  assert(Traits::IsVectorAtCompileTime);
-  if(Traits::RowsAtCompileTime == 1) return Random<Derived>(1, size).eval();
+  assert(IsVectorAtCompileTime);
+  if(RowsAtCompileTime == 1) return Random<Derived>(1, size).eval();
   else return Random<Derived>(size, 1).eval();
 }
 
@@ -137,7 +135,7 @@
 const Eval<Random<Derived> >
 MatrixBase<Derived>::random()
 {
-  return Random<Derived>(Traits::RowsAtCompileTime, Traits::ColsAtCompileTime).eval();
+  return Random<Derived>(RowsAtCompileTime, ColsAtCompileTime).eval();
 }
 
 /** Sets all coefficients in this expression to random values.
diff --git a/Eigen/src/Core/Row.h b/Eigen/src/Core/Row.h
index 3a50297..57a5685 100644
--- a/Eigen/src/Core/Row.h
+++ b/Eigen/src/Core/Row.h
@@ -46,18 +46,25 @@
   * \sa MatrixBase::row()
   */
 template<typename MatrixType>
-struct Scalar<Row<MatrixType> >
-{ typedef typename Scalar<MatrixType>::Type Type; };
+struct ei_traits<Row<MatrixType> >
+{
+  typedef typename MatrixType::Scalar Scalar;
+  enum {
+    RowsAtCompileTime = 1,
+    ColsAtCompileTime = MatrixType::ColsAtCompileTime,
+    MaxRowsAtCompileTime = 1,
+    MaxColsAtCompileTime = MatrixType::MaxColsAtCompileTime
+  };
+};
 
 template<typename MatrixType> class Row
   : public MatrixBase<Row<MatrixType> >
 {
   public:
-    typedef typename Scalar<MatrixType>::Type Scalar;
+
+    EIGEN_BASIC_PUBLIC_INTERFACE(Row)
+
     typedef typename MatrixType::AsArg MatRef;
-    friend class MatrixBase<Row>;
-    friend class MatrixBase<Row>::Traits;
-    typedef MatrixBase<Row> Base;
 
     Row(const MatRef& matrix, int row)
       : m_matrix(matrix), m_row(row)
@@ -68,12 +75,6 @@
     EIGEN_INHERIT_ASSIGNMENT_OPERATORS(Row)
 
   private:
-    enum {
-      RowsAtCompileTime = 1,
-      ColsAtCompileTime = MatrixType::Traits::ColsAtCompileTime,
-      MaxRowsAtCompileTime = 1,
-      MaxColsAtCompileTime = MatrixType::Traits::MaxColsAtCompileTime
-    };
 
     const Row& _asArg() const { return *this; }
 
diff --git a/Eigen/src/Core/Swap.h b/Eigen/src/Core/Swap.h
index c7a1199..5bd1653 100644
--- a/Eigen/src/Core/Swap.h
+++ b/Eigen/src/Core/Swap.h
@@ -30,12 +30,12 @@
 void MatrixBase<Derived>::swap(const MatrixBase<OtherDerived>& other)
 {
   MatrixBase<OtherDerived> *_other = const_cast<MatrixBase<OtherDerived>*>(&other);
-  if(Traits::SizeAtCompileTime == Dynamic)
+  if(SizeAtCompileTime == Dynamic)
   {
     Scalar tmp;
-    if(Traits::IsVectorAtCompileTime)
+    if(IsVectorAtCompileTime)
     {
-      assert(OtherDerived::Traits::IsVectorAtCompileTime && size() == _other->size());
+      assert(OtherDerived::IsVectorAtCompileTime && size() == _other->size());
       for(int i = 0; i < size(); i++)
       {
         tmp = coeff(i);
diff --git a/Eigen/src/Core/Trace.h b/Eigen/src/Core/Trace.h
index 728b4fa..c106f0a 100644
--- a/Eigen/src/Core/Trace.h
+++ b/Eigen/src/Core/Trace.h
@@ -57,16 +57,16 @@
   *
   * \sa diagonal() */
 template<typename Derived>
-typename Scalar<Derived>::Type
+typename ei_traits<Derived>::Scalar
 MatrixBase<Derived>::trace() const
 {
   assert(rows() == cols());
   Scalar res;
   if(EIGEN_UNROLLED_LOOPS
-  && Traits::RowsAtCompileTime != Dynamic
-  && Traits::RowsAtCompileTime <= EIGEN_UNROLLING_LIMIT_PRODUCT)
-    TraceUnroller<Traits::RowsAtCompileTime-1,
-      Traits::RowsAtCompileTime <= EIGEN_UNROLLING_LIMIT_PRODUCT ? Traits::RowsAtCompileTime : Dynamic, Derived>
+  && RowsAtCompileTime != Dynamic
+  && RowsAtCompileTime <= EIGEN_UNROLLING_LIMIT_PRODUCT)
+    TraceUnroller<RowsAtCompileTime-1,
+      RowsAtCompileTime <= EIGEN_UNROLLING_LIMIT_PRODUCT ? RowsAtCompileTime : Dynamic, Derived>
       ::run(*static_cast<const Derived*>(this), res);
   else
   {
diff --git a/Eigen/src/Core/Transpose.h b/Eigen/src/Core/Transpose.h
index 648b8b6..8f80281 100644
--- a/Eigen/src/Core/Transpose.h
+++ b/Eigen/src/Core/Transpose.h
@@ -38,30 +38,31 @@
   * \sa MatrixBase::transpose(), MatrixBase::adjoint()
   */
 template<typename MatrixType>
-struct Scalar<Transpose<MatrixType> >
-{ typedef typename Scalar<MatrixType>::Type Type; };
+struct ei_traits<Transpose<MatrixType> >
+{
+  typedef typename MatrixType::Scalar Scalar;
+  enum {
+    RowsAtCompileTime = MatrixType::ColsAtCompileTime,
+    ColsAtCompileTime = MatrixType::RowsAtCompileTime,
+    MaxRowsAtCompileTime = MatrixType::MaxColsAtCompileTime,
+    MaxColsAtCompileTime = MatrixType::MaxRowsAtCompileTime
+  };
+};
 
 template<typename MatrixType> class Transpose
   : public MatrixBase<Transpose<MatrixType> >
 {
   public:
-    typedef typename Scalar<MatrixType>::Type Scalar;
+
+    EIGEN_BASIC_PUBLIC_INTERFACE(Transpose)
+
     typedef typename MatrixType::AsArg MatRef;
-    friend class MatrixBase<Transpose>;
-    friend class MatrixBase<Transpose>::Traits;
-    typedef MatrixBase<Transpose> Base;
 
     Transpose(const MatRef& matrix) : m_matrix(matrix) {}
 
     EIGEN_INHERIT_ASSIGNMENT_OPERATORS(Transpose)
 
   private:
-    enum {
-      RowsAtCompileTime = MatrixType::Traits::ColsAtCompileTime,
-      ColsAtCompileTime = MatrixType::Traits::RowsAtCompileTime,
-      MaxRowsAtCompileTime = MatrixType::Traits::MaxColsAtCompileTime,
-      MaxColsAtCompileTime = MatrixType::Traits::MaxRowsAtCompileTime
-    };
 
     const Transpose& _asArg() const { return *this; }
     int _rows() const { return m_matrix.cols(); }
diff --git a/Eigen/src/Core/Util.h b/Eigen/src/Core/Util.h
index aceb98d..5b93c3f 100644
--- a/Eigen/src/Core/Util.h
+++ b/Eigen/src/Core/Util.h
@@ -84,18 +84,18 @@
 template<typename OtherDerived> \
 Derived& operator Op(const MatrixBase<OtherDerived>& other) \
 { \
-  return Base::operator Op(other); \
+  return MatrixBase<Derived>::operator Op(other); \
 } \
 Derived& operator Op(const Derived& other) \
 { \
-  return Base::operator Op(other); \
+  return MatrixBase<Derived>::operator Op(other); \
 }
 
 #define EIGEN_INHERIT_SCALAR_ASSIGNMENT_OPERATOR(Derived, Op) \
 template<typename Other> \
 Derived& operator Op(const Other& scalar) \
 { \
-  return Base::operator Op(scalar); \
+  return MatrixBase<Derived>::operator Op(scalar); \
 }
 
 #define EIGEN_INHERIT_ASSIGNMENT_OPERATORS(Derived) \
@@ -105,6 +105,21 @@
 EIGEN_INHERIT_SCALAR_ASSIGNMENT_OPERATOR(Derived, *=) \
 EIGEN_INHERIT_SCALAR_ASSIGNMENT_OPERATOR(Derived, /=)
 
+#define _EIGEN_BASIC_PUBLIC_INTERFACE(Derived, BaseClass) \
+friend class MatrixBase<Derived>; \
+typedef BaseClass Base; \
+typedef typename ei_traits<Derived>::Scalar Scalar; \
+enum { RowsAtCompileTime = ei_traits<Derived>::RowsAtCompileTime, \
+       ColsAtCompileTime = ei_traits<Derived>::ColsAtCompileTime, \
+       MaxRowsAtCompileTime = ei_traits<Derived>::MaxRowsAtCompileTime, \
+       MaxColsAtCompileTime = ei_traits<Derived>::MaxColsAtCompileTime }; \
+using Base::SizeAtCompileTime; \
+using Base::MaxSizeAtCompileTime; \
+using Base::IsVectorAtCompileTime;
+
+#define EIGEN_BASIC_PUBLIC_INTERFACE(Derived) \
+_EIGEN_BASIC_PUBLIC_INTERFACE(Derived, MatrixBase<Derived>)
+
 #define EIGEN_ENUM_MIN(a,b) (((int)a <= (int)b) ? (int)a : (int)b)
 
 const int Dynamic = -10;
diff --git a/Eigen/src/Core/Zero.h b/Eigen/src/Core/Zero.h
index 92fb36e..7848bb0 100644
--- a/Eigen/src/Core/Zero.h
+++ b/Eigen/src/Core/Zero.h
@@ -33,25 +33,25 @@
   *     MatrixBase::setZero(), MatrixBase::isZero()
   */
 template<typename MatrixType>
-struct Scalar<Zero<MatrixType> >
-{ typedef typename Scalar<MatrixType>::Type Type; };
+struct ei_traits<Zero<MatrixType> >
+{
+  typedef typename MatrixType::Scalar Scalar;
+  enum {
+    RowsAtCompileTime = MatrixType::RowsAtCompileTime,
+    ColsAtCompileTime = MatrixType::ColsAtCompileTime,
+    MaxRowsAtCompileTime = MatrixType::MaxRowsAtCompileTime,
+    MaxColsAtCompileTime = MatrixType::MaxColsAtCompileTime
+  };
+};
 
 template<typename MatrixType> class Zero : NoOperatorEquals,
   public MatrixBase<Zero<MatrixType> >
 {
   public:
-    typedef typename Scalar<MatrixType>::Type Scalar;
-    friend class MatrixBase<Zero>;
-    friend class MatrixBase<Zero>::Traits;
-    typedef MatrixBase<Zero> Base;
+
+    EIGEN_BASIC_PUBLIC_INTERFACE(Zero)
 
   private:
-    enum {
-      RowsAtCompileTime = MatrixType::Traits::RowsAtCompileTime,
-      ColsAtCompileTime = MatrixType::Traits::ColsAtCompileTime,
-      MaxRowsAtCompileTime = MatrixType::Traits::MaxRowsAtCompileTime,
-      MaxColsAtCompileTime = MatrixType::Traits::MaxColsAtCompileTime
-    };
 
     const Zero& _asArg() const { return *this; }
     int _rows() const { return m_rows.value(); }
@@ -63,6 +63,7 @@
     }
 
   public:
+
     Zero(int rows, int cols) : m_rows(rows), m_cols(cols)
     {
       assert(rows > 0
@@ -115,8 +116,8 @@
 template<typename Derived>
 const Zero<Derived> MatrixBase<Derived>::zero(int size)
 {
-  assert(Traits::IsVectorAtCompileTime);
-  if(Traits::RowsAtCompileTime == 1) return Zero<Derived>(1, size);
+  assert(IsVectorAtCompileTime);
+  if(RowsAtCompileTime == 1) return Zero<Derived>(1, size);
   else return Zero<Derived>(size, 1);
 }
 
@@ -133,7 +134,7 @@
 template<typename Derived>
 const Zero<Derived> MatrixBase<Derived>::zero()
 {
-  return Zero<Derived>(Traits::RowsAtCompileTime, Traits::ColsAtCompileTime);
+  return Zero<Derived>(RowsAtCompileTime, ColsAtCompileTime);
 }
 
 /** \returns true if *this is approximately equal to the zero matrix,
diff --git a/bench/basicbenchmark.h b/bench/basicbenchmark.h
index 60e1c02..c37d05a 100644
--- a/bench/basicbenchmark.h
+++ b/bench/basicbenchmark.h
@@ -12,19 +12,19 @@
     if (Mode==LazyEval)
     {
       asm("#begin_bench_loop LazyEval");
-      if (MatrixType::Traits::SizeAtCompileTime!=Eigen::Dynamic) asm("#fixedsize");
+      if (MatrixType::SizeAtCompileTime!=Eigen::Dynamic) asm("#fixedsize");
       m = (I + 0.00005 * (m + m.lazyProduct(m))).eval();
     }
     else if (Mode==OmpEval)
     {
       asm("#begin_bench_loop OmpEval");
-      if (MatrixType::Traits::SizeAtCompileTime!=Eigen::Dynamic) asm("#fixedsize");
+      if (MatrixType::SizeAtCompileTime!=Eigen::Dynamic) asm("#fixedsize");
       m = (I + 0.00005 * (m + m.lazyProduct(m))).evalOMP();
     }
     else
     {
       asm("#begin_bench_loop EarlyEval");
-      if (MatrixType::Traits::SizeAtCompileTime!=Eigen::Dynamic) asm("#fixedsize");
+      if (MatrixType::SizeAtCompileTime!=Eigen::Dynamic) asm("#fixedsize");
       m = I + 0.00005 * (m + m * m);
     }
     asm("#end_bench_loop");
diff --git a/test/adjoint.cpp b/test/adjoint.cpp
index 96e3cf6..a400e94 100644
--- a/test/adjoint.cpp
+++ b/test/adjoint.cpp
@@ -33,7 +33,7 @@
   */
 
   typedef typename MatrixType::Scalar Scalar;
-  typedef Matrix<Scalar, MatrixType::Traits::RowsAtCompileTime, 1> VectorType;
+  typedef Matrix<Scalar, MatrixType::RowsAtCompileTime, 1> VectorType;
   int rows = m.rows();
   int cols = m.cols();
 
@@ -41,9 +41,9 @@
              m2 = MatrixType::random(rows, cols),
              m3(rows, cols),
              mzero = MatrixType::zero(rows, cols),
-             identity = Matrix<Scalar, MatrixType::Traits::RowsAtCompileTime, MatrixType::Traits::RowsAtCompileTime>
+             identity = Matrix<Scalar, MatrixType::RowsAtCompileTime, MatrixType::RowsAtCompileTime>
                               ::identity(rows, rows),
-             square = Matrix<Scalar, MatrixType::Traits::RowsAtCompileTime, MatrixType::Traits::RowsAtCompileTime>
+             square = Matrix<Scalar, MatrixType::RowsAtCompileTime, MatrixType::RowsAtCompileTime>
                               ::random(rows, rows);
   VectorType v1 = VectorType::random(rows),
              v2 = VectorType::random(rows),
diff --git a/test/basicstuff.cpp b/test/basicstuff.cpp
index bd009eb..5e79ec2 100644
--- a/test/basicstuff.cpp
+++ b/test/basicstuff.cpp
@@ -29,7 +29,7 @@
 template<typename MatrixType> void basicStuff(const MatrixType& m)
 {
   typedef typename MatrixType::Scalar Scalar;
-  typedef Matrix<Scalar, MatrixType::Traits::RowsAtCompileTime, 1> VectorType;
+  typedef Matrix<Scalar, MatrixType::RowsAtCompileTime, 1> VectorType;
 
   int rows = m.rows();
   int cols = m.cols();
@@ -40,9 +40,9 @@
              m2 = MatrixType::random(rows, cols),
              m3(rows, cols),
              mzero = MatrixType::zero(rows, cols),
-             identity = Matrix<Scalar, MatrixType::Traits::RowsAtCompileTime, MatrixType::Traits::RowsAtCompileTime>
+             identity = Matrix<Scalar, MatrixType::RowsAtCompileTime, MatrixType::RowsAtCompileTime>
                               ::identity(rows, rows),
-             square = Matrix<Scalar, MatrixType::Traits::RowsAtCompileTime, MatrixType::Traits::RowsAtCompileTime>
+             square = Matrix<Scalar, MatrixType::RowsAtCompileTime, MatrixType::RowsAtCompileTime>
                               ::random(rows, rows);
   VectorType v1 = VectorType::random(rows),
              v2 = VectorType::random(rows),
@@ -74,13 +74,13 @@
 
   // now test copying a row-vector into a (column-)vector and conversely.
   square.col(r) = square.row(r).eval();
-  Matrix<Scalar, 1, MatrixType::Traits::RowsAtCompileTime> rv(rows);
-  Matrix<Scalar, MatrixType::Traits::RowsAtCompileTime, 1> cv(rows);
+  Matrix<Scalar, 1, MatrixType::RowsAtCompileTime> rv(rows);
+  Matrix<Scalar, MatrixType::RowsAtCompileTime, 1> cv(rows);
   rv = square.col(r);
   cv = square.row(r);
   VERIFY_IS_APPROX(rv, cv.transpose());
 
-  if(cols!=1 && rows!=1 && MatrixType::Traits::SizeAtCompileTime!=Dynamic)
+  if(cols!=1 && rows!=1 && MatrixType::SizeAtCompileTime!=Dynamic)
   {
     VERIFY_RAISES_ASSERT(m1 = (m2.block(0,0, rows-1, cols-1)));
   }
diff --git a/test/cwiseop.cpp b/test/cwiseop.cpp
index 02a0a1a..5ca51b7 100644
--- a/test/cwiseop.cpp
+++ b/test/cwiseop.cpp
@@ -37,7 +37,7 @@
 template<typename MatrixType> void cwiseops(const MatrixType& m)
 {
   typedef typename MatrixType::Scalar Scalar;
-  typedef Matrix<Scalar, MatrixType::Traits::RowsAtCompileTime, 1> VectorType;
+  typedef Matrix<Scalar, MatrixType::RowsAtCompileTime, 1> VectorType;
   
   int rows = m.rows();
   int cols = m.cols();
@@ -47,9 +47,9 @@
              m3(rows, cols),
              mzero = MatrixType::zero(rows, cols),
              mones = MatrixType::ones(rows, cols),
-             identity = Matrix<Scalar, MatrixType::Traits::RowsAtCompileTime, MatrixType::Traits::RowsAtCompileTime>
+             identity = Matrix<Scalar, MatrixType::RowsAtCompileTime, MatrixType::RowsAtCompileTime>
                               ::identity(rows, rows),
-             square = Matrix<Scalar, MatrixType::Traits::RowsAtCompileTime, MatrixType::Traits::RowsAtCompileTime>
+             square = Matrix<Scalar, MatrixType::RowsAtCompileTime, MatrixType::RowsAtCompileTime>
                               ::random(rows, rows);
   VectorType v1 = VectorType::random(rows),
              v2 = VectorType::random(rows),
diff --git a/test/linearstructure.cpp b/test/linearstructure.cpp
index 593f9e7..475c632 100644
--- a/test/linearstructure.cpp
+++ b/test/linearstructure.cpp
@@ -33,7 +33,7 @@
   */
 
   typedef typename MatrixType::Scalar Scalar;
-  typedef Matrix<Scalar, MatrixType::Traits::RowsAtCompileTime, 1> VectorType;
+  typedef Matrix<Scalar, MatrixType::RowsAtCompileTime, 1> VectorType;
   
   int rows = m.rows();
   int cols = m.cols();
@@ -44,9 +44,9 @@
              m2 = MatrixType::random(rows, cols),
              m3(rows, cols),
              mzero = MatrixType::zero(rows, cols),
-             identity = Matrix<Scalar, MatrixType::Traits::RowsAtCompileTime, MatrixType::Traits::RowsAtCompileTime>
+             identity = Matrix<Scalar, MatrixType::RowsAtCompileTime, MatrixType::RowsAtCompileTime>
                               ::identity(rows, rows),
-             square = Matrix<Scalar, MatrixType::Traits::RowsAtCompileTime, MatrixType::Traits::RowsAtCompileTime>
+             square = Matrix<Scalar, MatrixType::RowsAtCompileTime, MatrixType::RowsAtCompileTime>
                               ::random(rows, rows);
   VectorType v1 = VectorType::random(rows),
              v2 = VectorType::random(rows),
diff --git a/test/main.h b/test/main.h
index d139e55..9465720 100644
--- a/test/main.h
+++ b/test/main.h
@@ -153,21 +153,21 @@
 inline bool test_ei_isApprox(const MatrixBase<Derived1>& m1,
                    const MatrixBase<Derived2>& m2)
 {
-  return m1.isApprox(m2, test_precision<typename Scalar<Derived1>::Type>());
+  return m1.isApprox(m2, test_precision<typename ei_traits<Derived1>::Scalar>());
 }
 
 template<typename Derived1, typename Derived2>
 inline bool test_ei_isMuchSmallerThan(const MatrixBase<Derived1>& m1,
                                    const MatrixBase<Derived2>& m2)
 {
-  return m1.isMuchSmallerThan(m2, test_precision<typename Scalar<Derived1>::Type>());
+  return m1.isMuchSmallerThan(m2, test_precision<typename ei_traits<Derived1>::Scalar>());
 }
 
 template<typename Derived>
 inline bool test_ei_isMuchSmallerThan(const MatrixBase<Derived>& m,
-                                   const typename NumTraits<typename Scalar<Derived>::Type>::Real& s)
+                                   const typename NumTraits<typename ei_traits<Derived>::Scalar>::Real& s)
 {
-  return m.isMuchSmallerThan(s, test_precision<typename Scalar<Derived>::Type>());
+  return m.isMuchSmallerThan(s, test_precision<typename ei_traits<Derived>::Scalar>());
 }
 
 class EigenTest : public QObject
diff --git a/test/miscmatrices.cpp b/test/miscmatrices.cpp
index e04eb7e..54a5934 100644
--- a/test/miscmatrices.cpp
+++ b/test/miscmatrices.cpp
@@ -33,8 +33,8 @@
   */
 
   typedef typename MatrixType::Scalar Scalar;
-  typedef Matrix<Scalar, MatrixType::Traits::RowsAtCompileTime, 1> VectorType;
-  typedef Matrix<Scalar, 1, MatrixType::Traits::ColsAtCompileTime> RowVectorType;
+  typedef Matrix<Scalar, MatrixType::RowsAtCompileTime, 1> VectorType;
+  typedef Matrix<Scalar, 1, MatrixType::ColsAtCompileTime> RowVectorType;
   int rows = m.rows();
   int cols = m.cols();
   
@@ -44,7 +44,7 @@
   VERIFY_IS_APPROX(m1(r,c), static_cast<Scalar>(1));
   VectorType v1 = VectorType::random(rows);
   v1[0];
-  Matrix<Scalar, MatrixType::Traits::RowsAtCompileTime, MatrixType::Traits::RowsAtCompileTime>
+  Matrix<Scalar, MatrixType::RowsAtCompileTime, MatrixType::RowsAtCompileTime>
   square = v1.asDiagonal();
   if(r==r2) VERIFY_IS_APPROX(square(r,r2), v1[r]);
   else VERIFY_IS_MUCH_SMALLER_THAN(square(r,r2), static_cast<Scalar>(1));
diff --git a/test/product.cpp b/test/product.cpp
index 8d802b5..f09b5c3 100644
--- a/test/product.cpp
+++ b/test/product.cpp
@@ -33,7 +33,7 @@
   */
 
   typedef typename MatrixType::Scalar Scalar;
-  typedef Matrix<Scalar, MatrixType::Traits::RowsAtCompileTime, 1> VectorType;
+  typedef Matrix<Scalar, MatrixType::RowsAtCompileTime, 1> VectorType;
 
   int rows = m.rows();
   int cols = m.cols();
@@ -44,9 +44,9 @@
              m2 = MatrixType::random(rows, cols),
              m3(rows, cols),
              mzero = MatrixType::zero(rows, cols),
-             identity = Matrix<Scalar, MatrixType::Traits::RowsAtCompileTime, MatrixType::Traits::RowsAtCompileTime>
+             identity = Matrix<Scalar, MatrixType::RowsAtCompileTime, MatrixType::RowsAtCompileTime>
                               ::identity(rows, rows),
-             square = Matrix<Scalar, MatrixType::Traits::RowsAtCompileTime, MatrixType::Traits::RowsAtCompileTime>
+             square = Matrix<Scalar, MatrixType::RowsAtCompileTime, MatrixType::RowsAtCompileTime>
                               ::random(rows, rows);
   VectorType v1 = VectorType::random(rows),
              v2 = VectorType::random(rows),
diff --git a/test/submatrices.cpp b/test/submatrices.cpp
index 7bb5b2a..cba88bd 100644
--- a/test/submatrices.cpp
+++ b/test/submatrices.cpp
@@ -59,8 +59,8 @@
      Row.h Column.h Block.h Minor.h DiagonalCoeffs.h
   */
   typedef typename MatrixType::Scalar Scalar;
-  typedef Matrix<Scalar, MatrixType::Traits::RowsAtCompileTime, 1> VectorType;
-  typedef Matrix<Scalar, 1, MatrixType::Traits::ColsAtCompileTime> RowVectorType;
+  typedef Matrix<Scalar, MatrixType::RowsAtCompileTime, 1> VectorType;
+  typedef Matrix<Scalar, 1, MatrixType::ColsAtCompileTime> RowVectorType;
   int rows = m.rows();
   int cols = m.cols();
   
@@ -68,9 +68,9 @@
              m2 = MatrixType::random(rows, cols),
              m3(rows, cols),
              mzero = MatrixType::zero(rows, cols),
-             identity = Matrix<Scalar, MatrixType::Traits::RowsAtCompileTime, MatrixType::Traits::RowsAtCompileTime>
+             identity = Matrix<Scalar, MatrixType::RowsAtCompileTime, MatrixType::RowsAtCompileTime>
                               ::identity(rows, rows),
-             square = Matrix<Scalar, MatrixType::Traits::RowsAtCompileTime, MatrixType::Traits::RowsAtCompileTime>
+             square = Matrix<Scalar, MatrixType::RowsAtCompileTime, MatrixType::RowsAtCompileTime>
                               ::random(rows, rows);
   VectorType v1 = VectorType::random(rows),
              v2 = VectorType::random(rows),
@@ -103,7 +103,7 @@
   m1.block(r1,c1,r2-r1+1,c2-c1+1)(r2-r1,c2-c1) = m2.block(0, 0, r2-r1+1,c2-c1+1)(0,0);
   
   //check minor()
-  CheckMinor<Scalar, MatrixType::Traits::RowsAtCompileTime, MatrixType::Traits::ColsAtCompileTime> checkminor(m1,r1,c1);
+  CheckMinor<Scalar, MatrixType::RowsAtCompileTime, MatrixType::ColsAtCompileTime> checkminor(m1,r1,c1);
   
   //check diagonal()
   VERIFY_IS_APPROX(m1.diagonal(), m1.transpose().diagonal());