Skip to content

Commit 7ccd4c7

Browse files
committed
Upgrade to Bijections v0.2
1 parent 64ace9a commit 7ccd4c7

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ TensorOperations = "6aa20fa7-93e2-5fca-9bc0-fbd0db3c71a2"
2323
WhereTraits = "c9d4e05b-6318-49cb-9b56-e0e2b0ceadd8"
2424

2525
[compat]
26-
Bijections = "0.1"
26+
Bijections = "0.2"
2727
DataStructures = "0.18, 0.19"
2828
Distributions = "0.25"
2929
Graphs = "1"

src/abstractmultilayergraph.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ fadjlist(mg::AbstractMultilayerGraph) = mg.fadjlist
5151
Return the nodes of the AbstractMultilayerGraph `mg`, in order of addition.
5252
"""
5353
function nodes(mg::AbstractMultilayerGraph)
54-
return [couple[2] for couple in sort(collect(mg.idx_N_associations); by=first)]
54+
return Node[node for (_, node) in sort!(collect(mg.idx_N_associations); by=first)]
5555
end
5656

5757
"""

src/multilayerdigraph.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ mutable struct MultilayerDiGraph{T,U} <: AbstractMultilayerGraph{T,U}
77
layers::Vector{LayerDescriptor{T,U}} # vector containing all the layers of the multilayer graph. Their underlying graphs must be all undirected.
88
interlayers::OrderedDict{Set{Symbol},InterlayerDescriptor{T,U}} # the ordered dictionary containing all the interlayers of the multilayer graph. Their underlying graphs must be all undirected.
99
v_V_associations::Bijection{T,<:MultilayerVertex} # A Bijection from Bijections.jl that associates numeric vertices to `MultilayerVertex`s.
10-
idx_N_associations::Bijection{Int64,Node} # A Bijection from Bijections.jl that associates Int64 to `Node`s.
10+
idx_N_associations::Bijection{Int64,Node,Dict{Int64,Node},Dict{Node,Int64}} # A Bijection from Bijections.jl that associates Int64 to `Node`s.
1111
fadjlist::Vector{Vector{HalfEdge{<:MultilayerVertex,<:Union{Nothing,U}}}} # the forward adjacency list of the MultilayerDiGraph. It is a vector of vectors of `HalfEdge`s. Its i-th element are the `HalfEdge`s that originate from `v_V_associations[i]`.
1212
badjlist::Vector{Vector{HalfEdge{<:MultilayerVertex,<:Union{Nothing,U}}}} # the backward adjacency list of the MultilayerDiGraph. It is a vector of vectors of `HalfEdge`s. Its i-th element are the `HalfEdge`s that insist on `v_V_associations[i]`.
1313
v_metadata_dict::Dict{T,<:Union{<:Tuple,<:NamedTuple}} # A Dictionary that associates numeric vertices to their metadata

src/multilayergraph.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ mutable struct MultilayerGraph{T,U} <: AbstractMultilayerGraph{T,U}
77
layers::Vector{LayerDescriptor{T,U}} # vector containing all the layers of the multilayer graph. Their underlying graphs must be all undirected.
88
interlayers::OrderedDict{Set{Symbol},InterlayerDescriptor{T,U}} # the ordered dictionary containing all the interlayers of the multilayer graph. Their underlying graphs must be all undirected.
99
v_V_associations::Bijection{T,<:MultilayerVertex} # A Bijection from Bijections.jl that associates numeric vertices to `MultilayerVertex`s.
10-
idx_N_associations::Bijection{Int64,Node} # A Bijection from Bijections.jl that associates Int64 to `Node`s.
10+
idx_N_associations::Bijection{Int64,Node,Dict{Int64,Node},Dict{Node,Int64}} # A Bijection from Bijections.jl that associates Int64 to `Node`s.
1111
fadjlist::Vector{Vector{HalfEdge{<:MultilayerVertex,<:Union{Nothing,U}}}} # the forward adjacency list of the MultilayerGraph. It is a vector of vectors of `HalfEdge`s. Its i-th element are the `HalfEdge`s that originate from `v_V_associations[i]`.
1212
v_metadata_dict::Dict{T,<:Union{<:Tuple,<:NamedTuple}} # A Dictionary that associates numeric vertices to their metadata.
1313
end

0 commit comments

Comments
 (0)