From: Krzysztof Kosiński <tweenk.pl@gm...>  20090901 16:58:46

Jasper van de Gronde wrote: > >  Use range arithmetic. If you using different rounding modes for the > determinant can get you numbers in a range that straddles zero I'd > say it's fair to say the matrix is essentially singular. > This is not going to work, because a small determinant will always round to 0 regardless of the rounding mode. Rounding modes only affect what is done to halfway cases like 0.5 when nearbyint() is called; it doesn't affect round() or trunc(). >  If changing rounding modes is too problematic, we could always do a > poor man's version of range arithmetic using nextafter/nexttoward. > Won't work for the same reason as above; rounding has little to do with this issue. >  We compute 1.0/det. If det is so small that this (or the value in the > resulting matrix with the largest magnitude) is inf(inite) there > wouldn't be much sense in computing the inverse, as we can't > represent it. > I think this is the correct way to fix this (and of course review the way EPSILON is used). We could use some more unit tests (right now I don't even know how to run the existing ones...) Regards, Krzysztof  View this message in context: http://www.nabble.com/BrokenfeImageandlib2geommatrixinversiontp25210637p25244032.html Sent from the Inkscape  Dev mailing list archive at Nabble.com. 