Class MoleculeGrid

  • Direct Known Subclasses:
    NegativeReceptorImage

    public class MoleculeGrid
    extends java.lang.Object
    Class used to speed up the calculation of neighbours by creating a grid. Each atom is indexed according to its 3D coordinates.
    • Field Detail

      • gridWidth

        protected final double gridWidth
      • gridSize

        protected final int[] gridSize
      • grid

        protected final java.util.Set<java.lang.Integer>[][][] grid
    • Constructor Detail

      • MoleculeGrid

        public MoleculeGrid​(StereoMolecule mol,
                            double gridWidth,
                            Coordinates extension)
        Creates the Grid: Complexity O(nAtoms)
        Parameters:
        mol -
    • Method Detail

      • getNeighbours

        public java.util.Set<java.lang.Integer> getNeighbours​(Coordinates c,
                                                              double maxDist)
        Gets a Set of all neigbouring atoms. This class ensures that at least all atoms within maxDist are returned (+more)
        Parameters:
        c -
        maxDist -
        Returns:
      • getNeighbours

        public java.util.Set<java.lang.Integer> getNeighbours​(Coordinates c,
                                                              double maxDist,
                                                              boolean enforceDist)
      • getNeighbours

        public java.util.Set<java.lang.Integer> getNeighbours​(Coordinates c,
                                                              double maxDist,
                                                              boolean enforceDist,
                                                              int requiredFlags)
        Gets a Set of all neigbouring atoms. This class ensures that at least all atoms within maxDist are returned (+more)
        Parameters:
        c -
        maxDist -
        Returns:
      • hasNeighbours

        public boolean hasNeighbours​(Coordinates c,
                                     double maxDist)
      • getNeighbours

        public java.util.Set<java.lang.Integer> getNeighbours​(Coordinates[] bounds,
                                                              double maxDist)
        Gets a Set of all neigbouring atoms. This class ensures that at least all atoms within maxDist are returned (+more)
        Parameters:
        bounds -
        maxDist -
        Returns:
      • getClosestNeighbour

        public int getClosestNeighbour​(Coordinates c,
                                       double maxDist)
        Returns the closest neighbour. maxDist has to be given to take advantage of the speed
        Parameters:
        c -
        maxDist -
        Returns:
      • getNeighbours

        public java.util.Set<java.lang.Integer> getNeighbours​(Molecule mol,
                                                              int atom,
                                                              double maxDist)
      • getNeighbours

        public java.util.Set<java.lang.Integer> getNeighbours​(Molecule mol,
                                                              int atom,
                                                              double maxDist,
                                                              boolean enforceDist)
      • getGridCoordinates

        public int[] getGridCoordinates​(Coordinates c)
      • getCartCoordinates

        public Coordinates getCartCoordinates​(int[] gridCoords)
      • getGridSize

        public int[] getGridSize()