@@ -46,11 +46,12 @@ export dervars_range, diffvars_range, algvars_range
46
46
Base. @kwdef struct SystemStructure
47
47
fullvars:: Vector
48
48
vartype:: Vector{VariableType}
49
- inv_varassoc:: Vector{Int}
50
49
varassoc:: Vector{Int}
50
+ inv_varassoc:: Vector{Int}
51
+ varmask:: BitVector # `true` if the variable has the highest order derivative
51
52
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}
54
55
assign:: Vector{Int}
55
56
inv_assign:: Vector{Int}
56
57
scc:: Vector{Vector{Int}}
@@ -148,7 +149,7 @@ function initialize_system_structure(sys)
148
149
vartype[algvaridx] = ALGEBRAIC_VARIABLE
149
150
end
150
151
151
- graph = BipartiteGraph (neqs, nvars)
152
+ graph = BipartiteGraph (neqs, nvars, Val ( false ) )
152
153
for (ie, vars) in enumerate (symbolic_incidence), v in vars
153
154
jv = var2idx[v]
154
155
add_edge! (graph, ie, jv)
@@ -160,9 +161,10 @@ function initialize_system_structure(sys)
160
161
vartype = vartype,
161
162
varassoc = varassoc,
162
163
inv_varassoc = inv_varassoc,
164
+ varmask = iszero .(varassoc),
163
165
algeqs = algeqs,
164
166
graph = graph,
165
- solvable_graph = BipartiteGraph (nsrcs (graph), ndsts (graph)),
167
+ solvable_graph = BipartiteGraph (nsrcs (graph), ndsts (graph), Val ( false ) ),
166
168
assign = Int[],
167
169
inv_assign = Int[],
168
170
scc = Vector{Int}[],
0 commit comments