You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/abstractmultilayergraph.jl
+6-13Lines changed: 6 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -37,7 +37,7 @@ abstract type AbstractMultilayerGraph{T<:Integer,U<:Real} <: AbstractGraph{T} en
37
37
38
38
Return the nodes of the AbstractMultilayerGraph `mg`, in order of addition.
39
39
"""
40
-
nodes(mg::M) where {M<:AbstractMultilayerGraph}= [couple[2] for couple insort(collect(mg.idx_N_associations), by = first)]
40
+
nodes(mg::AbstractMultilayerGraph)= [couple[2] for couple insort(collect(mg.idx_N_associations), by = first)]
41
41
42
42
"""
43
43
nn(mg::M) where {M <: AbstractMultilayerGraph }
@@ -95,19 +95,19 @@ end
95
95
96
96
# Vertices
97
97
"""
98
-
Base.eltype(mg::M) where {M <: AbstractMultilayerGraph}
98
+
eltype(::M) where {T,M<:AbstractMultilayerGraph{T}}
99
99
100
100
Return the vertex type of `mg`.
101
101
"""
102
-
Base.eltype(::M) where {T,U,M<:AbstractMultilayerGraph{T,U}} = T
102
+
Base.eltype(::M) where {T,M<:AbstractMultilayerGraph{T}} = T
103
103
104
104
105
105
"""
106
-
has_vertex(mg::M, v::T) where {T,U, M <: AbstractMultilayerGraph{T,U}}
106
+
has_vertex(mg::M, v::T) where {T,M <: AbstractMultilayerGraph{T}}
107
107
108
108
Return true if `v` is in mg, else false.
109
109
"""
110
-
Graphs.has_vertex(mg::M, v::T ) where {T,U, M <:AbstractMultilayerGraph{T,U}} = v indomain(mg.v_V_associations) # && !(mg.v_V_associations[v] isa MissingVertex)
110
+
Graphs.has_vertex(mg::M, v::T ) where {T, M <:AbstractMultilayerGraph{T}} = v indomain(mg.v_V_associations) # && !(mg.v_V_associations[v] isa MissingVertex)
111
111
112
112
"""
113
113
has_vertex(mg::M, mv::MultilayerVertex) where {T,U, M <: AbstractMultilayerGraph{T,U}}
@@ -128,14 +128,7 @@ mv_vertices(mg::AbstractMultilayerGraph) = [get_rich_mv(mg, v) for v in vertic
128
128
129
129
Return the number of vertices in `mg`, excluding the missing vertices.
130
130
"""
131
-
Graphs.nv(mg::M) where {M<:AbstractMultilayerGraph} =length(mg.v_V_associations) #length([mv for mv in image(mg.v_V_associations) if !(mv isa MissingVertex)])
132
-
133
-
#= """
134
-
nv_withmissing(mg::M) where {M<:AbstractMultilayerGraph}
135
-
136
-
Return the number of vertices of `mg`, including the missing vertices.
137
-
"""
138
-
nv_withmissing(mg::M) where {M<:AbstractMultilayerGraph} = length(mg.v_V_associations) =#
Copy file name to clipboardExpand all lines: src/utilities.jl
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -574,7 +574,7 @@ Returns a simple graph with a given finite degree sequence of non-negative integ
574
574
2. [Kleitman and Wang (1973)](https://doi.org/10.1016/0012-365X(73)90037-X)
575
575
"""
576
576
functionhavel_hakimi_(empty_graph::SimpleGraph, degree_sequence::Vector{<:Integer}) # Please think about a decent name!
577
-
# Check wether the given degree sequence contains only non-negative integers
577
+
# Check whether the given degree sequence contains only non-negative integers
578
578
!any(degree -> degree <0, degree_sequence) ||throw(ArgumentError("The degree sequence (degree_sequence) is invalid: it must contain non-negative integers only."))
579
579
# Check whether the given degree sequence is compatible with the given multilayer graph
580
580
nv(empty_graph) ==length(degree_sequence) ||throw(ArgumentError("The degree sequence (degree_sequence) and the multilayer graph (empty_mg) are incompatible: the length of the degree sequence doesn't coincide with the number of vertices."))
0 commit comments