File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed
src/structural_transformation Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -208,6 +208,38 @@ function find_solvables!(state::TearingState; allow_symbolic=false)
208
208
return nothing
209
209
end
210
210
211
+ highest_order_variable_mask (ts) = let v2d = ts. structure. var_to_diff
212
+ v-> isempty (outneighbors (v2d, v))
213
+ end
214
+
215
+ lowest_order_variable_mask (ts) = let v2d = ts. structure. var_to_diff
216
+ v-> isempty (outneighbors (v2d, v))
217
+ end
218
+
219
+ function but_ordered_incidence (ts:: TearingState , varmask= highest_order_variable_mask (ts))
220
+ graph = complete (ts. structure. graph)
221
+ var_eq_matching = complete (maximal_matching (graph, _-> true , varmask))
222
+ scc = find_var_sccs (graph, var_eq_matching)
223
+ vordering = Vector {Int} (undef, 0 )
224
+ bb = Int[1 ]
225
+ sizehint! (vordering, ndsts (graph))
226
+ sizehint! (bb, ndsts (graph))
227
+ l = 1
228
+ for c in scc
229
+ isemptyc = true
230
+ for v in c
231
+ if varmask (v)
232
+ push! (vordering, v)
233
+ l += 1
234
+ isemptyc = false
235
+ end
236
+ end
237
+ isemptyc || push! (bb, l)
238
+ end
239
+ mm = incidence_matrix (graph)
240
+ mm[[var_eq_matching[v] for v in vordering if var_eq_matching[v] isa Int], vordering], bb
241
+ end
242
+
211
243
# debugging use
212
244
function reordered_matrix (sys, torn_matching)
213
245
s = TearingState (sys)
You can’t perform that action at this time.
0 commit comments