![]() Registered Member ![]()
|
I have a templated function that takes a sparse matrix:
When I run the code under valgrind, however, I get errors at the line "for( typename Derived::InnerIterator it( A, col ); it; ++it )." If I instead replace typename Derived::InnerIterator with the actual type, Eigen::SparseMatrix<double,Eigen::ColMajor>::InnerIterator, there is no problem under valgrind. Should I obtain the InnerIterator type in some other fashion? |
![]() Moderator ![]()
|
Using Derived::InnerIterator is fine, however, you have to pass A.derived() to its constructor, not directly a SparseMatrixBase.
|
![]() Registered Member ![]()
|
That fixed my problem, thank you! Is there a way to generate a compiler warning for these sorts of bugs?
|
Registered users: Bing [Bot], claydoh, Google [Bot], rblackwell, Yahoo [Bot]