Registered Member
|
Suppose I have a Matrix
[[1,2,3], [2,3,4]] a vector = [2,3] Anyone could help me to use the eigen get the result [[1*2,2*2,3*2], [2*3, 3*3, 4*3]] ? |
Moderator
|
You can either use broadcasting:
mat.array().colwise() * vec.array() or (better) observe that all you want is a scaling: vec.asDiagonal() * mat |
Registered users: Bing [Bot], Google [Bot], Sogou [Bot]