New user self-registration is currently disabled. Please email eigen-core-team @ if you need an account.
Bug 1258 - Map<SparseMatrix>.coeffRef() compilation failure
Map<SparseMatrix>.coeffRef() compilation failure
Product: Eigen
Classification: Unclassified
Component: Sparse
3.3 (current stable)
All All
: Normal Compilation Problem
Assigned To: Nobody
Depends on:
  Show dependency treegraph
Reported: 2016-07-25 21:01 UTC by João Rui Leal
Modified: 2016-07-26 07:39 UTC (History)
2 users (show)


Description João Rui Leal 2016-07-25 21:01:25 UTC
There is an incorrect pointer type in Map<SparseMatrix>.coeffRef().

It will not compile:
Map<SparseMatrix<type>> mat(m,n);
mat.coeffRef(i,j) = y;

The line in SparseMapBase::coeffRef(Index row, Index col):

Index* r = std::lower_bound(&Base::m_innerIndices[start],&Base::m_innerIndices[end],inner);

should be

StorageIndex* r = std::lower_bound(&Base::m_innerIndices[start],&Base::m_innerIndices[end],inner);
Comment 1 Gael Guennebaud 2016-07-26 07:39:11 UTC
Thanks for the report. Fixed:
Summary:     Bug 1258: fix compilation of Map<SparseMatrix>::coeffRef

Note You need to log in before you can comment on or make changes to this bug.