Skip to content

Commit

Permalink
fix types
Browse files Browse the repository at this point in the history
  • Loading branch information
exaexa committed Jun 10, 2024
1 parent e294be6 commit 5f0e229
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/interface.jl
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ A.objective(m::MATFBCModel) =
looks_like_squashed_coupling(mat) =
haskey(mat, "A") && haskey(mat, "b") && length(mat["b"]) == size(mat["A"], 1)

A.n_couplings(m::MATModel) =
A.n_couplings(m::MATFBCModel) =
looks_like_squashed_coupling(m.mat) ? size(m.mat["A"], 1) - n_reactions(m) :
size(get(m.mat, "C", zeros(0, n_reactions(m))), 1)

A.couplings(m::MATModel) = String["mat_coupling_$i" for i = 1:n_couplings(m)]
A.couplings(m::MATFBCModel) = String["mat_coupling_$i" for i = 1:n_couplings(m)]

A.coupling(m::MATModel) =
A.coupling(m::MATFBCModel) =
looks_like_squashed_coupling(m.mat) ? sparse(m.mat["A"][n_reactions(m)+1:end, :]) :
sparse(get(m.mat, "C", zeros(0, n_reactions(m))))

Expand All @@ -45,7 +45,7 @@ $(TYPEDSIGNATURES)
Overload of `coupling_weights` for `MATFBCModel` is currently quite
inefficient. Use `coupling` instead.
"""
function A.coupling_weights(m::MATModel, cid::String)
function A.coupling_weights(m::MATFBCModel, cid::String)
startswith(cid, "mat_coupling_") || throw(DomainError(cid, "unknown coupling"))
cidx = parse(Int, cid[14:end])
return Dict(r => w for (r, w) in zip(A.reactions(m), A.coupling(m)[cidx, :]) if w != 0)
Expand Down

0 comments on commit 5f0e229

Please sign in to comment.