Skip to content

Commit ecaad98

Browse files
committed
Update SystemStructure
1 parent 4ea6a50 commit ecaad98

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/systems/systemstructure.jl

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,12 @@ export dervars_range, diffvars_range, algvars_range
4646
Base.@kwdef struct SystemStructure
4747
fullvars::Vector
4848
vartype::Vector{VariableType}
49-
inv_varassoc::Vector{Int}
5049
varassoc::Vector{Int}
50+
inv_varassoc::Vector{Int}
51+
varmask::BitVector # `true` if the variable has the highest order derivative
5152
algeqs::BitVector
52-
graph::BipartiteGraph{Int,Nothing}
53-
solvable_graph::BipartiteGraph{Int,Nothing}
53+
graph::BipartiteGraph{Int,Vector{Vector{Int}},Nothing,Nothing}
54+
solvable_graph::BipartiteGraph{Int,Vector{Vector{Int}},Nothing,Nothing}
5455
assign::Vector{Int}
5556
inv_assign::Vector{Int}
5657
scc::Vector{Vector{Int}}
@@ -148,7 +149,7 @@ function initialize_system_structure(sys)
148149
vartype[algvaridx] = ALGEBRAIC_VARIABLE
149150
end
150151

151-
graph = BipartiteGraph(neqs, nvars)
152+
graph = BipartiteGraph(neqs, nvars, Val(false))
152153
for (ie, vars) in enumerate(symbolic_incidence), v in vars
153154
jv = var2idx[v]
154155
add_edge!(graph, ie, jv)
@@ -160,9 +161,10 @@ function initialize_system_structure(sys)
160161
vartype = vartype,
161162
varassoc = varassoc,
162163
inv_varassoc = inv_varassoc,
164+
varmask = iszero.(varassoc),
163165
algeqs = algeqs,
164166
graph = graph,
165-
solvable_graph = BipartiteGraph(nsrcs(graph), ndsts(graph)),
167+
solvable_graph = BipartiteGraph(nsrcs(graph), ndsts(graph), Val(false)),
166168
assign = Int[],
167169
inv_assign = Int[],
168170
scc = Vector{Int}[],

0 commit comments

Comments
 (0)