The following does not seem to work.
void Foo(Ref<VectorXd> v) {
// modifies v
}
Eigen::VectorXd v;
Foo(v.cwiseAbs());
With the following error message
error: could not convert 'Eigen::ArrayBase::cwiseAbs() const with Derived = Eigen::ArrayWrapper, -1, 1, true>, -1, 1, false> >; Eigen::ArrayBase::CwiseAbsReturnType = Eigen::CwiseUnaryOp, const Eigen::ArrayWrapper, -1, 1, true>, -1, 1, false> > >; typename Eigen::internal::traits::Scalar = double' from 'const CwiseAbsReturnType {aka const Eigen::CwiseUnaryOp, const Eigen::ArrayWrapper, -1, 1, true>, -1, 1, false> > >}' to 'Eigen::Ref >'
Any suggestions why and how to fix?