Registered Member
|
Hello,
I am new to Eigen and need some help regarding an operation that looks like this: (x.transpose()*y)*z where x, y and z are all same size vectors. The idea is that (x.transpose()*y) will turn out to be a scalar which will be then multiplied with vector z. Apparently Eigen3 library does not allow me to do this. I assume that the library only allows multiplication of a scalar to a vector if the scalar is represented as a double/int etc and not as a size 1 VectorXd. I do know that mapping (x.transpose()*y) to a double will solve this but I believe there would be simpler and neater solutions that I don't know of. Can anyone tell me of a good approach to this problem? Thanks in advance |
Moderator
|
x.transpose()*y has to be a 1x1 matrix. You do either:
double(x.transpose()*y) * z (x.transpose()*y)(0) * z x.dot(y) * z |
Registered users: Baidu [Spider], Bing [Bot], Google [Bot]