Skip to content

Commit

Permalink
Merge pull request #1894 from SciML/myb/irred
Browse files Browse the repository at this point in the history
If the RHS of an alias doesn't appear in the equations, then it's reducible
  • Loading branch information
YingboMa committed Oct 20, 2022
2 parents 19a2c0e + c9ef10f commit 4c30760
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
3 changes: 1 addition & 2 deletions src/structural_transformation/partial_state_selection.jl
Original file line number Diff line number Diff line change
Expand Up @@ -289,10 +289,9 @@ function dummy_derivative_graph!(structure::SystemStructure, var_eq_matching, ja
isred
end
for (k, (c, v)) in ag
isreducible(k) || push!(irreducible_set, k)
isreducible(k) || push!(irreducible_set, k)
iszero(c) && continue
push!(irreducible_set, v)
isempty(𝑑neighbors(graph, v)) || push!(irreducible_set, v)
end
end

Expand Down
2 changes: 0 additions & 2 deletions src/systems/systemstructure.jl
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,6 @@ function TearingState(sys; quick_cancel = false, check = true)
ivs = independent_variables(sys)
eqs = copy(equations(sys))
neqs = length(eqs)
algeqs = trues(neqs)
dervaridxs = OrderedSet{Int}()
var2idx = Dict{Any, Int}()
symbolic_incidence = []
Expand Down Expand Up @@ -259,7 +258,6 @@ function TearingState(sys; quick_cancel = false, check = true)
push!(symbolic_incidence, copy(statevars))
empty!(statevars)
empty!(vars)
algeqs[i] = isalgeq
if isalgeq
eqs[i] = eq
else
Expand Down

0 comments on commit 4c30760

Please sign in to comment.