#NEWLINE# @ modifies #NEWLINE# def zero_rows( self , rows , diag_val = 1.0 ) : #NEWLINE# #INDENT# 'Zeroes the specified rows of the matrix, with the exception of the\n        diagonal entry, which is set to diag_val. May be used for applying\n        strong boundary conditions.\n\n        :param rows: a :class:`Subset` or an iterable' #NEWLINE# base . _trace . evaluate ( set ( [ self ] ) , set ( [ self ] ) ) #NEWLINE# rows = ( rows . indices if isinstance ( rows , Subset ) else rows ) #NEWLINE# for row in rows : #NEWLINE# #INDENT# s = self . sparsity . _rowptr [ row ] #NEWLINE# e = self . sparsity . _rowptr [ ( row + 1 ) ] #NEWLINE# diag = np . where ( ( self . sparsity . _colidx [ s : e ] == row ) ) [ 0 ] #NEWLINE# self . _csrdata [ s : e ] . fill ( 0 ) #NEWLINE# if ( len ( diag ) == 1 ) : #NEWLINE# #INDENT# diag += s #NEWLINE# self . _csrdata [ diag : ( diag + 1 ) ] . fill ( diag_val )