Registered Member
|
Is there a concise way to perform a columnwise dot product between two matrices? Assuming a and b are both 3 x n matrices, it's possible to do a.colwise().cross(b), but not a.colwise().dot(b). I tried (a.transpose() * b).diagonal(), but timings on my machine seemed to show that this was performing a full matrix multiplication before extracting the diagonal. Is there a nice way to do this without writing an explicit loop?
|
Registered Member
|
Oops, just thought of one which seems to work: (a.cwise() * b).colwise().sum(). It seems to me that a.colwise().dot(b) would be nicer, though, so I've submitted a feature request to the issue tracker.
|
Registered users: Bing [Bot], Google [Bot], Sogou [Bot]