Registered Member
|
The following code generates compiler errors.
Eigen::MatrixXd kp(rows, rows); Matrix< PointType, Eigen::Dynamic, 1> sol_mat(rows, 1); Matrix< PointType, Eigen::Dynamic, 1> rhs_mat(rows, 1); ... sol_mat = kp.fullPivLu().solve( rhs_mat ); Essentially operator-= isn't defined on Matricies for my type PointType, which is a point that behaves like a scalar. I assume /home/tewk/research/codes/util/Eigen/src/Core/products/TriangularSolverVector.h:117 works for Matrix< double, Eigen::Dynamic, 1>, so I 'm curious where the -=overload for double is and how I can specify a -=overload for my type. Compiler Error: 36 /home/tewk/research/codes/util/Eigen/src/Core/products/TriangularSolverVector.h:117 col 54: error: no match for ‘operator-=’ (operand types are ‘Eigen::Map<Eigen::Matrix<util::Point<3u, double, true>, -1, 1, 0, -1, 1>, 0, Eigen::Stride<0, 0> >’ and ‘util::Point<3u, double, true>’) 39 /home/tewk/research/codes/util/Eigen/src/Core/products/TriangularSolverVector.h:117 col 54: note: candidates are: 40 /home/tewk/research/codes/util/Eigen/src/Core/CwiseBinaryOp.h:206 col 1: note: template<class OtherDerived> Derived& Eigen::MatrixBase<Derived>::operator-=(const Eigen::MatrixBase <OtherDerived>&) [with OtherDerived = OtherDerived; Derived = Eigen::Map<Eigen::Matrix<util::Point<3u, double, true>, -1, 1, 0, -1, 1>, 0, Eigen::Stride<0, 0> >] 43 /home/tewk/research/codes/util/Eigen/src/Core/CwiseBinaryOp.h:206 col 1: note: template argument deduction/substitution failed: 44 /home/tewk/research/codes/util/Eigen/src/Core/products/TriangularSolverVector.h:117 col 54: note: ‘util::Point<3u, double, true>’ is not derived from ‘const Eigen::MatrixBase<Derived>’ 47 /home/tewk/research/codes/util/Eigen/src/Core/MatrixBase.h:505 col 46: note: template<class OtherDerived> Derived& Eigen::MatrixBase<Derived>::operator-=(const Eigen::ArrayBase<OtherDerived>&) [with OtherDerived = OtherDerived; Derived = Eigen::Map<Eigen::Matrix<util::Point<3u, double, true>, -1, 1, 0, -1, 1>, 0, Eigen::Stride<0, 0> >] 50 /home/tewk/research/codes/util/Eigen/src/Core/MatrixBase.h:505 col 46: note: template argument deduction/substitution failed: 51 /home/tewk/research/codes/util/Eigen/src/Core/products/TriangularSolverVector.h:117 col 54: note: ‘util::Point<3u, double, true>’ is not derived from ‘const Eigen::ArrayBase<Derived>’ 54 /home/tewk/research/codes/util/Eigen/src/Core/DenseBase.h:254 col 14: note: template<class OtherDerived> Derived& Eigen::DenseBase<Derived>::operator-=(const Eigen::EigenBase<OtherDerived>&) [with OtherDerived = OtherDerived; Derived = Eigen::Map<Eigen::Matrix<util::Point<3u, double, true>, -1, 1, 0, -1, 1>, 0, Eigen::Stride<0, 0> >] 57 /home/tewk/research/codes/util/Eigen/src/Core/DenseBase.h:254 col 14: note: template argument deduction/substitution failed: 58 /home/tewk/research/codes/util/Eigen/src/Core/products/TriangularSolverVector.h:117 col 54: note: ‘util::Point<3u, double, true>’ is not derived from ‘const Eigen::EigenBase<Derived>’ |
Moderator
|
I don't think that's the problem. However, to enable mixing types you have to specialize:
|
Registered users: Baidu [Spider], Bing [Bot], Google [Bot]