def _find_indices(self, x):
        """Find indices and distances of the given nodes.

        Can be overridden by subclasses to improve efficiency.
        """
        # find relevant edges between which xi are situated
        index_vecs = []
        # compute distance to lower edge in unity units
        norm_distances = []

        # iterate through dimensions
        for xi, cvec in zip(x, self.coord_vecs):
            idcs = np.searchsorted(cvec, xi) - 1

            idcs[idcs < 0] = 0
            idcs[idcs > cvec.size - 2] = cvec.size - 2
            index_vecs.append(idcs)

            norm_distances.append((xi - cvec[idcs]) /
                                  (cvec[idcs + 1] - cvec[idcs]))

        return index_vecs, norm_distances
def _find_indices ( self , x ) : index_vecs = [ ] norm_distances = [ ] for xi , cvec in zip ( x , self . coord_vecs ) : idcs = np . searchsorted ( cvec , xi ) - 1 idcs [ idcs < 0 ] = 0 idcs [ idcs > cvec . size - 2 ] = cvec . size - 2 index_vecs . append ( idcs ) norm_distances . append ( ( xi - cvec [ idcs ] ) / ( cvec [ idcs + 1 ] - cvec [ idcs ] ) ) return index_vecs , norm_distances
Find indices and distances of the given nodes.

        Can be overridden by subclasses to improve efficiency.