diff --git a/Eigen/src/SparseCore/SparseBlock.h b/Eigen/src/SparseCore/SparseBlock.h index 71f4b37b7..778939791 100644 --- a/Eigen/src/SparseCore/SparseBlock.h +++ b/Eigen/src/SparseCore/SparseBlock.h @@ -329,17 +329,6 @@ SparseMatrixBase::innerVectors(Index outerStart, Index outerSize) const } -namespace internal { - -template< typename XprType, int BlockRows, int BlockCols, bool InnerPanel, - bool OuterVector = (BlockCols==1 && XprType::IsRowMajor) - | // FIXME | instead of || to please GCC 4.4.0 stupid warning "suggest parentheses around &&". - // revert to || as soon as not needed anymore. - (BlockRows==1 && !XprType::IsRowMajor)> -class GenericSparseBlockInnerIteratorImpl; - -} - /** Generic implementation of sparse Block expression. * Real-only. */ @@ -405,7 +394,7 @@ public: Index blockCols() const { return m_blockCols.value(); } protected: - friend class internal::GenericSparseBlockInnerIteratorImpl; +// friend class internal::GenericSparseBlockInnerIteratorImpl; friend class ReverseInnerIterator; friend struct internal::unary_evaluator, internal::IteratorBased, Scalar >; @@ -422,94 +411,6 @@ public: }; namespace internal { - template - class GenericSparseBlockInnerIteratorImpl : public Block::_MatrixTypeNested::InnerIterator - { - typedef Block BlockType; - enum { - IsRowMajor = BlockType::IsRowMajor - }; - typedef typename BlockType::_MatrixTypeNested _MatrixTypeNested; - typedef typename BlockType::StorageIndex StorageIndex; - typedef typename _MatrixTypeNested::InnerIterator Base; - const BlockType& m_block; - Index m_end; - public: - - EIGEN_STRONG_INLINE GenericSparseBlockInnerIteratorImpl(const BlockType& block, Index outer) - : Base(block.derived().nestedExpression(), outer + (IsRowMajor ? block.m_startRow.value() : block.m_startCol.value())), - m_block(block), - m_end(IsRowMajor ? block.m_startCol.value()+block.m_blockCols.value() : block.m_startRow.value()+block.m_blockRows.value()) - { - while( (Base::operator bool()) && (Base::index() < (IsRowMajor ? m_block.m_startCol.value() : m_block.m_startRow.value())) ) - Base::operator++(); - } - - inline Index index() const { return Base::index() - (IsRowMajor ? m_block.m_startCol.value() : m_block.m_startRow.value()); } - inline Index outer() const { return Base::outer() - (IsRowMajor ? m_block.m_startRow.value() : m_block.m_startCol.value()); } - inline Index row() const { return Base::row() - m_block.m_startRow.value(); } - inline Index col() const { return Base::col() - m_block.m_startCol.value(); } - - inline operator bool() const { return Base::operator bool() && Base::index() < m_end; } - }; - - // Row vector of a column-major sparse matrix or column of a row-major one. - template - class GenericSparseBlockInnerIteratorImpl - { - typedef Block BlockType; - enum { - IsRowMajor = BlockType::IsRowMajor - }; - typedef typename BlockType::_MatrixTypeNested _MatrixTypeNested; - typedef typename BlockType::StorageIndex StorageIndex; - typedef typename BlockType::Scalar Scalar; - const BlockType& m_block; - Index m_outerPos; - Index m_innerIndex; - Scalar m_value; - Index m_end; - public: - - explicit EIGEN_STRONG_INLINE GenericSparseBlockInnerIteratorImpl(const BlockType& block, Index outer = 0) - : - m_block(block), - m_outerPos( (IsRowMajor ? block.m_startCol.value() : block.m_startRow.value()) - 1), // -1 so that operator++ finds the first non-zero entry - m_innerIndex(IsRowMajor ? block.m_startRow.value() : block.m_startCol.value()), - m_end(IsRowMajor ? block.m_startCol.value()+block.m_blockCols.value() : block.m_startRow.value()+block.m_blockRows.value()) - { - EIGEN_UNUSED_VARIABLE(outer); - eigen_assert(outer==0); - - ++(*this); - } - - inline Index index() const { return m_outerPos - (IsRowMajor ? m_block.m_startCol.value() : m_block.m_startRow.value()); } - inline Index outer() const { return 0; } - inline Index row() const { return IsRowMajor ? 0 : index(); } - inline Index col() const { return IsRowMajor ? index() : 0; } - - inline Scalar value() const { return m_value; } - - inline GenericSparseBlockInnerIteratorImpl& operator++() - { - // search next non-zero entry - while(++m_outerPos struct unary_evaluator, IteratorBased >