This project has moved and is read-only. For the latest updates, please go here.

Extract multiple elements from a matrix efficiently

Apr 7, 2014 at 9:13 PM
I was wondering is there an efficient way to extract multiply element from a matrix efficiently?

For example,
I have a index vector idx = [0, 1, 3, 5] and have a matrix rho 8x8.

How can I get a new matrix which are composed from rho matrix with idx number [0,0], [0,1], [0.3], [0,5], [1,1], [1,3], .... etc...

Apr 8, 2014 at 10:41 PM
A feature like this has actually been suggested some time ago in issue #45, including code. In the meantime you could use a loop using matrix.Storage.CopySubMatrixTo.
Marked as answer by cdrnet on 5/2/2014 at 10:34 AM