aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2016-11-10 10:35:32 +0100
committerGravatar Gael Guennebaud <g.gael@free.fr>2016-11-10 10:35:32 +0100
commite80bc2ddb07a0f8884685e3a8dbc7149a5a39dc4 (patch)
tree1cc06ad36189277c9c8a89711ab061447cefb910 /Eigen
parentdb3903498d5757e2ea98cbc260ea6566ae88026f (diff)
Fix printing of sparse expressions
Diffstat (limited to 'Eigen')
-rw-r--r--Eigen/src/SparseCore/SparseMatrixBase.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/Eigen/src/SparseCore/SparseMatrixBase.h b/Eigen/src/SparseCore/SparseMatrixBase.h
index 8816bcff4..813accce1 100644
--- a/Eigen/src/SparseCore/SparseMatrixBase.h
+++ b/Eigen/src/SparseCore/SparseMatrixBase.h
@@ -214,10 +214,11 @@ template<typename Derived> class SparseMatrixBase
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 @@ template<typename Derived> class SparseMatrixBase
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;