Re: [eigen] HELP: deleting element in vector

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]


There is no easy way, but you can do:

int n = vec.size()-i-1;
vec.segment(i,n) = vec.tail(n);
vec.conservativeResize(vec.size()-1);

gael

On Thu, Jun 28, 2012 at 5:07 PM, Gaurav Gupta <gaurav71531@xxxxxxxxx> wrote:
> How can I delete a particular element in vector(index known) without joining
> creating separate head and tail
> and then joining them.



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/