@@ -66,7 +66,7 @@ struct LatticeTransportODEFunction{P, Q, R, S, T}
66
66
67
67
function LatticeTransportODEFunction (ofunc:: P , ps:: Vector{<:Pair} ,
68
68
lrs:: LatticeReactionSystem , sparse:: Bool ,
69
- jac_transport:: Union{Nothing, Matrix{S}, SparseMatrixCSC{S, Int64}} ,
69
+ jac_transport:: Union{Nothing, Matrix{S}, SparseMatrixCSC{S, Int64}} ,
70
70
transport_rates:: Vector{Pair{Int64, SparseMatrixCSC{S, Int64}}} ) where {P, S}
71
71
# Computes `LatticeTransportODEFunction` functor fields.
72
72
heterogeneous_vert_p_idxs = make_heterogeneous_vert_p_idxs (ps, lrs)
@@ -75,9 +75,9 @@ struct LatticeTransportODEFunction{P, Q, R, S, T}
75
75
lrs)
76
76
77
77
# Creates and returns the `LatticeTransportODEFunction` functor.
78
- new {P, typeof(mtk_ps), typeof(p_setters), S, typeof(jac_transport)} (ofunc,
78
+ new {P, typeof(mtk_ps), typeof(p_setters), S, typeof(jac_transport)} (ofunc,
79
79
num_verts (lrs), num_species (lrs), heterogeneous_vert_p_idxs, mtk_ps, p_setters,
80
- transport_rates, t_rate_idx_types, leaving_rates, Catalyst. edge_iterator (lrs),
80
+ transport_rates, t_rate_idx_types, leaving_rates, Catalyst. edge_iterator (lrs),
81
81
jac_transport, sparse, lrs)
82
82
end
83
83
end
88
88
function make_heterogeneous_vert_p_idxs (ps, lrs)
89
89
p_dict = Dict (ps)
90
90
return findall ((p_dict[p] isa Vector) && (length (p_dict[p]) > 1 )
91
- for p in parameters (lrs))
91
+ for p in parameters (lrs))
92
92
end
93
93
94
94
# Creates the MTKParameters structure and `p_setters` vector (which are used to manage
@@ -110,7 +110,7 @@ function make_t_types_and_leaving_rates(transport_rates, lrs)
110
110
for (s_idx, tr_pair) in enumerate (transport_rates)
111
111
for e in Catalyst. edge_iterator (lrs)
112
112
# Updates the exit rate for species s_idx from vertex e.src.
113
- leaving_rates[s_idx, e[1 ]] += get_transport_rate (tr_pair[2 ], e,
113
+ leaving_rates[s_idx, e[1 ]] += get_transport_rate (tr_pair[2 ], e,
114
114
t_rate_idx_types[s_idx])
115
115
end
116
116
end
@@ -196,8 +196,8 @@ function DiffEqBase.ODEProblem(lrs::LatticeReactionSystem, u0_in, tspan,
196
196
# edge_ps values are sparse matrices. Here, index (i,j) is a parameter's value in the edge from vertex i to vertex j.
197
197
# Uniform vertex/edge parameters store only a single value (a length 1 vector, or size 1x1 sparse matrix).
198
198
# In the `ODEProblem` vert_ps and edge_ps are merged (but for building the ODEFunction, they are separate).
199
- vert_ps, edge_ps = lattice_process_p (p_in, vertex_parameters (lrs), edge_parameters (lrs),
200
- lrs)
199
+ vert_ps, edge_ps = lattice_process_p (p_in, vertex_parameters (lrs),
200
+ edge_parameters (lrs), lrs)
201
201
202
202
# Creates the ODEFunction.
203
203
ofun = build_odefunction (lrs, vert_ps, edge_ps, jac, sparse, name, include_zero_odes,
@@ -347,7 +347,7 @@ function rebuild_lat_internals!(lt_ofun::LatticeTransportODEFunction, ps_new,
347
347
# Recreates the new parameters on the requisite form.
348
348
ps_new = [(length (p) == 1 ) ? p[1 ] : p for p in deepcopy (ps_new)]
349
349
ps_new = [p => p_val for (p, p_val) in zip (parameters (lrs), deepcopy (ps_new))]
350
- vert_ps, edge_ps = lattice_process_p (ps_new, vertex_parameters (lrs),
350
+ vert_ps, edge_ps = lattice_process_p (ps_new, vertex_parameters (lrs),
351
351
edge_parameters (lrs), lrs)
352
352
ps_new = [vert_ps; edge_ps]
353
353
0 commit comments