Skip to content

Commit

Permalink
Don't overparametrize BipartiteGraph
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Keno committed Nov 16, 2021
1 parent b64a4b5 commit 4a0bb57
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/bipartite_graph.jl
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,10 @@ badjlist = [[1,2,5,6],[3,4,6]]
bg = BipartiteGraph(7, fadjlist, badjlist)
```
"""
mutable struct BipartiteGraph{I<:Integer,F<:Vector{Vector{I}},B<:Union{Vector{Vector{I}},I},M} <: Graphs.AbstractGraph{I}
mutable struct BipartiteGraph{I<:Integer, M} <: LightGraphs.AbstractGraph{I}
ne::Int
fadjlist::F # `fadjlist[src] => dsts`
badjlist::B # `badjlist[dst] => srcs` or `ndsts`
fadjlist::Vector{Vector{I}} # `fadjlist[src] => dsts`
badjlist::Union{Vector{Vector{I}},I} # `badjlist[dst] => srcs` or `ndsts`
metadata::M
end
BipartiteGraph(ne::Integer, fadj::AbstractVector, badj::Union{AbstractVector,Integer}=maximum(maximum, fadj); metadata=nothing) = BipartiteGraph(ne, fadj, badj, metadata)
Expand Down
4 changes: 2 additions & 2 deletions src/systems/systemstructure.jl
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ Base.@kwdef struct SystemStructure
inv_varassoc::Vector{Int}
varmask::BitVector # `true` if the variable has the highest order derivative
algeqs::BitVector
graph::BipartiteGraph{Int,Vector{Vector{Int}},Int,Nothing}
solvable_graph::BipartiteGraph{Int,Vector{Vector{Int}},Int,Nothing}
graph::BipartiteGraph{Int,Nothing}
solvable_graph::BipartiteGraph{Int,Nothing}
assign::Vector{Union{Int, Unassigned}}
inv_assign::Vector{Int}
scc::Vector{Vector{Int}}
Expand Down

0 comments on commit 4a0bb57

Please sign in to comment.