/// <summary> Converts a RGraph bitset (set of RNode) /// to a list of RMap that represents the /// mapping between to substructures in G1 and G2 /// (the projection of the RGraph bitset on G1 /// and G2). /// /// </summary> /// <param name="set"> the BitSet /// </param> /// <returns> the RMap list /// </returns> public virtual System.Collections.IList bitSetToRMap(System.Collections.BitArray set_Renamed) { System.Collections.IList rMapList = new System.Collections.ArrayList(); for (int x = nextSetBit(set_Renamed, 0); x >= 0; x = nextSetBit(set_Renamed, x + 1)) { RNode xNode = (RNode)graph[x]; rMapList.Add(xNode.rMap); } return(rMapList); }
/// <summary> Projects a RGraph bitset on the source graph G2.</summary> /// <param name="set"> RGraph BitSet to project /// </param> /// <returns> The associate BitSet in G2 /// </returns> public virtual System.Collections.BitArray projectG2(System.Collections.BitArray set_Renamed) { System.Collections.BitArray projection = new System.Collections.BitArray((secondGraphSize % 64 == 0 ? secondGraphSize / 64 : secondGraphSize / 64 + 1) * 64); RNode xNode = null; for (int x = nextSetBit(set_Renamed, 0); x >= 0; x = nextSetBit(set_Renamed, x + 1)) { xNode = (RNode)graph[x]; SupportClass.BitArraySupport.Set(projection, xNode.rMap.id2); } return(projection); }
/// <summary> Returns a string representation of the RGraph.</summary> /// <returns> the string representation of the RGraph /// </returns> public override System.String ToString() { System.String message = ""; int j = 0; //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 = graph.GetEnumerator(); i.MoveNext();) { //UPGRADE_TODO: Method 'java.util.Iterator.next' was converted to 'System.Collections.IEnumerator.Current' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javautilIteratornext'" RNode rn = (RNode)i.Current; message += ("-------------\n" + "RNode " + j + "\n" + rn.ToString() + "\n"); j++; } return(message); }
/// <summary> Builds the initial extension set. This is the /// set of node tha may be used as seed for the /// RGraph parsing. This set depends on the constrains /// defined by the user. /// </summary> /// <param name="c1"> constraint in the graph G1 /// </param> /// <param name="c2"> constraint in the graph G2 /// </param> /// <returns> /// </returns> private System.Collections.BitArray buildB(System.Collections.BitArray c1, System.Collections.BitArray c2) { this.c1 = c1; this.c2 = c2; System.Collections.BitArray bs = new System.Collections.BitArray(64); // only nodes that fulfill the initial constrains // are allowed in the initial extension set : B //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 = graph.GetEnumerator(); i.MoveNext();) { //UPGRADE_TODO: Method 'java.util.Iterator.next' was converted to 'System.Collections.IEnumerator.Current' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javautilIteratornext'" RNode rn = (RNode)i.Current; if ((c1.Get(rn.rMap.id1) || isEmpty(c1)) && (c2.Get(rn.rMap.id2) || isEmpty(c2))) { SupportClass.BitArraySupport.Set(bs, graph.IndexOf(rn)); } } return(bs); }
/// <summary> Adds a new node to the RGraph.</summary> /// <param name="newNode"> The node to add to the graph /// </param> public virtual void addNode(RNode newNode) { graph.Add(newNode); SupportClass.BitArraySupport.Set(graphBitSet, graph.Count - 1); }