@@ -149,8 +149,16 @@ Base.@kwdef mutable struct SystemStructure
149
149
# or as `torn` to assert that tearing has run.
150
150
""" Graph that connects equations to variables that appear in them."""
151
151
graph:: BipartiteGraph{Int, Nothing}
152
- """ Graph that connects equations to the variable they will be solved for during simplification."""
152
+ """
153
+ Graph that connects equations to the variables that they can be analytically solved
154
+ for.
155
+ """
153
156
solvable_graph:: Union{BipartiteGraph{Int, Nothing}, Nothing}
157
+ """
158
+ Dict mapping `eq => var` edges in `solvable_graph` to the variables that occur in the
159
+ denominator when `eq` is analytically solved for `var`.
160
+ """
161
+ denominators:: Dict{Pair{Int, Int}, Vector{Int}}
154
162
""" Variable types (brownian, variable, parameter) in the system."""
155
163
var_types:: Union{Vector{VariableType}, Nothing}
156
164
""" Whether the system is discrete."""
160
168
function Base. copy (structure:: SystemStructure )
161
169
var_types = structure. var_types === nothing ? nothing : copy (structure. var_types)
162
170
SystemStructure (copy (structure. var_to_diff), copy (structure. eq_to_diff),
163
- copy (structure. graph), copy (structure. solvable_graph),
171
+ copy (structure. graph), copy (structure. solvable_graph), copy (structure . denominators),
164
172
var_types, structure. only_discrete)
165
173
end
166
174
@@ -438,7 +446,7 @@ function TearingState(sys; quick_cancel = false, check = true)
438
446
439
447
ts = TearingState (sys, fullvars,
440
448
SystemStructure (complete (var_to_diff), complete (eq_to_diff),
441
- complete (graph), nothing , var_types, sys isa AbstractDiscreteSystem),
449
+ complete (graph), nothing , Dict (), var_types, sys isa AbstractDiscreteSystem),
442
450
Any[])
443
451
if sys isa DiscreteSystem
444
452
ts = shift_discrete_system (ts)
0 commit comments