From: <sv...@ww...> - 2007-07-24 08:23:08
|
Author: mkrose Date: 2007-07-24 01:21:54 -0700 (Tue, 24 Jul 2007) New Revision: 2140 Modified: trunk/csp/csplib/data/Matrix3.cpp Log: Fix bug in Matrix3::invert(). Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=2140 Modified: trunk/csp/csplib/data/Matrix3.cpp =================================================================== --- trunk/csp/csplib/data/Matrix3.cpp 2007-07-24 08:18:38 UTC (rev 2139) +++ trunk/csp/csplib/data/Matrix3.cpp 2007-07-24 08:21:54 UTC (rev 2140) @@ -145,6 +145,11 @@ bool Matrix3::invert(const Matrix3& m, double tolerance) { + if (&m == this) { + Matrix3 copy(m); + return invert(copy); + } + _mat[0][0] = DET2(m._mat,1,1,2,2); _mat[0][1] = DET2(m._mat,0,2,2,1); _mat[0][2] = DET2(m._mat,0,1,1,2); |