> Uhh... isn't this what iterateNonZero does? If there was an iterateNonZero() in the Matrix interface and its implementation, I guess that's what it would do. Seems like so far nobody's really used matrices ... ;-)
Anyway, have a look at the patch I submitted before. I implemented a iterateActuallySet() method for each matrix implementation where it makes sense. I did this because I assumed that calling matrix.set(i, j, 0) sets that value in memory also for a sparse matrix. But I just had another look at the code and it turns out that a matrix.set(i, j, 0) would actually remove that entry if it was something else than 0 before. So it's probably best to stick with getNumNonZero() and iterateNonZero(). I will fix that tomorrow and add another patch. I guess it won't take more than renaming those two methods. Need to sleep now though ... Cheers, Alex > > On Fri, Oct 22, 2010 at 1:31 PM, Alexander Hans <[email protected]> wrote: > >> > That isn't soooo bad, especially if somebody is about to iterate over >> all >> > those elements. >> >> There's currently no way to iterate over the non-default elements, this >> I >> will have to implement as well. >
