opencobra / cobratoolbox

The COnstraint-Based Reconstruction and Analysis Toolbox. Documentation:
https://opencobra.github.io/cobratoolbox
Other
252 stars 317 forks source link

gapFind doesnt work with gurobi #20

Closed cfblaeb closed 7 years ago

cfblaeb commented 10 years ago

Highly similar to the problem described here https://groups.google.com/forum/#!searchin/cobra-toolbox/gurobi/cobra-toolbox/ZxAVYQorrqQ/GjKFYSgLJ4MJ

When gapFind uses solveCobraMILP it fails because solveCobraMILP code for "gurobi5" solver doesnt create the x and f variable if no solution is found. This causes the code to fail at the end when it checks if x is empty because x has never been created. At the beginning of the "gurobi5" specific section of solveCobraMILP it creates a resultgurobi structure with empty x and objval, but this is overwritten a bit later when the gurobi function is run. Also even if it wasnt overwritten, the x and objval is only transferred to x and f if gurobi returns success. If you alter the code to return an empty x and f, then it fails on returning to gapfill...

tpfau commented 7 years ago

This can be closed, f and x are always created in the current code.

laurentheirendt commented 7 years ago

Thanks @tpfau.