mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-05-04 01:34:07 +08:00
Fix printing of sparse expressions
This commit is contained in:
parent
db3903498d
commit
e80bc2ddb0
@ -214,10 +214,11 @@ template<typename Derived> class SparseMatrixBase
|
|||||||
if (Flags&RowMajorBit)
|
if (Flags&RowMajorBit)
|
||||||
{
|
{
|
||||||
const Nested nm(m.derived());
|
const Nested nm(m.derived());
|
||||||
|
internal::evaluator<NestedCleaned> thisEval(nm);
|
||||||
for (Index row=0; row<nm.outerSize(); ++row)
|
for (Index row=0; row<nm.outerSize(); ++row)
|
||||||
{
|
{
|
||||||
Index col = 0;
|
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)
|
for ( ; col<it.index(); ++col)
|
||||||
s << "0 ";
|
s << "0 ";
|
||||||
@ -232,9 +233,10 @@ template<typename Derived> class SparseMatrixBase
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
const Nested nm(m.derived());
|
const Nested nm(m.derived());
|
||||||
|
internal::evaluator<NestedCleaned> thisEval(nm);
|
||||||
if (m.cols() == 1) {
|
if (m.cols() == 1) {
|
||||||
Index row = 0;
|
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)
|
for ( ; row<it.index(); ++row)
|
||||||
s << "0" << std::endl;
|
s << "0" << std::endl;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user