diff --git a/matrix/SquareMatrix.hpp b/matrix/SquareMatrix.hpp index 827eb497b0..9cb02cddfb 100644 --- a/matrix/SquareMatrix.hpp +++ b/matrix/SquareMatrix.hpp @@ -319,12 +319,12 @@ bool inv(const SquareMatrix & A, SquareMatrix & inv, size_t ra for (size_t n = 0; n < rank; n++) { // if diagonal is zero, swap with row below - if (fabs(static_cast(U(n, n))) < FLT_EPSILON) { + if (fabs(U(n, n)) < Type(FLT_EPSILON)) { //printf("trying pivot for row %d\n",n); for (size_t i = n + 1; i < rank; i++) { //printf("\ttrying row %d\n",i); - if (fabs(static_cast(U(i, n))) > Type(1e-8f)) { + if (fabs(U(i, n)) > Type(FLT_EPSILON)) { //printf("swapped %d\n",i); U.swapRows(i, n); P.swapRows(i, n);