def find_cell(self, x):
        """
        @param x: Nxd array
        @return: Nxd array with line i containing the indices of cell
                 containing x[i, :]
        """

        inf = self.a
        sup = self.b
        N = x.shape[0]
        indices = np.zeros((N, self.d), dtype=int)
        for i in range(self.d):
            xi = (x[:, i] - inf[i])/(sup[i]-inf[i])
            ni = np.floor(xi*self.orders[i])
            ni = np.minimum(np.maximum(ni, 0), self.orders[i]-1)
            indices[:, i] = ni

        return np.ravel_multi_index(indices.T, self.orders)
def find_cell ( self , x ) : inf = self . a sup = self . b N = x . shape [ 0 ] indices = np . zeros ( ( N , self . d ) , dtype = int ) for i in range ( self . d ) : xi = ( x [ : , i ] - inf [ i ] ) / ( sup [ i ] - inf [ i ] ) ni = np . floor ( xi * self . orders [ i ] ) ni = np . minimum ( np . maximum ( ni , 0 ) , self . orders [ i ] - 1 ) indices [ : , i ] = ni return np . ravel_multi_index ( indices . T , self . orders )
@param x: Nxd array
        @return: Nxd array with line i containing the indices of cell
                 containing x[i, :]