jeudi 26 mars 2015

C++ Armadillo: Irregular element access

I'm looking at Armadillo from a Matlab background and am curious if there's a way to efficiently access irregular elements in a matrix/vector. I'm aware that I can access a continuous part of a matrix with something like



A.submat(span(p,r), span(q,s))


but I'm used to being able to pull out the odd rows and even columns of a matrix like so in Matlab:



a([1 3 5], [2 4])


Is there an equivalent way to access arbitrarily spaced elements of a matrix with Armadillo?


Aucun commentaire:

Enregistrer un commentaire