public IEnumerable<Edge> Apply(Vertex source) { foreach (var kvp in Logic(source, Graph)) { yield return kvp; } }
public IEnumerable<Edge> Apply(Vertex source) { foreach (var kvp_iter in Logic(source.Object)) { var kvp = kvp_iter; // just make resharper happeh Func<Vertex> createVertex = () => new Vertex(kvp.Value, ++_idFactory, source.DistanceFromRoot + 1); if (kvp.Value == null) { yield return new Edge(kvp.Key, source, createVertex()); } else { var contains = SafetyTools.SafeEval(() => _cache.ContainsKey(kvp.Value), true); if (!contains) { SafetyTools.SafeDo(() => _cache.Add(kvp.Value, createVertex())); } var vertex = SafetyTools.SafeEval(() => _cache[kvp.Value], createVertex); yield return new Edge(kvp.Key, source, vertex); } } }
public bool IsValid(Vertex v) { return !Logic(v, Graph).IsEmpty(); }
public Edge OutEdge(Vertex v, int index) { return(_impl.OutEdge(v, index)); }
public bool TryGetOutEdges(Vertex v, out IEnumerable <Edge> edges) { return(_impl.TryGetOutEdges(v, out edges)); }
public IEnumerable <Edge> OutEdges(Vertex v) { return(_impl.OutEdges(v)); }
public int OutDegree(Vertex v) { return(_impl.OutDegree(v)); }
public bool IsOutEdgesEmpty(Vertex v) { return(_impl.IsOutEdgesEmpty(v)); }
public bool ContainsVertex(Vertex vertex) { return(_impl.ContainsVertex(vertex)); }
public bool IsValid(Vertex v) { return !Logic(v.Object).IsEmpty(); }