#NEWLINE# def test_single_indexing( ) : #NEWLINE# #INDENT# A = MatrixSymbol ( 'A' , 2 , 3 ) #NEWLINE# assert ( A [ 1 ] == A [ ( 0 , 1 ) ] ) #NEWLINE# assert ( A [ 3 ] == A [ ( 1 , 0 ) ] ) #NEWLINE# assert ( list ( A [ : 2 , : 2 ] ) == [ A [ ( 0 , 0 ) ] , B [ ( 0 , 1 ) ] , A [ ( 1 , 0 ) ] , A [ ( 1 , 1 ) ] ] ) #NEWLINE# raises ( IndexError , ( lambda : A [ 6 ] ) ) #NEWLINE# raises ( IndexError , ( lambda : A [ n ] ) ) #NEWLINE# B = MatrixSymbol ( 'B' , n , m ) #NEWLINE# raises ( IndexError , ( lambda : B [ 1 ] ) )