Boost logo

Ublas :

From: Michael Stevens (mail_at_[hidden])
Date: 2005-04-04 03:41:18


On Thursday 31 March 2005 18:24, Anna.Maria.G_at_[hidden] wrote:
> Hi,
> I have a Problem with submatrix. I heard it should work with project, but
> it doesn't.

That is odd. Submatrix 'project' functions are part of the standard tests. Can
you be more specific.

> I have a matrix with a lot of Null-Elements, so I saved it as sparse_matrix
> (or compressed_matrix). Now I want to take a part of this matrix.
>
> For example
>
> I have sparse_matrix<int, row_major> M1(n_rows,n_cols);
>
> M1 = 1 0 0 4 0 0 3 0 0
> 0 2 0 0 0 5 0 0 2
> 1 0 0 0 0 5 0 0 0
>
> and I need two matrices G1 and G2 (also sparse or compressed)
>
> G1 = 1 0 0 G2 = 4 0 0 3 0 0
> 0 2 0 0 0 5 0 0 2
> 1 0 0 0 0 5 0 0 0
>
>
> I tried to do it with "project", but it doesn't work (even with simply
> matricies).
>
> Is M1 defined as
> matrix<int, row_major> M1(n_rows,n_cols-n_rows);
>
> I can take a submatrix from M1 with:
>
> for (i = 0; i < split_row; i++)
> G1[i](range (0,G1.size2())) = M1[i](range (split_col-1,M1.size2()));
>
> But it doesn't work with sparse_matrix.

Sounds like a bug it row access to sparse matrices. The current CVS
development version may have a related problem that I would like to track
down.

> Can somebody help me?

To make things easier to track down which version of Boost is it with the
problem? Also can you put together a short compileable piece of test code
that show the problem, I don't want to repeat you work.

Michael

-- 
___________________________________
Michael Stevens Systems Engineering
34128 Kassel, Germany
Phone/Fax: +49 561 5218038
Navigation Systems, Estimation  and
                 Bayesian Filtering
    http://bayesclasses.sf.net
___________________________________