Skip to content

Commit d0b904a

Browse files
committed
pump v0.2.9
1 parent ff3b7c2 commit d0b904a

File tree

4 files changed

+30
-2
lines changed

4 files changed

+30
-2
lines changed

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1-
### 0.2.9 (Upcoming Release)
1+
### 0.2.10 (Upcoming Release)
2+
3+
4+
### 0.2.9
25

36
- Fix documentation of simplex
47
- Add tests for Simplex
8+
- Add unbounded problem check for the Simplex routines.
59

610

711
### 0.2.8

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "OperationsResearchModels"
22
uuid = "8042aa49-e599-49ec-a8f7-b5b80cc82a88"
33
authors = ["Mehmet Hakan Satman <mhsatman@gmail.com>"]
4-
version = "0.2.8"
4+
version = "0.2.9"
55

66
[deps]
77
HiGHS = "87dc4568-4c63-4d18-b0c0-bb2238e4078b"

src/simplex.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,11 @@ function singleiteration!(s::SimplexProblem)
407407
end
408408

409409
exitingvariableindex = getexitingvariableindex(s, enteringvariableindex)
410+
411+
if isnothing(exitingvariableindex)
412+
error("Can not find exiting variable index. The problem is unbounded. Did you forget to add constraints?")
413+
end
414+
410415
rowindex = s.basicvariableindex[exitingvariableindex]
411416

412417
update!(s, enteringvariableindex, rowindex)

test/testsimplex.jl

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,5 +216,24 @@
216216
end
217217

218218

219+
@testset "Unbounded Problem - Should throw an error" begin
220+
221+
# Maximize z = 3x + 4y
222+
# subject to
223+
# x + 2y >= 100
224+
# 3x + y >= 200
225+
# x, y >= 0
226+
227+
problem = createsimplexproblem(
228+
Float64[3, 4],
229+
Float64[1 2; 3 1],
230+
Float64[100, 200],
231+
[GE, GE],
232+
Maximize)
233+
234+
235+
@test_throws ErrorException solve!(problem)
236+
237+
end
219238

220239
end # end of test set Simplex

0 commit comments

Comments
 (0)