def correct_sign(deg_f, deg_g, s1, rdel, cdel):
 M = s1[:, :]
 for i in range(((M.rows - deg_f) - 1), (((M.rows - deg_f) - rdel) - 1), (-1)):
  M.row_del(i)
 for i in range((M.rows - 1), ((M.rows - rdel) - 1), (-1)):
  M.row_del(i)
 for i in range(cdel):
  M.col_del((M.rows - 1))
 Md = M[:, 0:M.rows]
 return Md.det()

def correct_sign ( deg_f , deg_g , s1 , rdel , cdel ) : M = s1 [ : , : ] for i in range ( ( ( M . rows - deg_f ) - 1 ) , ( ( ( M . rows - deg_f ) - rdel ) - 1 ) , ( - 1 ) ) : M . row_del ( i ) for i in range ( ( M . rows - 1 ) , ( ( M . rows - rdel ) - 1 ) , ( - 1 ) ) : M . row_del ( i ) for i in range ( cdel ) : M . col_del ( ( M . rows - 1 ) ) Md = M [ : , 0 : M . rows ] return Md . det ( )
used in various subresultant prs algorithms .