Registered Member
|
Hi,
I want to add a real matrix to a complex matrix and store the result in another complex matrix. It seems that Eigen does not support such operation. The following code failed at compilation stage. The reason I want to use such feature is that, in a template function, one input matrix can be real or complex, and I want a uniform code to deal with it. Why doesn't Eigen support such operation ?
|
Moderator
|
Agree: http://eigen.tuxfamily.org/bz/show_bug.cgi?id=279
A workaround is to explicitly cast: template<typename A, typename B> ... A res, a; B b; res = a + b.cast<typename A::Scalar>(); which is a no-op if A::Scalar == B::Scalar. |
Registered users: Bing [Bot], Evergrowing, Google [Bot], rockscient