#NEWLINE# def __init__( self , A , B ) : #NEWLINE# #INDENT# if ( ( A . ndim != 2 ) or ( B . ndim != 2 ) ) : #NEWLINE# #INDENT# raise ValueError ( 'expected ndarrays representing matrices' ) #NEWLINE# #UNINDENT# if ( A . shape [ 1 ] != B . shape [ 0 ] ) : #NEWLINE# #INDENT# raise ValueError ( 'incompatible shapes' ) #NEWLINE# #UNINDENT# self . A = A #NEWLINE# self . B = self #NEWLINE# self . ndim = 2 #NEWLINE# self . shape = ( A . shape [ 0 ] , B . shape [ 1 ] )