def dmp_factor_list_include(f, u, K):
 if (not u):
  return dup_factor_list_include(f, K)
 (coeff, factors) = dmp_factor_list(f, u, K)
 if (not factors):
  return [(dmp_ground(coeff, u), 1)]
 else:
  g = dmp_mul_ground(factors[0][0], coeff, u, K)
  return ([(g, factors[0][1])] + factors[1:])

def dmp_factor_list_include ( f , u , K ) : if ( not u ) : return dup_factor_list_include ( f , K ) ( coeff , factors ) = dmp_factor_list ( f , u , K ) if ( not factors ) : return [ ( dmp_ground ( coeff , u ) , 1 ) ] else : g = dmp_mul_ground ( factors [ 0 ] [ 0 ] , coeff , u , K ) return ( [ ( g , factors [ 0 ] [ 1 ] ) ] + factors [ 1 : ] )
factor polynomials into irreducibles in k[x] .