Boost logo

Ublas :

Subject: Re: [ublas] broken coordinate_matrix::sort with gcc 4.7
From: Gunter Winkler (guwi17_at_[hidden])
Date: 2012-09-13 16:52:21


Hello,

Am Tuesday 11 September 2012 schrieb Ungermann, Jörn:
> Hi all,
>
> we created a simple version of inplace_merge, which can be added as
> method to coordinate_matrix. It is not intensely tested, something
> we would do via Testcases in case we proceed in this direction (I do
> not fully trust my lower_bound for all border cases; it also seems
> to use to man LoC). However, using this in our numerical code, all
> of our application testcases pass.
>
> array_size_type lower_bound(array_size_type beg,
> array_size_type end, array_size_type target) const {
> while (end > beg + 1) {
> ....
> inplace_merge(new_mid, rig_mid, end);
> }
>
> And the std::inplace_merge call in sort needs to be replaced by
>
> inplace_merge(0, sorted_filled_, filled_);
>
> Similar code would be needed for the sparse vector. If desired, I can
> provide patches and associated testcases. The performance of this is
> indistinguishable from the STL internal buffer-less algorithm.
>

I'd vote for this solution because we know for sure that the
index_triple_iterator cannot be used with a temporary buffer. Thus using
a custom inplace_merge relying on working std algotrithms seems to be a
robust solution.

Please attach patches to https://svn.boost.org/trac/boost/ticket/7363 so
we can track the related changes.

mfg
Gunter