本文整理汇总了Java中org.openscience.cdk.interfaces.IBond.getConnectedAtom方法的典型用法代码示例。如果您正苦于以下问题:Java IBond.getConnectedAtom方法的具体用法?Java IBond.getConnectedAtom怎么用?Java IBond.getConnectedAtom使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.openscience.cdk.interfaces.IBond
的用法示例。
在下文中一共展示了IBond.getConnectedAtom方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: process
import org.openscience.cdk.interfaces.IBond; //导入方法依赖的package包/类
@Override
void process(IAtomContainer mol) {
long t0 = System.nanoTime();
int[] prev = new int[mol.getAtomCount()];
int[] next = new int[mol.getAtomCount()];
for (int i = 0; i < mol.getAtomCount(); i++) {
next[i] = prev[i] = mol.getAtom(i).getAtomicNumber();
}
for (int rep = 0; rep < mol.getAtomCount(); rep++) {
for (int j = 0; j < mol.getAtomCount(); j++) {
IAtom atom = mol.getAtom(j);
for (IBond bond : mol.getConnectedBondsList(atom)) {
IAtom nbr = bond.getConnectedAtom(atom);
next[j] += prev[mol.getAtomNumber(nbr)];
}
}
System.arraycopy(next, 0, prev, 0, next.length);
}
long t1 = System.nanoTime();
tRun += t1 - t0;
for (int aNext : next) check += aNext;
}
示例2: generateExtensionBondList
import org.openscience.cdk.interfaces.IBond; //导入方法依赖的package包/类
private DanglingBond[] generateExtensionBondList(IAtom atom) throws FingerPrinterException {
List<IBond> bonds = this.molecule.getConnectedBondsList(atom);
DanglingBond[] connectivityBonds = new DanglingBond[bonds.size()];
int i = 0;
for (IBond bond : bonds) {
connectivityBonds[i] = new DanglingBond(bond, bond.getConnectedAtom(atom));
i++;
}
return connectivityBonds;
}
示例3: depthFirstSearch
import org.openscience.cdk.interfaces.IBond; //导入方法依赖的package包/类
/**
* Performs a recursive depth first search
*
* @param ac
* The AtomContainer to be searched
* @param root
* The Atom to start the search at
* @param currentPath
* The Path that has been generated so far
* @param currentDepth
* The current depth in this recursive search
* @param searchDepth
* Description of the Parameter
* @throws MoltyperException
*/
private void depthFirstSearch(IAtomContainer ac, IAtom root, Map<String, ArrayList<DepthFirstSearchFeature>> paths,
List<Object> currentPath, int currentDepth, int searchDepth, ArrayList<IFeature> strings)
throws MoltyperException {
final List<IBond> bonds = ac.getConnectedBondsList(root);
org.openscience.cdk.interfaces.IAtom nextAtom = null;
ArrayList<Object> newPath = null;
String bondSymbol = null;
currentDepth++;
for (int f = 0; f < bonds.size(); f++) {
final IBond bond = (IBond) bonds.get(f);
nextAtom = bond.getConnectedAtom(root);
if (!currentPath.contains(nextAtom)) {
newPath = new ArrayList<Object>(currentPath);
bondSymbol = getBondLabel(bond);
newPath.add(bondSymbol);
newPath.add(nextAtom);
try {
this.checkAndStore(newPath, paths, strings, ac);
} catch (MoltyperException e) {
e.printStackTrace();
}
if (currentDepth < searchDepth) {
this.depthFirstSearch(ac, nextAtom, paths, newPath, currentDepth, searchDepth, strings);
}
}
}
}
示例4: dfs
import org.openscience.cdk.interfaces.IBond; //导入方法依赖的package包/类
private void dfs(IAtomContainer mol, IAtom src, IBond prev) {
check++;
src.setFlag(CDKConstants.VISITED, true);
for (IBond bond : mol.getConnectedBondsList(src)) {
if (bond == prev)
continue;
IAtom dst = bond.getConnectedAtom(src);
if (!dst.getFlag(CDKConstants.VISITED))
dfs(mol, dst, bond);
}
}