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/subgraphs/layer.jl
+22-15Lines changed: 22 additions & 15 deletions
Original file line number
Diff line number
Diff line change
@@ -25,16 +25,6 @@ Represents a layer in a `Multilayer(Di)Graph`.
25
25
- `graph::G`: underlying graph of the layer;
26
26
- `forbidden_vertices::Vector{MultilayerVertex}`: nodes of the MultilayerGraph that are not part of this Layer (they will be formally present in the Layer but it will be checked that they aren't adjacent to any other node);
27
27
- `forbidden_edges`::Vector{NTuple{2, MultilayerVertex}}: edges that are required not to exist in this Layer.
Overridden inner constructor. Return an `Layer` whose underlying graph is `graph`. All `Layer`s and `Layer`s of a `Multilayer(Di)Graph` need to formally have the same nodes, but in real applications it may be that some vertices are excluded from some layers. Such vertices should be specified in `forbidden_vertices`. Similarly for `forbidden_edges`. This constructor (to which all the other eventually fall back to) will check that `forbidden_vertices` have no neighbors in `graph`, and that `forbidden_edges` actually correspond to zero entries in the adjacency matrix of `graph`.
34
-
35
-
Layer{T <: Integer, U <: Real, G <: AbstractGraph{T}} <: AbstractLayer{T,U,G}
36
-
37
-
Incomplete initialization, used to write type-stable functions
- `vertices::Vector{ <: MultilayerVertex}`: The `MultilayerVertex`s of the Layer;
63
+
- `edge_list::Vector{ <: MultilayerEdge}`: The list of `MultilayerEdge`s;
64
+
- `null_graph::G`: the Layer's underlying graph type, which must be passed as a null graph. If it is not, an error will be thrown;
65
+
- `weighttype::Type{U}`: The type of the `MultilayerEdge` weights (evem when the underlying Layer's graph is unweighted, we need to specify a weight type since the `MultilayerGraph`s will always be weighted)
66
+
67
+
# KWARGS
68
+
68
69
"""
69
70
functionLayer(name::Symbol, vertices::Vector{<: MultilayerVertex}, edge_list::Vector{ <: MultilayerEdge}, null_graph::G, weighttype::Type{U}; default_vertex_metadata::Function= mv ->NamedTuple(), default_edge_weight::Function= (src, dst) ->one(U), default_edge_metadata::Function= (src, dst) ->NamedTuple()) where {T <:Integer, U <:Real, G <:AbstractGraph{T}}
@@ -73,11 +74,17 @@ function Layer(name::Symbol, vertices::Vector{<: MultilayerVertex}, edge_list::V
73
74
end
74
75
75
76
"""
76
-
Layer(descriptor::LayerDescriptor{T,U,G}, vertices::Vector{<: MultilayerVertex}, edge_list::Vector{<:MultilayerEdge}) where {T <: Integer, U <: Real, G <: AbstractGraph{T}}
77
+
Layer(descriptor::LayerDescriptor{T}, vertices::Vector{<: MultilayerVertex}, edge_list::Vector{<:MultilayerEdge}) where {T <: Integer}
78
+
79
+
Constructor for `Layer`.
80
+
81
+
# ARGUMENTS
77
82
78
-
...
83
+
- `descriptor::LayerDescriptor{T}`;
84
+
- `vertices::Vector{<: MultilayerVertex}`;
85
+
- `edge_list::Vector{<:MultilayerEdge}`;
79
86
"""
80
-
functionLayer(descriptor::LayerDescriptor{T,U,G}, vertices::Vector{<: MultilayerVertex}, edge_list::Vector{<:MultilayerEdge}) where {T <:Integer, U <:Real, G <:AbstractGraph{T}}
87
+
functionLayer(descriptor::LayerDescriptor{T}, vertices::Vector{<: MultilayerVertex}, edge_list::Vector{<:MultilayerEdge}) where {T <:Integer}
81
88
82
89
ifhasproperty(eltype(vertices), :parameters)
83
90
par =eltype(vertices).parameters[1]
@@ -104,7 +111,7 @@ end
104
111
105
112
Return a random `Layer`.
106
113
107
-
# ARGS
114
+
# ARGUMENTS
108
115
109
116
- `name::Symbol`: The name of the Layer
110
117
- `vertices::Vector{ <: MultilayerVertex}`: The `MultilayerVertex`s of the Layer
0 commit comments