Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Floating point error in Matrix.invert() #1

Open
hal7df opened this issue Aug 26, 2017 · 0 comments
Open

Floating point error in Matrix.invert() #1

hal7df opened this issue Aug 26, 2017 · 0 comments

Comments

@hal7df
Copy link
Owner

hal7df commented Aug 26, 2017

Both of the (valid) unit tests for Matrix.invert() require an epsilon scale factor of 1e10 (i.e. only accurate to 5-6 decimal places), which is undesirable. This should be investigated to find a solution for increasing the accuracy of the inversion operation.

Curiously, the rref() method seems to be accurate to 14 decimal places, yet the inverse it produces is less accurate. Is this a side effect of the algorithm/is there a better matrix inversion algorithm to use?

Here's an example from one of the test cases:

Actual:
image

Computed:
image

Observed in Chromium 60.0.3112.78 on Ubuntu 16.04

hal7df added a commit that referenced this issue Sep 2, 2017
- All tests are passing (with current coded-in exception for issue #1)
- Don't be wishy-washy about using Matrix.multiply with a scalar value
(either provided as a primitive JavaScript value or as a 1x1 matrix).
Matrix.multiply will only accept arguments that have conforming
dimensions.
hal7df added a commit that referenced this issue Sep 6, 2017
Matrix.rref now chooses scale or divide based on the magnitude of the
unscaled leading value. Hopefully should cut down on floating point
error (issue #1), but tests don't seem to be indicating that...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant