(self, points)
return weights, simplices
Return the linear weights associated with points.

        Parameters
        ----------
        points : 2d array
            Each row represents one point

        Returns
        -------
        weights : ndarray
            An array that contains the linear weights for each point.
        simplices : ndarray
            The indices of the simplices associated with each points
Return the linear weights associated with points.
Return the linear weights associated with points .
def _get_weights(self, points):
        """Return the linear weights associated with points.

        Parameters
        ----------
        points : 2d array
            Each row represents one point

        Returns
        -------
        weights : ndarray
            An array that contains the linear weights for each point.
        simplices : ndarray
            The indices of the simplices associated with each points

        """
        disc = self.discretization
        simplex_ids = self.find_simplex(points)

        simplices = self.simplices(simplex_ids)
        origins = disc.index_to_state(simplices[:, 0])

        # Get hyperplane equations
        simplex_ids %= self.triangulation.nsimplex
        hyperplanes = self.hyperplanes[simplex_ids]

        # Some numbers for convenience
        nsimp = self.input_dim + 1
        npoints = len(points)

        if self.project:
            points = np.clip(points, disc.limits[:, 0], disc.limits[:, 1])

        weights = np.empty((npoints, nsimp), dtype=config.np_dtype)

        # Pre-multiply each hyperplane by (point - origin)
        offset = points - origins
        np.sum(offset[:, :, None] * hyperplanes, axis=1, out=weights[:, 1:])

        # The weights have to add up to one
        weights[:, 0] = 1 - np.sum(weights[:, 1:], axis=1)

        return weights, simplices
def _get_weights ( self , points ) : disc = self . discretization simplex_ids = self . find_simplex ( points ) simplices = self . simplices ( simplex_ids ) origins = disc . index_to_state ( simplices [ : , 0 ] ) # Get hyperplane equations simplex_ids %= self . triangulation . nsimplex hyperplanes = self . hyperplanes [ simplex_ids ] # Some numbers for convenience nsimp = self . input_dim + 1 npoints = len ( points ) if self . project : points = np . clip ( points , disc . limits [ : , 0 ] , disc . limits [ : , 1 ] ) weights = np . empty ( ( npoints , nsimp ) , dtype = config . np_dtype ) # Pre-multiply each hyperplane by (point - origin) offset = points - origins np . sum ( offset [ : , : , None ] * hyperplanes , axis = 1 , out = weights [ : , 1 : ] ) # The weights have to add up to one weights [ : , 0 ] = 1 - np . sum ( weights [ : , 1 : ] , axis = 1 ) return weights , simplices