From: Johan E. <jbc...@sw...> - 2014-07-21 21:23:07
|
Hi Nathan, Alvin, I was also confused a bit at first, but: inline bool rel_error_bound(Coord a, Coord b, double eps=EPSILON) { return a <= eps*b && a >= -eps*b; } So the fix with sqrt does do a different check. hth regards, Johan On 21-7-2014 23:08, Nathan Hurst wrote: > Does it fix the bug? I don't understand because those two algorithms > are almost equivalent (there is a slight shift in the bounds due to > nonlinearity). In this case det should be 0.150, which is a long way > from singular. What is mx in this case? > > njh > > On Mon, Jul 21, 2014 at 03:56:48PM -0400, Alvin Penner wrote: >> while investigating LP Bug 1231990, >> https://bugs.launchpad.net/inkscape/+bug/1231990, it was found that >> the routine Affine::inverse() in the file affine.cpp is apparently >> refusing to calculate the inverse of the following matrix: >> >> 0.001, 0.0 >> 0.0, 150.0 >> >> The refusal is coming from the line: >> if (!rel_error_bound(determ, mx*mx)) >> >> I would like to propose that this be changed to: >> if (!rel_error_bound(std::sqrt(fabs(determ)), mx)) >> so that we would be comparing two numbers which both have units of >> length. This would be similar to a change was made in rev 2183, where >> a similar size comparison problem was encountered (LP Bug 1309225). >> >> Any comments? >> >> Cheers, >> Alvin >> >> >> ------------------------------------------------------------------------------ >> Want fast and easy access to all the code in your enterprise? Index and >> search up to 200,000 lines of code with a free copy of Black Duck >> Code Sight - the same software that powers the world's largest code >> search on Ohloh, the Black Duck Open Hub! Try it now. >> http://p.sf.net/sfu/bds >> _______________________________________________ >> Lib2geom-devel mailing list >> Lib...@li... >> https://lists.sourceforge.net/lists/listinfo/lib2geom-devel > ------------------------------------------------------------------------------ > Want fast and easy access to all the code in your enterprise? Index and > search up to 200,000 lines of code with a free copy of Black Duck > Code Sight - the same software that powers the world's largest code > search on Ohloh, the Black Duck Open Hub! Try it now. > http://p.sf.net/sfu/bds > _______________________________________________ > Lib2geom-devel mailing list > Lib...@li... > https://lists.sourceforge.net/lists/listinfo/lib2geom-devel > > |