Fix printing of sparse expressions
diff --git a/Eigen/src/SparseCore/SparseMatrixBase.h b/Eigen/src/SparseCore/SparseMatrixBase.h index 8816bcf..813accc 100644 --- a/Eigen/src/SparseCore/SparseMatrixBase.h +++ b/Eigen/src/SparseCore/SparseMatrixBase.h
@@ -214,10 +214,11 @@ if (Flags&RowMajorBit) { const Nested nm(m.derived()); + internal::evaluator<NestedCleaned> thisEval(nm); for (Index row=0; row<nm.outerSize(); ++row) { Index col = 0; - for (typename NestedCleaned::InnerIterator it(nm.derived(), row); it; ++it) + for (typename internal::evaluator<NestedCleaned>::InnerIterator it(thisEval, row); it; ++it) { for ( ; col<it.index(); ++col) s << "0 "; @@ -232,9 +233,10 @@ else { const Nested nm(m.derived()); + internal::evaluator<NestedCleaned> thisEval(nm); if (m.cols() == 1) { Index row = 0; - for (typename NestedCleaned::InnerIterator it(nm.derived(), 0); it; ++it) + for (typename internal::evaluator<NestedCleaned>::InnerIterator it(thisEval, 0); it; ++it) { for ( ; row<it.index(); ++row) s << "0" << std::endl;