Skip to content

Commit

Permalink
ok here I discovered dsense
Browse files Browse the repository at this point in the history
  • Loading branch information
exaexa committed Jun 8, 2024
1 parent d122cea commit 0a9268a
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/base/types/MATModel.jl
Original file line number Diff line number Diff line change
Expand Up @@ -104,14 +104,18 @@ Extracts the coupling constraints. Currently, there are several accepted ways to
function coupling_bounds(m::MATModel)
nc = n_coupling_constraints(m)
if _mat_has_squashed_coupling(m.mat)
c = reshape(m.mat["b"], length(m.mat["b"]))[n_reactions(m)+1:end]
csense = reshape(m.mat["csense"], length(m.mat["csense"]))[n_reactions(m)+1:end],
(
reshape(m.mat["b"], length(m.mat["b"]))[n_reactions(m)+1:end],
reshape(m.mat["b"], length(m.mat["b"]))[n_reactions(m)+1:end],
[sense in ["G", "E"] ? val : -Inf for (val, sense) in zip(c, csense)],
[sense in ["L", "E"] ? val : Inf for (val, sense) in zip(c, csense)],
)
elseif haskey(m.mat, "d")
elseif haskey(m.mat, "d") && haskey(m.mat, "dsense")
d = reshape(m.mat["d"], nc)
dsense = reshape(m.mat["dsense"], nc)
(
reshape(get(m.mat, "d", fill(-Inf, nc, 1)), nc),
reshape(get(m.mat, "d", fill(Inf, nc, 1)), nc),
[sense in ["G", "E"] ? val : -Inf for (val, sense) in zip(d, dsense)],
[sense in ["L", "E"] ? val : Inf for (val, sense) in zip(d, dsense)],
)
else
(
Expand Down

0 comments on commit 0a9268a

Please sign in to comment.