Re: bug on compressed_matrix ?

Thomas Klimpel <[email protected]>
Newsgroups gmane.comp.lib.boost.ublas
Message-ID <4468C9C2AE594745A32DC93C799A224A031F3A@DE02WEMBX2.internal.synopsys.com>
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
[email protected]
http://lists.boost.org/mailman/listinfo.cgi/ublas
Sent to: [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.