Fix small inconsistencies and compiler warnings

This commit is contained in:
Julian Kent 2021-01-22 17:21:49 +01:00 committed by Julian Kent
parent d540ca5de2
commit 4837316f9b

View File

@ -319,12 +319,12 @@ bool inv(const SquareMatrix<Type, M> & A, SquareMatrix<Type, M> & inv, size_t ra
for (size_t n = 0; n < rank; n++) {
// if diagonal is zero, swap with row below
if (fabs(static_cast<float>(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<float>(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);