![]() Registered Member ![]()
|
What caused the following error in the code below ?
Thanks in advance . [In Visual Studio 2010] const EIgen::Matrix<double, 6, 1> &F Error: no suitable user-defined conversion from "const Eigen::Matrix<double, 6, 1, 0, 6, 1>" to "Eigen::Map<Eigen::Matrix<double, 6, 1, 0, 6, 1>, 0, Eigen::Stride<0, 0>>" exists ----------------------------------------------------------- // inside a class definition inline virtual void compute(EIgen::Matrix<double, 6, 1> const & F, double * const torque) const { Eigen::Map<Eigen::Matrix<double, 6, 1>>(torque) = _E.transpose()*F; } ----------------------------------------------------------- |
![]() Registered Member ![]()
|
I think that the statement is parsed as a declaration of a variable with the name torque. I did not try with Visual Studio, but that is what gcc appears to do. Possible solutions may be to split the statement in two, as in:
Eigen::Map<Eigen::Matrix<double, 6, 1> > torqueMap(torque); torqueMap = _E.transpose()*F; or add some parentheses so that it cannot be parsed as a declaration: (Eigen::Map<Eigen::Matrix<double, 6, 1> >(torque)) = _E.transpose()*F; |
![]() Registered Member ![]()
|
Registered users: Bing [Bot], Google [Bot], Yahoo [Bot]