Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sumiya11 committed Feb 16, 2024
1 parent 632a93e commit 311f5fb
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/Reduction.jl
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,15 @@ struct Reduction{A, B, C}
new_system::ODE{A}
new_vars::Dict{A, B}
old_system::ODE{C}
lumping_matrix::Matrix{Any}
lumping_matrix::Union{Nothing, Matrix{Any}}

function Reduction{A, B, C}(new_system::ODE{A}, new_vars::Dict{A, B}, old_system::ODE{C}) where {A, B, C}
lumping_vars = [new_vars[x] for x in gens(parent(new_system))]
lumping_combs = [sum(collect(coefficients(comb)) .* exponent_vectors(comb)) for comb in lumping_vars]
lumping_matrix = mapreduce(permutedims, vcat, lumping_combs)
lumping_matrix = nothing
if !isempty(new_vars)
lumping_vars = [new_vars[x] for x in gens(parent(new_system))]
lumping_combs = [sum(collect(coefficients(comb)) .* exponent_vectors(comb)) for comb in lumping_vars]
lumping_matrix = mapreduce(permutedims, vcat, lumping_combs)
end
return new{A, B, C}(new_system, new_vars, old_system, lumping_matrix)
end

Expand Down

0 comments on commit 311f5fb

Please sign in to comment.