@@ -24,6 +24,11 @@ Compute the solution to the LP in `T` and make sure its correct.
2424function check_solution(T:: Tableau ):: Bool
2525 T = deepcopy(T)
2626 x = simplex_solve!(T, false )
27+
28+ if isnothing(x)
29+ return true
30+ end
31+
2732 if any(T. A * x .> T. b)
2833 return false
2934 end
@@ -32,11 +37,11 @@ function check_solution(T::Tableau)::Bool
3237 return false
3338 end
3439
35- if dot(T. c, x) != T. M[end , end ]
40+ if dot(T. c, x) != T. M[1 , end ]
3641 return false
3742 end
3843
39- xx = lp_solve(T)
44+ xx = lp_solve(T, false )
4045 if norm(Float64.(x) - xx) > 1e-6
4146 return false
4247 end
7883"""
7984 find_bad(nv, nc, m=100, reps=100)
8085
81- Try to find a failure for `pivot_solve `.
86+ Try to find a failure for `simplex_solve! `.
8287"""
83- function find_bad(nv, nc, m = 100 , reps= 100 )
88+ function find_bad(nv, nc, lo = 0 , hi = 20 , reps= 100 )
8489 P = Progress(reps)
8590 for _ in 1 : reps
86- T = random_example(nv, nc, m )
91+ T = random_example(nv, nc, lo, hi )
8792 if ! check_solution(T)
8893 @info " Found a bad example"
8994 return T
0 commit comments