Hello,
this is not working, because you are trying to subtract two elements that are different in nature: a vector and a scalar. From a mathematical point of view, it doesn't make sense.
By doing v -=2 I assume you are trying to subtract 2 from every component of v. Some software like matlab offer a *shorcut* in the form v - 2, but Eigen doesn't (at least not directly).
There are at least two ways to achieve what you want:
* v -= Vector3d::Constant(2), that is you express in a proper mathematical way what you want
* going into array world as Janos suggested:
v.array() -= 2;
Note that v *= 2 works because it is mathematically valid to multiply a vector or matrix by a scalar..
Best regards,
Adrien Escande