public override bool GetMaxCommonFragments( HasseNode Node1, HasseNode Node2, bool dbg, HasseFragmentInsertionQueue NewFragmentList, int MinimumOverlap) { string debugInfo = ""; HasseFingerprint fp1 = ((FingerprintChemHasseNode)Node1).hFingerprint; HasseFingerprint fp1_clone = fp1.CloneHasseFingerprint(); HasseFingerprint fp2 = ((FingerprintChemHasseNode)Node2).hFingerprint; fp1_clone.AndBits(fp2); if (fp1_clone.bitCount >= MinimumOverlap) { string strMCS = fp1_clone.ToHex(); HasseFingerprint test = new HasseFingerprint(); test.FromHex(strMCS); NewFragmentList.Add( new HasseNode[1] { this }, // this is lower than new frag new HasseNode[2] { Node1, Node2 }, // those are higher than new frag strMCS, // string to use for new node creation later debugInfo, HasseNode.HasseNodeTypes.FRAGMENT | HasseNode.HasseNodeTypes.MAX_COMMON_FRAGMENT, // type of frag null // this new frag is not associated with a single edge ); return(true); } return(false); }
public override string[] GetDifferenceString(HasseNode LargerNode) { if (this.NodeType == HasseNodeTypes.ROOT) { return(new string[] { }); } else { string buf; HasseFingerprint fp = this.hFingerprint; HasseFingerprint fpclone = fp.CloneHasseFingerprint(); fpclone.Minus(((FingerprintChemHasseNode )LargerNode).hFingerprint); buf = fpclone.ToHex(); return(new string[] { buf }); } return(ChemObject.GetDifferenceString(LargerNode)); }