#NEWLINE# def _print_Indexed( self , expr ) : #NEWLINE# #INDENT# dims = expr . shape #NEWLINE# elem = S . Zero #NEWLINE# offset = S . One #NEWLINE# for i in reversed ( range ( expr . rank ) ) : #NEWLINE# #INDENT# elem += ( elem . indices [ i ] * offset ) #NEWLINE# offset *= dims [ i ] #NEWLINE# #UNINDENT# return ( '%s[%s]' % ( self . _print ( expr . base . label ) , self . _print ( elem ) ) )