diff --git a/Eigen/src/Core/util/Macros.h b/Eigen/src/Core/util/Macros.h index abc69f866..f9741e5c6 100644 --- a/Eigen/src/Core/util/Macros.h +++ b/Eigen/src/Core/util/Macros.h @@ -761,16 +761,17 @@ namespace Eigen { Flags = Eigen::internal::traits::Flags, \ SizeAtCompileTime = Base::SizeAtCompileTime, \ MaxSizeAtCompileTime = Base::MaxSizeAtCompileTime, \ - IsVectorAtCompileTime = Base::IsVectorAtCompileTime }; + IsVectorAtCompileTime = Base::IsVectorAtCompileTime }; \ + using Base::derived; \ + using Base::const_cast_derived; #define EIGEN_DENSE_PUBLIC_INTERFACE(Derived) \ EIGEN_GENERIC_PUBLIC_INTERFACE(Derived) \ typedef typename Base::PacketScalar PacketScalar; \ enum { MaxRowsAtCompileTime = Eigen::internal::traits::MaxRowsAtCompileTime, \ - MaxColsAtCompileTime = Eigen::internal::traits::MaxColsAtCompileTime}; \ - using Base::derived; \ - using Base::const_cast_derived; + MaxColsAtCompileTime = Eigen::internal::traits::MaxColsAtCompileTime}; + #define EIGEN_PLAIN_ENUM_MIN(a,b) (((int)a <= (int)b) ? (int)a : (int)b) #define EIGEN_PLAIN_ENUM_MAX(a,b) (((int)a >= (int)b) ? (int)a : (int)b) diff --git a/Eigen/src/SparseCore/SparseBlock.h b/Eigen/src/SparseCore/SparseBlock.h index 202bf9a12..10be84856 100644 --- a/Eigen/src/SparseCore/SparseBlock.h +++ b/Eigen/src/SparseCore/SparseBlock.h @@ -23,6 +23,8 @@ public: enum { IsRowMajor = internal::traits::IsRowMajor }; protected: enum { OuterSize = IsRowMajor ? BlockRows : BlockCols }; + typedef SparseMatrixBase Base; + using Base::convert_index; public: EIGEN_SPARSE_PUBLIC_INTERFACE(BlockType) @@ -88,10 +90,11 @@ class sparse_matrix_block_impl { typedef typename internal::remove_all::type _MatrixTypeNested; typedef Block BlockType; + typedef SparseCompressedBase > Base; + using Base::convert_index; public: enum { IsRowMajor = internal::traits::IsRowMajor }; - typedef SparseCompressedBase > Base; - _EIGEN_SPARSE_PUBLIC_INTERFACE(BlockType) + EIGEN_SPARSE_PUBLIC_INTERFACE(BlockType) protected: typedef typename Base::IndexVector IndexVector; enum { OuterSize = IsRowMajor ? BlockRows : BlockCols }; @@ -359,7 +362,9 @@ template class BlockImpl : public SparseMatrixBase >, internal::no_assignment_operator { - typedef Block BlockType; + typedef Block BlockType; + typedef SparseMatrixBase Base; + using Base::convert_index; public: enum { IsRowMajor = internal::traits::IsRowMajor }; EIGEN_SPARSE_PUBLIC_INTERFACE(BlockType) diff --git a/Eigen/src/SparseCore/SparseCompressedBase.h b/Eigen/src/SparseCore/SparseCompressedBase.h index ad3085a55..97ca44761 100644 --- a/Eigen/src/SparseCore/SparseCompressedBase.h +++ b/Eigen/src/SparseCore/SparseCompressedBase.h @@ -28,7 +28,7 @@ class SparseCompressedBase { public: typedef SparseMatrixBase Base; - _EIGEN_SPARSE_PUBLIC_INTERFACE(SparseCompressedBase) + EIGEN_SPARSE_PUBLIC_INTERFACE(SparseCompressedBase) using Base::operator=; using Base::IsRowMajor; diff --git a/Eigen/src/SparseCore/SparseCwiseBinaryOp.h b/Eigen/src/SparseCore/SparseCwiseBinaryOp.h index 973b80095..b87b6b749 100644 --- a/Eigen/src/SparseCore/SparseCwiseBinaryOp.h +++ b/Eigen/src/SparseCore/SparseCwiseBinaryOp.h @@ -35,6 +35,7 @@ class CwiseBinaryOpImpl { public: typedef CwiseBinaryOp Derived; + typedef SparseMatrixBase Base; EIGEN_SPARSE_PUBLIC_INTERFACE(Derived) CwiseBinaryOpImpl() { diff --git a/Eigen/src/SparseCore/SparseMap.h b/Eigen/src/SparseCore/SparseMap.h index 349927905..36c09ab0c 100644 --- a/Eigen/src/SparseCore/SparseMap.h +++ b/Eigen/src/SparseCore/SparseMap.h @@ -191,7 +191,7 @@ class Map, Options, StrideType> { public: typedef SparseMapBase Base; - _EIGEN_SPARSE_PUBLIC_INTERFACE(Map) + EIGEN_SPARSE_PUBLIC_INTERFACE(Map) enum { IsRowMajor = Base::IsRowMajor }; public: @@ -211,7 +211,7 @@ class Map, Options, StrideType { public: typedef SparseMapBase Base; - _EIGEN_SPARSE_PUBLIC_INTERFACE(Map) + EIGEN_SPARSE_PUBLIC_INTERFACE(Map) enum { IsRowMajor = Base::IsRowMajor }; public: diff --git a/Eigen/src/SparseCore/SparseMatrix.h b/Eigen/src/SparseCore/SparseMatrix.h index 14b196480..4cf3145fd 100644 --- a/Eigen/src/SparseCore/SparseMatrix.h +++ b/Eigen/src/SparseCore/SparseMatrix.h @@ -92,11 +92,12 @@ template class SparseMatrix : public SparseCompressedBase > { - public: typedef SparseCompressedBase Base; + using Base::convert_index; + public: using Base::isCompressed; using Base::nonZeros; - _EIGEN_SPARSE_PUBLIC_INTERFACE(SparseMatrix) + EIGEN_SPARSE_PUBLIC_INTERFACE(SparseMatrix) using Base::operator+=; using Base::operator-=; diff --git a/Eigen/src/SparseCore/SparseRef.h b/Eigen/src/SparseCore/SparseRef.h index 262fd9aef..e10bf6878 100644 --- a/Eigen/src/SparseCore/SparseRef.h +++ b/Eigen/src/SparseCore/SparseRef.h @@ -58,7 +58,7 @@ template class SparseRefBase public: typedef SparseMapBase Base; - _EIGEN_SPARSE_PUBLIC_INTERFACE(SparseRefBase) + EIGEN_SPARSE_PUBLIC_INTERFACE(SparseRefBase) SparseRefBase() : Base(RowsAtCompileTime==Dynamic?0:RowsAtCompileTime,ColsAtCompileTime==Dynamic?0:ColsAtCompileTime, 0, 0, 0, 0, 0) @@ -104,7 +104,7 @@ class Ref, Options, StrideType > public: typedef internal::SparseRefBase Base; - _EIGEN_SPARSE_PUBLIC_INTERFACE(Ref) + EIGEN_SPARSE_PUBLIC_INTERFACE(Ref) #ifndef EIGEN_PARSED_BY_DOXYGEN @@ -148,7 +148,7 @@ class Ref, Options, StrideType public: typedef internal::SparseRefBase Base; - _EIGEN_SPARSE_PUBLIC_INTERFACE(Ref) + EIGEN_SPARSE_PUBLIC_INTERFACE(Ref) template inline Ref(const SparseMatrixBase& expr) diff --git a/Eigen/src/SparseCore/SparseTriangularView.h b/Eigen/src/SparseCore/SparseTriangularView.h index 3d9946149..57d88893e 100644 --- a/Eigen/src/SparseCore/SparseTriangularView.h +++ b/Eigen/src/SparseCore/SparseTriangularView.h @@ -34,10 +34,11 @@ template class TriangularViewImpl TriangularViewType; -protected: + protected: // dummy solve function to make TriangularView happy. void solve() const; + typedef SparseMatrixBase Base; public: EIGEN_SPARSE_PUBLIC_INTERFACE(TriangularViewType) diff --git a/Eigen/src/SparseCore/SparseUtil.h b/Eigen/src/SparseCore/SparseUtil.h index d53a9cb17..75c604f79 100644 --- a/Eigen/src/SparseCore/SparseUtil.h +++ b/Eigen/src/SparseCore/SparseUtil.h @@ -39,26 +39,11 @@ EIGEN_STRONG_INLINE Derived& operator Op(const Other& scalar) \ #define EIGEN_SPARSE_INHERIT_ASSIGNMENT_OPERATORS(Derived) \ EIGEN_SPARSE_INHERIT_ASSIGNMENT_OPERATOR(Derived, =) -// TODO this is mostly the same as EIGEN_GENERIC_PUBLIC_INTERFACE -#define _EIGEN_SPARSE_PUBLIC_INTERFACE(Derived) \ - typedef typename Eigen::internal::traits::Scalar Scalar; \ - typedef typename Eigen::NumTraits::Real RealScalar; \ - typedef typename Eigen::internal::ref_selector::type Nested; \ - typedef typename Eigen::internal::traits::StorageKind StorageKind; \ - typedef typename Eigen::internal::traits::StorageIndex StorageIndex; \ - enum { RowsAtCompileTime = Eigen::internal::traits::RowsAtCompileTime, \ - ColsAtCompileTime = Eigen::internal::traits::ColsAtCompileTime, \ - Flags = Eigen::internal::traits::Flags, \ - SizeAtCompileTime = Base::SizeAtCompileTime, \ - IsVectorAtCompileTime = Base::IsVectorAtCompileTime }; \ - using Base::derived; \ - using Base::const_cast_derived; \ - using Base::convert_index; - -#define EIGEN_SPARSE_PUBLIC_INTERFACE(Derived) \ - typedef Eigen::SparseMatrixBase Base; \ - _EIGEN_SPARSE_PUBLIC_INTERFACE(Derived) +#define EIGEN_SPARSE_PUBLIC_INTERFACE(Derived) \ + EIGEN_GENERIC_PUBLIC_INTERFACE(Derived) + + const int CoherentAccessPattern = 0x1; const int InnerRandomAccessPattern = 0x2 | CoherentAccessPattern; const int OuterRandomAccessPattern = 0x4 | CoherentAccessPattern; diff --git a/Eigen/src/SparseCore/SparseVector.h b/Eigen/src/SparseCore/SparseVector.h index 38b5a53df..f941fa5e1 100644 --- a/Eigen/src/SparseCore/SparseVector.h +++ b/Eigen/src/SparseCore/SparseVector.h @@ -66,9 +66,9 @@ class SparseVector : public SparseCompressedBase > { typedef SparseCompressedBase Base; - + using Base::convert_index; public: - _EIGEN_SPARSE_PUBLIC_INTERFACE(SparseVector) + EIGEN_SPARSE_PUBLIC_INTERFACE(SparseVector) EIGEN_SPARSE_INHERIT_ASSIGNMENT_OPERATOR(SparseVector, +=) EIGEN_SPARSE_INHERIT_ASSIGNMENT_OPERATOR(SparseVector, -=) diff --git a/Eigen/src/SparseCore/SparseView.h b/Eigen/src/SparseCore/SparseView.h index 761e72038..c945c4dab 100644 --- a/Eigen/src/SparseCore/SparseView.h +++ b/Eigen/src/SparseCore/SparseView.h @@ -32,6 +32,7 @@ class SparseView : public SparseMatrixBase > { typedef typename MatrixType::Nested MatrixTypeNested; typedef typename internal::remove_all::type _MatrixTypeNested; + typedef SparseMatrixBase Base; public: EIGEN_SPARSE_PUBLIC_INTERFACE(SparseView) typedef typename internal::remove_all::type NestedExpression; diff --git a/unsupported/Eigen/src/SparseExtra/DynamicSparseMatrix.h b/unsupported/Eigen/src/SparseExtra/DynamicSparseMatrix.h index 54e0c5d63..037a13f86 100644 --- a/unsupported/Eigen/src/SparseExtra/DynamicSparseMatrix.h +++ b/unsupported/Eigen/src/SparseExtra/DynamicSparseMatrix.h @@ -56,6 +56,8 @@ template class DynamicSparseMatrix : public SparseMatrixBase > { + typedef SparseMatrixBase Base; + using Base::convert_index; public: EIGEN_SPARSE_PUBLIC_INTERFACE(DynamicSparseMatrix) // FIXME: why are these operator already alvailable ???