Closed Incorrectone closed 2 months ago
The problem is that the LUDecompose
does operations on the given type. In your case, this is the integer type. Consequently, the devision here:
https://github.com/tomstewart89/BasicLinearAlgebra/blob/b302d92857b1d9f0af790e54f39930627c811005/impl/NotSoBasicLinearAlgebra.h#L74
will probably produce a wrong result. One potential fix could be to check for integer types and perform the determinant calculation on floats, then convert the matrix back to integers. However, in that case, I think there is no guarantee that there won't be rounding errors.
Doing this on an esp32-S3-devkit but
Determinants with integer Matrix gives wrong result
Gives 96 as the output, not zero
This gives the right result of 0