diff --git a/Eigen/src/Core/Block.h b/Eigen/src/Core/Block.h index f4e1698d6..5f6426517 100644 --- a/Eigen/src/Core/Block.h +++ b/Eigen/src/Core/Block.h @@ -191,7 +191,8 @@ template,BlockRows,BlockCols,true,Sparse> : public SparseMatrixBase,BlockRows,BlockCols,true> > { - typedef SparseMatrix<_Scalar, _Options, _Index> XprType; - typedef typename internal::remove_all::type _MatrixTypeNested; - typedef Block BlockType; + typedef SparseMatrix<_Scalar, _Options, _Index> SparseMatrixType; + typedef typename internal::remove_all::type _MatrixTypeNested; + typedef Block BlockType; public: enum { IsRowMajor = internal::traits::IsRowMajor }; EIGEN_SPARSE_PUBLIC_INTERFACE(BlockType) @@ -85,22 +85,22 @@ protected: enum { OuterSize = IsRowMajor ? BlockRows : BlockCols }; public: - class InnerIterator: public XprType::InnerIterator + class InnerIterator: public SparseMatrixType::InnerIterator { public: inline InnerIterator(const BlockType& xpr, Index outer) - : XprType::InnerIterator(xpr.m_matrix, xpr.m_outerStart + outer), m_outer(outer) + : SparseMatrixType::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; }; - class ReverseInnerIterator: public XprType::ReverseInnerIterator + class ReverseInnerIterator: public SparseMatrixType::ReverseInnerIterator { public: inline ReverseInnerIterator(const BlockType& xpr, Index outer) - : XprType::ReverseInnerIterator(xpr.m_matrix, xpr.m_outerStart + outer), m_outer(outer) + : SparseMatrixType::ReverseInnerIterator(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; } @@ -108,18 +108,18 @@ public: Index m_outer; }; - inline BlockImpl(const XprType& xpr, int i) + inline BlockImpl(const SparseMatrixType& xpr, int i) : m_matrix(xpr), m_outerStart(i), m_outerSize(OuterSize) {} - inline BlockImpl(const XprType& xpr, int startRow, int startCol, int blockRows, int blockCols) + inline BlockImpl(const SparseMatrixType& xpr, int startRow, int startCol, int blockRows, int blockCols) : m_matrix(xpr), m_outerStart(IsRowMajor ? startRow : startCol), m_outerSize(IsRowMajor ? blockRows : blockCols) {} template inline BlockType& operator=(const SparseMatrixBase& other) { - typedef typename internal::remove_all::type _NestedMatrixType; + typedef typename internal::remove_all::type _NestedMatrixType; _NestedMatrixType& matrix = const_cast<_NestedMatrixType&>(m_matrix);; // This assignement is slow if this vector set is not empty // and/or it is not at the end of the nonzeros of the underlying matrix. @@ -138,7 +138,7 @@ public: if(nnz>free_size) { // realloc manually to reduce copies - typename XprType::Storage newdata(m_matrix.nonZeros() - nnz_previous + nnz); + typename SparseMatrixType::Storage newdata(m_matrix.nonZeros() - nnz_previous + nnz); std::memcpy(&newdata.value(0), &m_matrix.data().value(0), nnz_head*sizeof(Scalar)); std::memcpy(&newdata.index(0), &m_matrix.data().index(0), nnz_head*sizeof(Index)); @@ -236,7 +236,7 @@ public: protected: - typename XprType::Nested m_matrix; + typename SparseMatrixType::Nested m_matrix; Index m_outerStart; const internal::variable_if_dynamic m_outerSize; @@ -282,8 +282,6 @@ const Block SparseMatrixBase::inner } -#if 1 - /** Generic implementation of sparse Block expression. * Real-only. */ @@ -401,8 +399,6 @@ public: }; -#endif - } // end namespace Eigen #endif // EIGEN_SPARSE_BLOCK_H