#NEWLINE# def setDiff( self , graph ) : #NEWLINE# #INDENT# '\n        Find the edges in the current graph which are not present in the input\n        graph.\n\n        :param graph: the input graph.\n        :type graph: :class:`apgl.graph.PySparseGraph`\n\n        :returns: A new graph with edges from the current graph and not in the input graph.\n        ' #NEWLINE# Parameter . checkClass ( graph , PySparseGraph ) #NEWLINE# if ( graph . getNumVertices ( ) != self . getNumVertices ( ) ) : #NEWLINE# #INDENT# raise ValueError ( 'Can only add edges from graph with same number of vertices' ) #NEWLINE# #UNINDENT# if ( self . undirected != graph . undirected ) : #NEWLINE# #INDENT# raise ValueError ( 'Both graphs must be either undirected or directed' ) #NEWLINE# #UNINDENT# A1 = self . nativeAdjacencyMatrix ( ) #NEWLINE# A2 = graph . nativeAdjacencyMatrix ( ) #NEWLINE# ( rows , cols ) = PySparseUtils . nonzero ( A1 ) #NEWLINE# arr1 = numpy . zeros ( len ( rows ) ) #NEWLINE# arr2 = numpy . zeros ( len ( rows ) ) #NEWLINE# A1 . take ( arr1 , rows , cols ) #NEWLINE# A2 . take ( arr2 , rows , cols ) #NEWLINE# arr1 = ( arr1 - arr2 ) #NEWLINE# A1 . put ( arr1 , rows , cols ) #NEWLINE# newGraph = PySparseGraph ( self . vList , self . undirected ) #NEWLINE# newGraph . W = A1 #NEWLINE# return newGraph