本文整理汇总了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);
}