Skip to content

Commit 7437781

Browse files
committed
MOre
1 parent b3afe7a commit 7437781

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/Pivoting.jl

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ value, or `0` if all entries in the bottom row are nonnegative.
66
"""
77
function find_pivot_column(T::Tableau)
88
bottom = T.M[end, 1:(end - 1)]
9+
@show bottom
910
v, j = findmin(bottom)
1011
return v < 0 ? j : 0
1112
end
@@ -47,7 +48,6 @@ function pivot!(T::Tableau, i::Int, j::Int)
4748

4849
# make i,j-entry a 1
4950
mij = M[i, j]
50-
@show mij
5151
M[i, :] .//= mij
5252

5353
# clear other entries in column j
@@ -70,3 +70,11 @@ function pivot(T::Tableau, i::Int, j::Int)
7070
TT = deepcopy(T)
7171
return pivot!(TT, i, j)
7272
end
73+
74+
function pivot(T::Tableau)
75+
i, j = find_pivot(T)
76+
if i == 0 || j == 0
77+
return T
78+
end
79+
return pivot(T, i, j)
80+
end

0 commit comments

Comments
 (0)