@@ -168,15 +168,15 @@ function partial_state_selection_graph!(structure::SystemStructure, var_eq_match
168168end
169169
170170function dummy_derivative_graph! (state:: TransformationState , jac = nothing ;
171- state_priority = nothing , kwargs... )
171+ state_priority = nothing , log = Val ( false ), kwargs... )
172172 state. structure. solvable_graph === nothing && find_solvables! (state; kwargs... )
173173 complete! (state. structure)
174174 var_eq_matching = complete (pantelides! (state))
175- dummy_derivative_graph! (state. structure, var_eq_matching, jac, state_priority)
175+ dummy_derivative_graph! (state. structure, var_eq_matching, jac, state_priority, log )
176176end
177177
178178function dummy_derivative_graph! (structure:: SystemStructure , var_eq_matching, jac,
179- state_priority)
179+ state_priority, :: Val{log} = Val ( false )) where {log}
180180 @unpack eq_to_diff, var_to_diff, graph = structure
181181 diff_to_eq = invview (eq_to_diff)
182182 diff_to_var = invview (var_to_diff)
@@ -338,7 +338,7 @@ function dummy_derivative_graph!(structure::SystemStructure, var_eq_matching, ja
338338 end
339339 end
340340
341- var_eq_matching = tear_graph_modia (structure, isdiffed,
341+ var_eq_matching, full_var_eq_matching = tear_graph_modia (structure, isdiffed,
342342 Union{Unassigned, SelectedState};
343343 varfilter = can_eliminate)
344344 for v in eachindex (var_eq_matching)
@@ -348,5 +348,10 @@ function dummy_derivative_graph!(structure::SystemStructure, var_eq_matching, ja
348348 var_eq_matching[v] = SelectedState ()
349349 end
350350
351- return var_eq_matching
351+ if log
352+ candidates = can_eliminate .(1 : ndsts (graph))
353+ return var_eq_matching, full_var_eq_matching, candidates
354+ else
355+ return var_eq_matching
356+ end
352357end
0 commit comments