(self, points=None, indices=None)
return sparse.coo_matrix((weights.ravel(), (rows, cols)),
                                 shape=(self.input_dim * npoints,
                                        self.discretization.nindex))
Return the gradients at the respective points.

        This function returns a sparse matrix that, when multiplied
        with the vector of all the function values on the vertices,
        returns the gradients. Note that after the product you have to call
        ```np.reshape(grad, (ndim, -1))``` in order to obtain a proper
        gradient matrix.

        Parameters
        ----------
        points : ndarray
            Each row contains one state at which to evaluate the gradient.
        indices : ndarray
            The simplex indices. Ignored if points are provided.

        Returns
        -------
        gradient : scipy.sparse.coo_matrix
            A sparse matrix so that
            `grad(points) = B.dot(vertex_val).reshape(ndim, -1)` corresponds
            to the true gradients
Return the gradients at the respective points.
Return the gradients at the respective points .
def gradient_parameter_derivative(self, points=None, indices=None):
        """
        Return the gradients at the respective points.

        This function returns a sparse matrix that, when multiplied
        with the vector of all the function values on the vertices,
        returns the gradients. Note that after the product you have to call
        ```np.reshape(grad, (ndim, -1))``` in order to obtain a proper
        gradient matrix.

        Parameters
        ----------
        points : ndarray
            Each row contains one state at which to evaluate the gradient.
        indices : ndarray
            The simplex indices. Ignored if points are provided.

        Returns
        -------
        gradient : scipy.sparse.coo_matrix
            A sparse matrix so that
            `grad(points) = B.dot(vertex_val).reshape(ndim, -1)` corresponds
            to the true gradients

        """
        weights, simplices = self._get_weights_gradient(points=points,
                                                        indices=indices)

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

        # Construct sparse matrix for optimization

        # Indices of constraints (ndim gradients for each point, which each
        # depend on the nsimp vertices of the simplex.
        rows = np.repeat(np.arange(npoints * self.input_dim), nsimp)
        cols = np.tile(simplices, (1, self.input_dim)).ravel()

        return sparse.coo_matrix((weights.ravel(), (rows, cols)),
                                 shape=(self.input_dim * npoints,
                                        self.discretization.nindex))
def gradient_parameter_derivative ( self , points = None , indices = None ) : weights , simplices = self . _get_weights_gradient ( points = points , indices = indices ) # Some numbers for convenience nsimp = self . input_dim + 1 npoints = len ( simplices ) # Construct sparse matrix for optimization # Indices of constraints (ndim gradients for each point, which each # depend on the nsimp vertices of the simplex. rows = np . repeat ( np . arange ( npoints * self . input_dim ) , nsimp ) cols = np . tile ( simplices , ( 1 , self . input_dim ) ) . ravel ( ) return sparse . coo_matrix ( ( weights . ravel ( ) , ( rows , cols ) ) , shape = ( self . input_dim * npoints , self . discretization . nindex ) )