Registered Member
|
I would like to rebin a matrix by summing sub-matrices. For example the 4x4 matrix
into the 2x2 matrix
One way of doing this, could be using blocks:
This still loops over all elements of B, though, which makes it not very fast. Does anyone know a way to make this reduction more efficient? EDIT. As a follow-up: not using blocks but using straightforwardly A(.,.) is a bit slower but not much slower. Not using an Eigen array but a native double** and using A[.][.] speeds up the execution time with a factor of 10. |
Registered users: Bing [Bot], Google [Bot], Yahoo [Bot]