one useful way is to use a matrix_indirect object in which with another integer matrix you can specifiy each row and column that you need.


On Mon, Jul 12, 2010 at 23:57, Kraus Philipp <philipp.kraus@flashpixx.de> wrote:
Hi,

I have a NxM matrix and I would like to extract some rows / columns. I have try to use the matrix_slice command, but I need specify only the rows / columns and need the full range for columns / rows:

For illustrating (not syntactic correct):

unsigned int rows[5];
// dynamic fill rows[i]

ublas::matrix_slice< ublas::matrix<double> > extract(mymatrix, ublas::slice(rows), ublas::range(0, mymatrix::size2()-1));

// create 
ublas::matrix<double> newmatrix = extract;

How can I create a new matrix with the full row / column range from some columns / rows?

Thanks

Phil

_______________________________________________
ublas mailing list
ublas@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/ublas
Sent to: david.bellot@gmail.com



--
David Bellot, PhD
david.bellot@gmail.com
http://david.bellot.free.fr