Skip to content

Commit

Permalink
fix typo in slow_fba, and a bug in fast_fba (#99)
Browse files Browse the repository at this point in the history
* Fix: typo in slow_fba, a bug in fast_fba

* remove redundant loop in fast_fba
  • Loading branch information
KeShih committed May 23, 2024
1 parent 31a8ff8 commit f24e57c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion dingo/fba.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
def slow_fba(lb, ub, S, c):
"""A Python function to perform fba using scipy.optimize LP solver `linprog`
Returns an optimal solution and its value for the following linear program:
min c*v, subject to,
max c*v, subject to,
Sv = 0, lb <= v <= ub
Keyword arguments:
Expand Down
4 changes: 1 addition & 3 deletions dingo/gurobi_based_implementations.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,7 @@ def fast_fba(lb, ub, S, c):
if status == GRB.OPTIMAL:
optimum_value = -model.getObjective().getValue()
v = model.getVars()

for i in range(n):
optimum_sol.append(v[i].x)
optimum_sol = model.getAttr("X", v)

optimum_sol = np.asarray(optimum_sol)

Expand Down

0 comments on commit f24e57c

Please sign in to comment.