-
Notifications
You must be signed in to change notification settings - Fork 29
Open
Description
Lines 1785 to 1791 in 34c3432
/* Invert the diagonal values in 'e'. If a value is zero, do | |
* nothing to it. */ | |
zsl_mtx_get(&e, g, g, &x); | |
if ((x < epsilon) || (x > -epsilon)) { | |
x = 1 / x; | |
zsl_mtx_set(&e, g, g, x); | |
} |
In the if statement on line 1788, x > -epsilon
always evaluates to true when x is 0 because epsilon is equal to 1e-6 and 0 is always bigger than -1e-6. This causes an incorrect output matrix with infinity values since 0 should be ignored.
I changed line 1788 to the below code to fix this issue:
if (((x < epsilon) || (x > -epsilon)) && x != 0) {
Metadata
Metadata
Assignees
Labels
No labels