@@ -149,8 +149,16 @@ Base.@kwdef mutable struct SystemStructure
149149 # or as `torn` to assert that tearing has run.
150150 """ Graph that connects equations to variables that appear in them."""
151151 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+ """
153156 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}}
154162 """ Variable types (brownian, variable, parameter) in the system."""
155163 var_types:: Union{Vector{VariableType}, Nothing}
156164 """ Whether the system is discrete."""
160168function Base. copy (structure:: SystemStructure )
161169 var_types = structure. var_types === nothing ? nothing : copy (structure. var_types)
162170 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),
164172 var_types, structure. only_discrete)
165173end
166174
@@ -437,7 +445,7 @@ function TearingState(sys; quick_cancel = false, check = true)
437445
438446 ts = TearingState (sys, fullvars,
439447 SystemStructure (complete (var_to_diff), complete (eq_to_diff),
440- complete (graph), nothing , var_types, sys isa AbstractDiscreteSystem),
448+ complete (graph), nothing , Dict (), var_types, sys isa AbstractDiscreteSystem),
441449 Any[])
442450 if sys isa DiscreteSystem
443451 ts = shift_discrete_system (ts)
0 commit comments