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


Java IBond.getConnectedAtom方法代码示例

本文整理汇总了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;
}
 
开发者ID:johnmay,项目名称:efficient-bits,代码行数:23,代码来源:Benchmark.java

示例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;
}
 
开发者ID:fortiema,项目名称:jCompoundMapper,代码行数:11,代码来源:Encoding2DECFPVariant.java

示例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);
			}
		}
	}
}
 
开发者ID:fortiema,项目名称:jCompoundMapper,代码行数:46,代码来源:DepthFirstSearch.java

示例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);
    }
}
 
开发者ID:johnmay,项目名称:efficient-bits,代码行数:12,代码来源:Benchmark.java


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