Boost logo

Ublas :

Subject: Re: [ublas] mix matrix slice with matrix range
From: David Bellot (david.bellot_at_[hidden])
Date: 2010-07-13 02:12:35


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_at_[hidden]>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_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/ublas
> Sent to: david.bellot_at_[hidden]
>

-- 
David Bellot, PhD
david.bellot_at_[hidden]
http://david.bellot.free.fr