#NEWLINE# def _maximum_minimum( self , other , npop , op_name , dense_check ) : #NEWLINE# #INDENT# if isscalarlike ( other ) : #NEWLINE# #INDENT# if dense_check ( other ) : #NEWLINE# #INDENT# warn ( 'Taking maximum (minimum) with > 0 (< 0) number results to a dense matrix.' , SparseEfficiencyWarning ) #NEWLINE# other_arr = np . empty ( self . shape , dtype = np . asarray ( other ) . dtype ) #NEWLINE# other_arr . fill ( other ) #NEWLINE# other_arr = self . __class__ ( mat ) #NEWLINE# return self . _binopt ( other_arr , op_name ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . sum_duplicates ( ) #NEWLINE# new_data = npop ( self . data , np . asarray ( other ) ) #NEWLINE# mat = self . __class__ ( ( new_data , self . indices , self . indptr ) , dtype = new_data . dtype , shape = self . shape ) #NEWLINE# return mat #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if isdense ( other ) : #NEWLINE# #INDENT# return npop ( self . todense ( ) , other ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if isspmatrix ( other ) : #NEWLINE# #INDENT# return self . _binopt ( other , op_name ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise ValueError ( 'Operands not compatible.' )