📄 topologicalmatrixtest.java
字号:
package org.openscience.cdk.test.graph.matrix;import java.io.InputStream;import junit.framework.Test;import junit.framework.TestSuite;import org.openscience.cdk.ChemObject;import org.openscience.cdk.Molecule;import org.openscience.cdk.graph.matrix.TopologicalMatrix;import org.openscience.cdk.interfaces.IMolecule;import org.openscience.cdk.io.MDLReader;import org.openscience.cdk.test.CDKTestCase;/** * @cdk.module test-standard */public class TopologicalMatrixTest extends CDKTestCase { public TopologicalMatrixTest(String name) { super(name); } public static Test suite() { return new TestSuite(TopologicalMatrixTest.class); } public void testTopologicalMatrix_IAtomContainer() throws Exception { String filename = "data/mdl/clorobenzene.mol"; InputStream ins = this.getClass().getClassLoader().getResourceAsStream( filename); MDLReader reader = new MDLReader(ins); IMolecule container = (Molecule) reader .read((ChemObject) new Molecule()); int[][] matrix = TopologicalMatrix.getMatrix(container); assertEquals(12, matrix.length); for (int i = 0; i < matrix.length; i++) { System.out.println(""); for (int j = 0; j < matrix.length; j++) { System.out.print(matrix[i][j] + " "); } } }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -