(self, states)
return np.ravel_multi_index(ijk_index.T, self.num_points)
Convert physical states to indices.

        Parameters
        ----------
        states: ndarray
            Physical states on the discretization.

        Returns
        -------
        indices: ndarray (int)
            The indices that correspond to the physical states.
Convert physical states to indices.
Convert physical states to indices .
def state_to_index(self, states):
        """Convert physical states to indices.

        Parameters
        ----------
        states: ndarray
            Physical states on the discretization.

        Returns
        -------
        indices: ndarray (int)
            The indices that correspond to the physical states.

        """
        states = np.atleast_2d(states)
        self._check_dimensions(states)
        states = np.clip(states, self.limits[:, 0], self.limits[:, 1])
        states = (states - self.offset) * (1. / self.unit_maxes)
        ijk_index = np.rint(states).astype(np.int32)
        return np.ravel_multi_index(ijk_index.T, self.num_points)
def state_to_index ( self , states ) : states = np . atleast_2d ( states ) self . _check_dimensions ( states ) states = np . clip ( states , self . limits [ : , 0 ] , self . limits [ : , 1 ] ) states = ( states - self . offset ) * ( 1. / self . unit_maxes ) ijk_index = np . rint ( states ) . astype ( np . int32 ) return np . ravel_multi_index ( ijk_index . T , self . num_points )