Skip to content

Commit

Permalink
fix sign-splitting of unbounded values
Browse files Browse the repository at this point in the history
  • Loading branch information
exaexa committed Jul 11, 2024
1 parent f3ec201 commit 0647387
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "COBREXA"
uuid = "babc4406-5200-4a30-9033-bf5ae714c842"
authors = ["The developers of COBREXA.jl"]
version = "2.0.1"
version = "2.0.2"

[deps]
AbstractFBCModels = "5a4f3dfa-1789-40f8-8221-69268c29937c"
Expand Down
9 changes: 7 additions & 2 deletions src/builders/unsigned.jl
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ $(TYPEDSIGNATURES)
A constraint tree of variables with positive contributions to the values in `cs`.
"""
unsigned_positive_contribution_variables(cs::C.ConstraintTree) =
C.variables_for(c -> positive_bound_contribution(c.bound), cs)
C.variables_for(cs) do c
positive_bound_contribution(something(c.bound, C.Between(-Inf, Inf)))
end

export unsigned_positive_contribution_variables

Expand All @@ -51,7 +53,10 @@ $(TYPEDSIGNATURES)
A constraint tree of variables with negative contributions to the values in `cs`.
"""
unsigned_negative_contribution_variables(cs::C.ConstraintTree) =
C.variables_for(c -> positive_bound_contribution(-c.bound), cs)
C.variables_for(cs) do c
positive_bound_contribution(-something(c.bound, C.Between(-Inf, Inf)))
end


export unsigned_negative_contribution_variables

Expand Down

0 comments on commit 0647387

Please sign in to comment.