public UndirectedSubgraph(UndirectedGraph base_Renamed, SupportClass.SetSupport vertexSubset) : base(base_Renamed, vertexSubset) { }
private void addVerticesUsingFilter(SupportClass.SetSupport vertexSet, SupportClass.SetSupport filter) { System.Object v; //UPGRADE_TODO: Method 'java.util.Iterator.hasNext' was converted to 'System.Collections.IEnumerator.MoveNext' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javautilIteratorhasNext'" for (System.Collections.IEnumerator i = vertexSet.GetEnumerator(); i.MoveNext(); ) { v = ((DictionaryEntry)i.Current).Value; // note the use of short circuit evaluation if (filter == null || filter.Contains(v)) { addVertex(v); } } }
/// <summary> Creates a new induced Subgraph. The subgraph will keep track of edges /// being added to its vertex subset as well as deletion of edges and /// vertices. If base it not listenable, this is identical to the call /// Subgraph(base, vertexSubset, null) . /// /// </summary> /// <param name="base">the base (backing) graph on which the subgraph will be /// based. /// </param> /// <param name="vertexSubset">vertices to include in the subgraph. If /// <code>null</code> then all vertices are included. /// </param> public Subgraph(Graph base_Renamed, SupportClass.SetSupport vertexSubset):this(base_Renamed, vertexSubset, null) { m_isInduced = true; }
private void addEdgesUsingFilter(SupportClass.SetSupport edgeSet, SupportClass.SetSupport filter) { Edge e; bool containsVertices; bool edgeIncluded; //UPGRADE_TODO: Method 'java.util.Iterator.hasNext' was converted to 'System.Collections.IEnumerator.MoveNext' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javautilIteratorhasNext'" for (System.Collections.IEnumerator i = edgeSet.GetEnumerator(); i.MoveNext(); ) { e = (Edge)((DictionaryEntry)i.Current).Value; containsVertices = containsVertex(e.Source) && containsVertex(e.Target); // note the use of short circuit evaluation edgeIncluded = (filter == null) || filter.Contains(e); if (containsVertices && edgeIncluded) { addEdge(e); } } }
/// <summary> Creates a new Subgraph. /// /// </summary> /// <param name="base">the base (backing) graph on which the subgraph will be /// based. /// </param> /// <param name="vertexSubset">vertices to include in the subgraph. If /// <code>null</code> then all vertices are included. /// </param> /// <param name="edgeSubset">edges to in include in the subgraph. If /// <code>null</code> then all the edges whose vertices found in the /// graph are included. /// </param> public Subgraph(Graph base_Renamed, SupportClass.SetSupport vertexSubset, SupportClass.SetSupport edgeSubset) { m_base = base_Renamed; if (m_base is ListenableGraph) { ((ListenableGraph) m_base).addGraphListener(new BaseGraphListener(this)); } addVerticesUsingFilter(base_Renamed.vertexSet(), vertexSubset); addEdgesUsingFilter(base_Renamed.edgeSet(), edgeSubset); }