.sparseView fails on matrix products
@rmlarsen1
Submitted by Rasmus Munk LarsenAssigned to Nobody
Link to original bugzilla bug (#1224)
Version: 3.3 (current stable)
Description
The following expression used to compile with 3.2, but fails to compile with the dev branch (I am synced at commit ba95e43e):
rotation_matrix_ = (encoder_matrix_ * decoder_matrix_).sparseView(kReference, kEpsilon);
encoded and decoder matrices are fixed-size dense matrices. I get the following error message:
In file included from XXX.cc:1:
In file included from YYY.h:7:
In file included from ZZZ/Eigen/SparseCore:42:
ZZZ/Eigen/src/SparseCore/SparseMatrix.h:1075:36: error: no type named 'InnerIterator' in 'Eigen::internal::evaluator<Eigen::SparseView<Eigen::Product<Eigen::Matrix<float, -1, -1, 0, -1, -1>, Eigen::Matrix<float, -1, -1, 0, -1, -1>, 0> > >'
for (typename OtherCopyEval::InnerIterator it(otherCopyEval, j); it; ++it)
~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
XXX.cc:53:20: note: in instantiation of function template specialization 'Eigen::SparseMatrix<float, 0, int>::operator=<Eigen::SparseView<Eigen::Product<Eigen::Matrix<float, -1, -1, 0, -1, -1>, Eigen::Matrix<float, -1, -1, 0, -1, -1>, 0> > >' requested here
rotation_matrix_ = (encoder_matrix_ * decoder_matrix_).sparseView(kReference, kEpsilon);
^
In file included from XXX.cc:1:
In file included from YYY.h:7:
In file included from ZZZ/Eigen/SparseCore:42:
ZZZ/Eigen/src/SparseCore/SparseMatrix.h:1094:36: error: no type named 'InnerIterator' in 'Eigen::internal::evaluator<Eigen::SparseView<Eigen::Product<Eigen::Matrix<float, -1, -1, 0, -1, -1>, Eigen::Matrix<float, -1, -1, 0, -1, -1>, 0> > >'
for (typename OtherCopyEval::InnerIterator it(otherCopyEval, j); it; ++it)
~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
In file included from XXX.cc:1:
In file included from YYY.h:7:
In file included from ZZZ/Eigen/SparseCore:57:
ZZZ/Eigen/src/SparseCore/SparseProduct.h:145:12: error: static_cast from 'Eigen::internal::evaluator<Eigen::SparseView<Eigen::Product<Eigen::Matrix<float, -1, -1, 0, -1, -1>, Eigen::Matrix<float, -1, -1, 0, -1, -1>, 0> > > *' to 'Base *' (aka 'evaluator<SparseMatrix<float, Flags & RowMajorBit ? RowMajor : ColMajor, long> > '), which are not related by inheritance, is not allowed
::new (static_cast<Base>(this)) Base(m_result);
^~~~~~~~~~~~~~~~~~~~~~~~
ZZZ/Eigen/src/SparseCore/SparseMatrix.h:1067:19: note: in instantiation of member function 'Eigen::internal::evaluator<Eigen::SparseView<Eigen::Product<Eigen::Matrix<float, -1, -1, 0, -1, -1>, Eigen::Matrix<float, -1, -1, 0, -1, -1>, 0> > >::evaluator' requested here
OtherCopyEval otherCopyEval(otherCopy);
^
XXX.cc:53:20: note: in instantiation of function template specialization 'Eigen::SparseMatrix<float, 0, int>::operator=<Eigen::SparseView<Eigen::Product<Eigen::Matrix<float, -1, -1, 0, -1, -1>, Eigen::Matrix<float, -1, -1, 0, -1, -1>, 0> > >' requested here
rotation_matrix_ = (encoder_matrix_ * decoder_matrix_).sparseView(kReference, kEpsilon);
^