def gf_factor_sqf(f, p, K, method=None):
 (lc, f) = gf_monic(f, p, K)
 if (gf_degree(f) < 1):
  return (lc, [])
 method = (method or query('GF_FACTOR_METHOD'))
 if (method is not None):
  factors = _factor_methods[method](f, p, K)
 else:
  factors = gf_zassenhaus(f, p, K)
 return (lc, factors)

def gf_factor_sqf ( f , p , K , method = None ) : ( lc , f ) = gf_monic ( f , p , K ) if ( gf_degree ( f ) < 1 ) : return ( lc , [ ] ) method = ( method or query ( 'GF_FACTOR_METHOD' ) ) if ( method is not None ) : factors = _factor_methods [ method ] ( f , p , K ) else : factors = gf_zassenhaus ( f , p , K ) return ( lc , factors )
factor a square-free polynomial f in gf(p)[x] .