Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
LCSB-BioCore
COBREXA.jl
Commits
390f0dd1
Unverified
Commit
390f0dd1
authored
May 25, 2021
by
Miroslav Kratochvil
Browse files
clean up `is_solved` use in FVA
parent
3c242e81
Pipeline
#42194
passed with stages
in 12 minutes and 27 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/analysis/flux_variability_analysis.jl
View file @
390f0dd1
...
...
@@ -34,13 +34,15 @@ the individual optimization problems is transparently distributed to `workers`
(see `Distributed.workers()`).
`ret` is a function used to extract results from optimized JuMP models of the
individual reactions. More detailed information can be extracted e.g. by
setting it to `m -> (JuMP.objective_value(m), JuMP.value.(m[:x]))`.
individual reactions. By default, it calls and returns the value of
`JuMP.objective_value`. More information can be extracted e.g. by setting it to
a function that returns a more elaborate data structure; such as `m ->
(JuMP.objective_value(m), JuMP.value.(m[:x]))`.
Returns a matrix of extracted `ret` values for minima and maxima, of total size
`length(reactions)`
×2
. The optimizer result status is
not
checked
by default,
instead `ret` function can access the `JuMP.ter
mi
n
ation
_status` of the model
and react accordingly, depending on user decisi
on.
(
`length(reactions)`
,2)
. The optimizer result status is checked
with
[`is_solved`](@ref); `nothing` is returned if the opti
mi
z
ation
failed for any
reas
on.
"""
function
flux_variability_analysis
(
model
::
MetabolicModel
,
...
...
src/base/solver.jl
View file @
390f0dd1
...
...
@@ -50,11 +50,9 @@ end
"""
is_solved(optmodel)
Return `true` if `optmodel` solved successfully (solution is optimal or locally
optimal).
Return `false` if any other termination status is reached.
Termination status is defined
in the documentation of `JuMP`.
Return `true` if `optmodel` solved successfully (solution is optimal or locally
optimal).
Return `false` if any other termination status is reached.
Termination status is defined
in the documentation of `JuMP`.
"""
function
is_solved
(
optmodel
)
COBREXA
.
JuMP
.
termination_status
(
optmodel
)
in
[
MOI
.
OPTIMAL
,
MOI
.
LOCALLY_SOLVED
]
?
true
:
false
end
is_solved
(
optmodel
)
=
COBREXA
.
JuMP
.
termination_status
(
optmodel
)
in
[
MOI
.
OPTIMAL
,
MOI
.
LOCALLY_SOLVED
]
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment