chkwon / PATHSolver.jl

provides a Julia wrapper for the PATH Solver for solving mixed complementarity problems
http://pages.cs.wisc.edu/%7Eferris/path.html
MIT License
50 stars 15 forks source link

Check license to avoid silent failures #97

Closed lassepe closed 9 months ago

lassepe commented 9 months ago

When the user hands in a problem that is larger than their license allows, solve_mcp currently just silently gives a wrong result. This PR adds a license check to the solve_mcp C_API function. The overhead of the check is only about 20ns on my machine so I think this is worth it.

codecov[bot] commented 9 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (7efbc94) 94.31% compared to head (cc5da01) 94.33%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #97 +/- ## ========================================== + Coverage 94.31% 94.33% +0.02% ========================================== Files 3 3 Lines 457 459 +2 ========================================== + Hits 431 433 +2 Misses 26 26 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

odow commented 9 months ago

I removed the kwarg. Let's just do this every time. I assumed PATH would complain rather than silently return the wrong answer...

lassepe commented 9 months ago

I'm okay with dropping the kwarg