i am kind of shocked...

doesn't ublas guarantee the exact csr format???

Riccardo

On Wed, Jan 16, 2013 at 6:27 PM, Thomas Klimpel <Thomas.Klimpel@synopsys.com> wrote:
Hoang Giang Bui wrote:
> After fill I tried to print out the values of index1_data and
> index2_data and observe different results with the inputs.
> [...]
> In this case, which should be the reason for such behaviour?

You probably have a wrong expectation with respect to the member functions "index1_data()" and "index2_data()". The member functions "filled1()" and "filled2()" could help clear the confusion.

Your expectation is probably
P. index1_data().size() == P.filled1()
P. index2_data().size() == P.filled2()
but this is false.

I suggest you replace
    std::copy(P.index1_data().begin(), P.index1_data().end(), std::ostream_iterator<int>(std::cout, " "));
by
    std::copy(P.index1_data().begin(),P.index1_data().begin()+P.filled1(), std::ostream_iterator<int>(std::cout, " "));
and similarly for index2_data. Perhaps this will improve the match between your expectations and the actual results.

Regards,
Thomas
_______________________________________________
ublas mailing list
ublas@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/ublas
Sent to: rrossi@cimne.upc.edu