Skip to content

Commit 571eff7

Browse files
authored
Don't overparametrize BipartiteGraph (#1346)
* Don't overparametrize BipartiteGraph Avoids a base julia type intersection issue: JuliaLang/julia#43082. The overparameterization is not particularly required - Julia is fast at union splitting and this access is not particularly hot anyway.
1 parent b64a4b5 commit 571eff7

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/bipartite_graph.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,10 @@ badjlist = [[1,2,5,6],[3,4,6]]
7171
bg = BipartiteGraph(7, fadjlist, badjlist)
7272
```
7373
"""
74-
mutable struct BipartiteGraph{I<:Integer,F<:Vector{Vector{I}},B<:Union{Vector{Vector{I}},I},M} <: Graphs.AbstractGraph{I}
74+
mutable struct BipartiteGraph{I<:Integer, M} <: Graphs.AbstractGraph{I}
7575
ne::Int
76-
fadjlist::F # `fadjlist[src] => dsts`
77-
badjlist::B # `badjlist[dst] => srcs` or `ndsts`
76+
fadjlist::Vector{Vector{I}} # `fadjlist[src] => dsts`
77+
badjlist::Union{Vector{Vector{I}},I} # `badjlist[dst] => srcs` or `ndsts`
7878
metadata::M
7979
end
8080
BipartiteGraph(ne::Integer, fadj::AbstractVector, badj::Union{AbstractVector,Integer}=maximum(maximum, fadj); metadata=nothing) = BipartiteGraph(ne, fadj, badj, metadata)

src/systems/systemstructure.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ Base.@kwdef struct SystemStructure
7878
inv_varassoc::Vector{Int}
7979
varmask::BitVector # `true` if the variable has the highest order derivative
8080
algeqs::BitVector
81-
graph::BipartiteGraph{Int,Vector{Vector{Int}},Int,Nothing}
82-
solvable_graph::BipartiteGraph{Int,Vector{Vector{Int}},Int,Nothing}
81+
graph::BipartiteGraph{Int,Nothing}
82+
solvable_graph::BipartiteGraph{Int,Nothing}
8383
assign::Vector{Union{Int, Unassigned}}
8484
inv_assign::Vector{Int}
8585
scc::Vector{Vector{Int}}

0 commit comments

Comments
 (0)