We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
similar_graph
DataGraph
1 parent db42ca3 commit 6cd667dCopy full SHA for 6cd667d
1 file changed
src/datagraph.jl
@@ -68,6 +68,22 @@ function NamedGraphs.similar_graph(
68
return DataGraph(new_underlying_graph; vertex_data_type, edge_data_type)
69
end
70
71
+function NamedGraphs.similar_graph(
72
+ G::Type{<:DataGraph},
73
+ vertices
74
+ )
75
+ new_underlying_graph = similar_graph(
76
+ underlying_graph_type(G),
77
78
79
+
80
+ VD = vertex_data_type(G)
81
+ ED = edge_data_type(G)
82
83
+ V = vertextype(G)
84
85
+ return DataGraph{V}(new_underlying_graph; vertex_data_type = VD, edge_data_type = ED)
86
+end
87
function Base.copy(graph::DataGraph)
88
# Need to manually copy the keys of Dictionaries, see:
89
# https://github.com/andyferris/Dictionaries.jl/issues/98
0 commit comments