Esempio n. 1
0
 def view_eid(self, u=None):
     """Return the compressed edge id for given u.
     """
     if u is None:
         return np.split(self._sorted_eid, self._indptr[1:])
     else:
         u = np.array(u, dtype="int64")
         return graph_kernel.slice_by_index(self._sorted_eid,
                                            self._indptr,
                                            index=u)
Esempio n. 2
0
 def view_v(self, u=None):
     """Return the compressed v for given u.
     """
     if self._is_tensor:
         raise NotImplementedError("not implemented!")
     else:
         if u is None:
             return np.split(self._sorted_v, self._indptr[1:-1])
         else:
             u = np.array(u, dtype="int64")
             return graph_kernel.slice_by_index(self._sorted_v,
                                                self._indptr,
                                                index=u)