1

I need to iterate backwards efficiently over a sparse matrix using the boost ublas library. This is my code:

for(rit1_t it1 = L.rbegin1(); it1 != L.rend1(); it1++)
{
    for(rit2_t it2 = it1.rbegin(); it2.index2() > it2.index1(); it2++)
    {
        std::cout << *it2 << std::endl;
    }
}

It compiles but then throws a 'boost::numeric::ublas::bad_index' error. The only information I can find about it is from this guy who says it's a bug. Anyone know how to use the reverse_iterators correctly?

4

0 回答 0