You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Simplex#update_solution, there is a float/integer equality check that fails occasionally:
def update_solution
0.upto(@num_vars - 1) {|i| @x[i] = 0 }
@basic_vars.each do |basic_var|
row_with_1 = row_indices.detect do |row_ix|
@a[row_ix][basic_var] == 1
end
@x[basic_var] = @b[row_with_1]
end
end
The failure occurs when the coefficient for a basic variable is very close to 1 (e.g. 0.9999999999999). I've monkey patched mine with an epsilon check and it works as expected.
Note, it will still throw an error if it can't find any rows. I haven't dug into the code to see if it's possible.
The text was updated successfully, but these errors were encountered:
In Simplex#update_solution, there is a float/integer equality check that fails occasionally:
The failure occurs when the coefficient for a basic variable is very close to 1 (e.g. 0.9999999999999). I've monkey patched mine with an epsilon check and it works as expected.
Note, it will still throw an error if it can't find any rows. I haven't dug into the code to see if it's possible.
The text was updated successfully, but these errors were encountered: