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
Hi. I think it would be nice to define here these two interface functions.
Some pseudocode:
""" todirected(g::AbstractGraph)Create a directed instance of graph `g`.If `g` is already directed, return `g` unchanged."""@tratfntodirected(g::AbstractGraph::IsDirected) = g
@tratfntodirected(g::AbstractGraph::!(IsDirected)) =error("not implemented")
""" toundirected(g::AbstractGraph)Create a undirected instance of graph `g`.If `g` is already undirected, return `g` unchanged."""@traitfntoundirected(g::AbstractGraph::::!(IsDirected)) = g
@traitfntoundirected(g::AbstractGraph::::IsDirected) =error("not implemented")
The implementation for Simple(Di)Graph is quite easy:
This will help across all the Graphs julia community with packages wanting to define other graphs (e.g. MetaGraph, Multigraph).
I think it's a nice interface to have.
Let me know if you are interested and I could try to find some time to make a PR :)
The text was updated successfully, but these errors were encountered:
Hi. I think it would be nice to define here these two interface functions.
Some pseudocode:
The implementation for
Simple(Di)Graph
is quite easy:This will help across all the Graphs julia community with packages wanting to define other graphs (e.g. MetaGraph, Multigraph).
I think it's a nice interface to have.
Let me know if you are interested and I could try to find some time to make a PR :)
The text was updated successfully, but these errors were encountered: