code: public static double[][] getMatrix(IAtomContainer container) {
          IBond bond = null;
          int indexAtom1;
          int indexAtom2;
          double[][] conMat = new double[container.getAtomCount()][container.getAtomCount()];
          for (int f = 0; f < container.getBondCount(); f++) {
              bond = container.getBond(f);
              indexAtom1 = container.indexOf(bond.getBegin());
              indexAtom2 = container.indexOf(bond.getEnd());
              conMat[indexAtom1][indexAtom2] = BondManipulator.destroyBondOrder(bond.getOrder());
              conMat[indexAtom2][indexAtom1] = BondManipulator.destroyBondOrder(bond.getOrder());
          }
          return conMat;
      }
docs: Returns the connection matrix representation of this AtomContainer.
  
  @param  container The AtomContainer for which the matrix is calculated
  @return           A connection matrix representing this AtomContainer