public void TestRNode_int_int() { CDKRNode node = new CDKRNode(1, 2); Assert.IsNotNull(node); //Assert.IsNotNull(node.Extension); //Assert.IsNotNull(node.Forbidden); }
/// <summary> /// Converts a CDKRGraph bitset (set of CDKRNode) /// to a list of CDKRMap that represents the /// mapping between to substructures in G1 and G2 /// (the projection of the CDKRGraph bitset on G1 /// and G2). /// /// <param name="set">the BitArray</param> /// <returns>the CDKRMap list</returns> /// </summary> public IReadOnlyList <CDKRMap> BitSetToRMap(BitArray set) { List <CDKRMap> rMapList = new List <CDKRMap>(); for (int x = BitArrays.NextSetBit(set, 0); x >= 0; x = BitArrays.NextSetBit(set, x + 1)) { CDKRNode xNode = Graph[x]; rMapList.Add(xNode.RMap); } return(rMapList); }
/// <summary> /// Projects a CDKRGraph bitset on the source graph G2. /// </summary> /// <param name="set">CDKRGraph BitArray to project</param> /// <returns>The associate BitArray in G2</returns> public BitArray ProjectG2(BitArray set) { BitArray projection = new BitArray(SecondGraphSize); CDKRNode xNode = null; for (int x = BitArrays.NextSetBit(set, 0); x >= 0; x = BitArrays.NextSetBit(set, x + 1)) { xNode = Graph[x]; projection.Set(xNode.RMap.Id2, true); } return(projection); }
/// <summary> /// Adds a new node to the CDKRGraph. /// <param name="newNode">The node to add to the graph</param> /// </summary> public void AddNode(CDKRNode newNode) { Graph.Add(newNode); BitArrays.SetValue(GraphBitSet, Graph.Count - 1, true); }