@@ -12,9 +12,15 @@ function BipartiteGraphs.maximal_matching(s::SystemStructure, eqfilter = eq -> t
12
12
maximal_matching (s. graph, eqfilter, varfilter)
13
13
end
14
14
15
+ n_concrete_eqs (state:: TransformationState ) = n_concrete_eqs (state. structure)
16
+ n_concrete_eqs (structure:: SystemStructure ) = n_concrete_eqs (structure. graph)
17
+ function n_concrete_eqs (graph:: BipartiteGraph )
18
+ neqs = count (e -> ! isempty (𝑠neighbors (graph, e)), 𝑠vertices (graph))
19
+ end
20
+
15
21
function error_reporting (state, bad_idxs, n_highest_vars, iseqs, orig_inputs)
16
22
io = IOBuffer ()
17
- neqs = length ( ndsts ( state. structure . graph) )
23
+ neqs = n_concrete_eqs ( state)
18
24
if iseqs
19
25
error_title = " More equations than variables, here are the potential extra equation(s):\n "
20
26
out_arr = has_equations (state) ? equations (state)[bad_idxs] : bad_idxs
54
60
# ##
55
61
function check_consistency (state:: TransformationState , ag, orig_inputs)
56
62
fullvars = get_fullvars (state)
63
+ neqs = n_concrete_eqs (state)
57
64
@unpack graph, var_to_diff = state. structure
58
65
n_highest_vars = count (v -> var_to_diff[v] === nothing &&
59
66
! isempty (𝑑neighbors (graph, v)) &&
60
67
(ag === nothing || ! haskey (ag, v) || ag[v] != v),
61
68
vertices (var_to_diff))
62
- neqs = nsrcs (graph)
63
69
is_balanced = n_highest_vars == neqs
64
70
65
71
if neqs > 0 && ! is_balanced
0 commit comments