Skip to content

Commit e75d490

Browse files
committed
Docs, bug fixes
1 parent d8e8338 commit e75d490

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

development/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Development Folder for `SimplexTableaux`
2+
3+
This is not part of the "official" release of `SimplexTableaux` but contains
4+
code to generate various examples for working with this module. Code may be added or deleted
5+
without notice. Changes here are not considered to be breaking.

development/random-examples.jl

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ Compute the solution to the LP in `T` and make sure its correct.
2424
function 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
@@ -78,12 +83,12 @@ 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

Comments
 (0)