Skip to content

Commit ad0f802

Browse files
committed
Fix typo
1 parent 9e2d60a commit ad0f802

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/structural_transformation/utils.jl

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,15 @@ function BipartiteGraphs.maximal_matching(s::SystemStructure, eqfilter = eq -> t
1212
maximal_matching(s.graph, eqfilter, varfilter)
1313
end
1414

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+
1521
function error_reporting(state, bad_idxs, n_highest_vars, iseqs, orig_inputs)
1622
io = IOBuffer()
17-
neqs = length(ndsts(state.structure.graph))
23+
neqs = n_concrete_eqs(state)
1824
if iseqs
1925
error_title = "More equations than variables, here are the potential extra equation(s):\n"
2026
out_arr = has_equations(state) ? equations(state)[bad_idxs] : bad_idxs
@@ -54,12 +60,12 @@ end
5460
###
5561
function check_consistency(state::TransformationState, ag, orig_inputs)
5662
fullvars = get_fullvars(state)
63+
neqs = n_concrete_eqs(state)
5764
@unpack graph, var_to_diff = state.structure
5865
n_highest_vars = count(v -> var_to_diff[v] === nothing &&
5966
!isempty(𝑑neighbors(graph, v)) &&
6067
(ag === nothing || !haskey(ag, v) || ag[v] != v),
6168
vertices(var_to_diff))
62-
neqs = nsrcs(graph)
6369
is_balanced = n_highest_vars == neqs
6470

6571
if neqs > 0 && !is_balanced

0 commit comments

Comments
 (0)