当前位置: 首页>>代码示例>>C#>>正文


C# IAtomContainer.getConnectedBondsVector方法代码示例

本文整理汇总了C#中IAtomContainer.getConnectedBondsVector方法的典型用法代码示例。如果您正苦于以下问题:C# IAtomContainer.getConnectedBondsVector方法的具体用法?C# IAtomContainer.getConnectedBondsVector怎么用?C# IAtomContainer.getConnectedBondsVector使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IAtomContainer的用法示例。


在下文中一共展示了IAtomContainer.getConnectedBondsVector方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: makeAtomsMapOfBondsMap

 /// <summary>  This makes a map of matching atoms out of a map of matching bonds as produced by the get(Subgraph|Ismorphism)Map methods.
 /// 
 /// </summary>
 /// <param name="l">  The list produced by the getMap method.
 /// </param>
 /// <param name="g1"> The first atom container.
 /// </param>
 /// <param name="g2"> The second one (first and second as in getMap)
 /// </param>
 /// <returns>     The mapping found projected on g1. This is a List of RMap objects containing Ids of matching atoms.
 /// </returns>
 public static System.Collections.IList makeAtomsMapOfBondsMap(System.Collections.IList l, IAtomContainer g1, IAtomContainer g2)
 {
     if (l == null)
         return (l);
     IBond[] bonds1 = g1.Bonds;
     IBond[] bonds2 = g2.Bonds;
     System.Collections.IList result = System.Collections.ArrayList.Synchronized(new System.Collections.ArrayList(10));
     for (int i = 0; i < l.Count; i++)
     {
         IBond bond1 = bonds1[((RMap)l[i]).Id1];
         IBond bond2 = bonds2[((RMap)l[i]).Id2];
         IAtom[] atom1 = bond1.getAtoms();
         IAtom[] atom2 = bond2.getAtoms();
         for (int j = 0; j < 2; j++)
         {
             IBond[] bondsConnectedToAtom1j = g1.getConnectedBonds(atom1[j]);
             for (int k = 0; k < bondsConnectedToAtom1j.Length; k++)
             {
                 if (bondsConnectedToAtom1j[k] != bond1)
                 {
                     IBond testBond = bondsConnectedToAtom1j[k];
                     for (int m = 0; m < l.Count; m++)
                     {
                         IBond testBond2;
                         if (((RMap)l[m]).Id1 == g1.getBondNumber(testBond))
                         {
                             testBond2 = bonds2[((RMap)l[m]).Id2];
                             for (int n = 0; n < 2; n++)
                             {
                                 System.Collections.IList bondsToTest = g2.getConnectedBondsVector(atom2[n]);
                                 if (bondsToTest.Contains(testBond2))
                                 {
                                     RMap map;
                                     if (j == n)
                                     {
                                         map = new RMap(g1.getAtomNumber(atom1[0]), g2.getAtomNumber(atom2[0]));
                                     }
                                     else
                                     {
                                         map = new RMap(g1.getAtomNumber(atom1[1]), g2.getAtomNumber(atom2[0]));
                                     }
                                     if (!result.Contains(map))
                                     {
                                         result.Add(map);
                                     }
                                     RMap map2;
                                     if (j == n)
                                     {
                                         map2 = new RMap(g1.getAtomNumber(atom1[1]), g2.getAtomNumber(atom2[1]));
                                     }
                                     else
                                     {
                                         map2 = new RMap(g1.getAtomNumber(atom1[0]), g2.getAtomNumber(atom2[1]));
                                     }
                                     if (!result.Contains(map2))
                                     {
                                         result.Add(map2);
                                     }
                                 }
                             }
                         }
                     }
                 }
             }
         }
     }
     return (result);
 }
开发者ID:xuchuansheng,项目名称:GenXSource,代码行数:79,代码来源:UniversalIsomorphismTester.cs


注:本文中的IAtomContainer.getConnectedBondsVector方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。