Ejemplo n.º 1
0
        public void TestRNode_int_int()
        {
            CDKRNode node = new CDKRNode(1, 2);

            Assert.IsNotNull(node);
            //Assert.IsNotNull(node.Extension);
            //Assert.IsNotNull(node.Forbidden);
        }
Ejemplo n.º 2
0
        /// <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);
        }
Ejemplo n.º 3
0
        /// <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);
        }
Ejemplo n.º 4
0
 /// <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);
 }