#NEWLINE# def _form_permutation_matrices( self ) : #NEWLINE# #INDENT# 'Form the permutation matrices Pq and Pu.' #NEWLINE# ( l , m , n , o , s , k ) = self . _dims #NEWLINE# if ( n != 0 ) : #NEWLINE# #INDENT# self . _Pq = permutation_matrix ( self . q , Matrix ( [ self . q_i , self . q_d ] ) ) #NEWLINE# if ( l > 0 ) : #NEWLINE# #INDENT# self . _Pqi = l . _Pq [ : , : ( - l ) ] #NEWLINE# self . _Pqd = self . _Pq [ : , ( - l ) : ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . _Pqi = self . _Pq #NEWLINE# self . _Pqd = Matrix ( ) #NEWLINE# #UNINDENT# #UNINDENT# if ( o != 0 ) : #NEWLINE# #INDENT# self . _Pu = permutation_matrix ( self . u , Matrix ( [ self . u_i , self . u_d ] ) ) #NEWLINE# if ( m > 0 ) : #NEWLINE# #INDENT# self . _Pui = self . _Pu [ : , : ( - m ) ] #NEWLINE# self . _Pud = self . _Pu [ : , ( - m ) : ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . _Pui = self . _Pu #NEWLINE# self . _Pud = Matrix ( ) #NEWLINE# #UNINDENT# #UNINDENT# P_col1 = Matrix ( [ self . _Pqi , zeros ( ( o + k ) , ( n - l ) ) ] ) #NEWLINE# P_col2 = Matrix ( [ zeros ( n , ( o - m ) ) , self . _Pui , zeros ( k , ( o - m ) ) ] ) #NEWLINE# if P_col1 : #NEWLINE# #INDENT# if P_col2 : #NEWLINE# #INDENT# self . perm_mat = P_col1 . row_join ( P_col2 ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . perm_mat = P_col1 #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# self . perm_mat = P_col2