From 4a0bb5788e989557d9197f8b3052a1b28996a77e Mon Sep 17 00:00:00 2001 From: Keno Fischer Date: Tue, 16 Nov 2021 18:38:30 -0500 Subject: [PATCH] Don't overparametrize BipartiteGraph Avoids a base julia type intersection issue: https://github.com/JuliaLang/julia/issues/43082. The overparameterization is not particularly required - Julia is fast at union splitting and this access is not particularly hot anyway. --- src/bipartite_graph.jl | 6 +++--- src/systems/systemstructure.jl | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/bipartite_graph.jl b/src/bipartite_graph.jl index cb014feeca..6259fc09e5 100644 --- a/src/bipartite_graph.jl +++ b/src/bipartite_graph.jl @@ -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) diff --git a/src/systems/systemstructure.jl b/src/systems/systemstructure.jl index 87d79495bd..b66000b030 100644 --- a/src/systems/systemstructure.jl +++ b/src/systems/systemstructure.jl @@ -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}}