Skip to content
This repository has been archived by the owner on Sep 22, 2022. It is now read-only.

Panic at 'called Result::unwrap() on an Err value: SingularMatrix' #6

Open
HKalbasi opened this issue May 29, 2022 · 0 comments
Open

Comments

@HKalbasi
Copy link

Hi, and thanks for this great crate! I got a panic at minilp-0.2.2/src/solver.rs:1301:10:

self.lu_factors = lu_factorize(
    basic_vars.len(),
    |c| {
        orig_constraints_csc
            .outer_view(basic_vars[c])
            .unwrap()
            .into_raw_storage()
    },
    0.1,
    &mut self.scratch,
)
.unwrap(); // TODO: When is singular basis matrix possible? Report as a proper error.
// ^^^^^^^^^^^^^^^^^^^^^ this line

I have a somehow weird query, which contains 30 variables in format a[i] = a[i-1] * 1000 and two variables x, y with x = a[30] and y = a[30] + 1 and x <= y conditions. I guess singularity occurs due floating point errors, but I know nothing about simplex and your code.

Unrelated to this, how reliable is an Infeasible answer? People can attack my code by creating some constraints that are actually feasible but my code detects it as Infeasible, so even a panic is better than a false Infeasible for me. Would it work correct even in case of floating point errors? How I can validating the result, or restrict the input to prevent that?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant