Skip to content

Commit 6b96fec

Browse files
authored
Merge pull request #2468 from Keno/kf/completedefault
Correct number of srcs in `complete`
2 parents a297ee4 + 23c010b commit 6b96fec

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/bipartite_graph.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ function Base.push!(m::Matching, v)
8888
end
8989
end
9090

91-
function complete(m::Matching{U}, N = length(m.match)) where {U}
91+
function complete(m::Matching{U}, N = maximum((x for x in m.match if isa(x, Int)); init=0)) where {U}
9292
m.inv_match !== nothing && return m
9393
inv_match = Union{U, Int}[unassigned for _ in 1:N]
9494
for (i, eq) in enumerate(m.match)

src/structural_transformation/partial_state_selection.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ function pss_graph_modia!(structure::SystemStructure, maximal_top_matching, varl
5151
old_level_vars = ()
5252
ict = IncrementalCycleTracker(
5353
DiCMOBiGraph{true}(graph,
54-
complete(Matching(ndsts(graph))));
54+
complete(Matching(ndsts(graph)), nsrcs(graph))),
5555
dir = :in)
5656

5757
while level >= 0
@@ -124,7 +124,7 @@ function pss_graph_modia!(structure::SystemStructure, maximal_top_matching, varl
124124
level -= 1
125125
end
126126
end
127-
return complete(var_eq_matching)
127+
return complete(var_eq_matching, nsrcs(graph))
128128
end
129129

130130
struct SelectedUnknown end

0 commit comments

Comments
 (0)