#NEWLINE# def _zero_triband( a , lower = 0 ) : #NEWLINE# #INDENT# '\n    Explicitly zero out unused elements of a real symmetric banded matrix.\n\n    INPUTS:\n       a   -- a real symmetric banded matrix (either upper or lower hald)\n       lower   -- if True, a is assumed to be the lower half\n\n    ' #NEWLINE# ( nrow , ncol ) = a . shape #NEWLINE# if lower : #NEWLINE# #INDENT# for i in range ( nrow ) : #NEWLINE# #INDENT# a [ i , ( ncol - i ) : ] = 0.0 #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# for i in range ( nrow ) : #NEWLINE# #INDENT# a [ i , 0 : i ] = 0.0 #NEWLINE# #UNINDENT# #UNINDENT# return a