Commit 0cb0e452 authored by Miroslav Kratochvil's avatar Miroslav Kratochvil
Browse files

Revert "completely disable JuMP bridge constraints"

This reverts commit e99747f6.

Apparently some internal JuMP logic depends on the bridges, preventing e.g.
single-variable objective functions from working with GLPK (and maybe other
solvers). Dodging that is easy, e.g. you can use `@objective(m, Max, x+0)`
instead of one that contains just `x`, but kludges like this should not be
required in the code.
parent e95c4130
Pipeline #47067 passed with stages
in 10 minutes and 37 seconds
......@@ -16,7 +16,7 @@ function make_optimization_model(model::MetabolicModel, optimizer; sense = MOI.M
m, n = size(stoichiometry(model))
xl, xu = bounds(model)
optimization_model = Model(optimizer; bridge_constraints = false)
optimization_model = Model(optimizer)
@variable(optimization_model, x[i = 1:n])
@objective(optimization_model, sense, objective(model)' * x)
@constraint(optimization_model, mb, stoichiometry(model) * x .== balance(model)) # mass balance
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment