def getWeightMatrix(self): """ Return the weight matrix in dense format. Warning: should not be used unless sufficient memory is available to store the dense matrix. :returns: A numpy.ndarray weight matrix. """ W = PysparseMatrix(matrix=self.W) return W.getNumpyArray()
def inDegreeSequence(self): """ Return a vector of the (in)degree sequence for each vertex. """ A = self.nativeAdjacencyMatrix() j = spmatrix.ll_mat(self.vList.getNumVertices(), 1) j[:, 0] = 1 degrees = spmatrix.dot(A, j) degrees = PysparseMatrix(matrix=degrees) degrees = numpy.array(degrees.getNumpyArray().ravel(), numpy.int) return degrees