Interesting behaviour indeed. I have a partial copy of the vector too when using std::copy.

However may I suggest that way:

    vect = row(mat,0);
    std::cout<<"is this the first row?\n"<<vect<<std::endl;

    vect = row(mat,mat.size1()-1);
    std::cout<<"is this the last row?\n"<<vect<<std::endl;

Using the free function row, it works pretty well.

David

On Mon, May 17, 2010 at 23:03, Andrea Cassioli <cassioliandre@gmail.com> wrote:
Hi guys,
I've just experienced a quite silly bug. I'm currently using a
symmetric matrix to perform some linear algebra calculations, after
that I need to copy one row at the time in a bigger vector. Till now I
have been performing row copying by means of simple hand-made loops.

Now I would like to clean the code, so I 've decided to use matrix_row
adaptors to iterate among all matrix row and use std::copy to perform
the copy operation.

It sounds clean and simple but surprise it does not work! I've write
down a very simple example, which is attached to the message. In fact
the copy is performed accessing the underlying triangular matrix used
to store the symmetric one.

I'm pretty sure I'm doing something wrong, but I would expect the
matrix_row adaptor to behave as a normal vector, that is I would like
to play with it seamlessly.

Am I wrong or it is a bug??

Best Regards,
Andrea Cassioli

_______________________________________________
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