diff --git a/src/interface.jl b/src/interface.jl index 299ff42..bbc541b 100644 --- a/src/interface.jl +++ b/src/interface.jl @@ -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)))) @@ -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)