(f, u, K)
return lc, dmp_trial_division(F, factors, u, K)
Factor multivariate polynomials over algebraic number fields.
Factor multivariate polynomials over algebraic number fields.
Factor multivariate polynomials over algebraic number fields .
def dmp_ext_factor(f, u, K):
    """Factor multivariate polynomials over algebraic number fields. """
    if not u:
        return dup_ext_factor(f, K)

    lc = dmp_ground_LC(f, u, K)
    f = dmp_ground_monic(f, u, K)

    if all(d <= 0 for d in dmp_degree_list(f, u)):
        return lc, []

    f, F = dmp_sqf_part(f, u, K), f
    s, g, r = dmp_sqf_norm(f, u, K)

    factors = dmp_factor_list_include(r, u, K.dom)

    if len(factors) == 1:
        coeff, factors = lc, [f]
    else:
        H = dmp_raise([K.one, s*K.unit], u, 0, K)

        for i, (factor, _) in enumerate(factors):
            h = dmp_convert(factor, u, K.dom, K)
            h, _, g = dmp_inner_gcd(h, g, u, K)
            h = dmp_compose(h, H, u, K)
            factors[i] = h

    return lc, dmp_trial_division(F, factors, u, K)
def dmp_ext_factor ( f , u , K ) : if not u : return dup_ext_factor ( f , K ) lc = dmp_ground_LC ( f , u , K ) f = dmp_ground_monic ( f , u , K ) if all ( d <= 0 for d in dmp_degree_list ( f , u ) ) : return lc , [ ] f , F = dmp_sqf_part ( f , u , K ) , f s , g , r = dmp_sqf_norm ( f , u , K ) factors = dmp_factor_list_include ( r , u , K . dom ) if len ( factors ) == 1 : coeff , factors = lc , [ f ] else : H = dmp_raise ( [ K . one , s * K . unit ] , u , 0 , K ) for i , ( factor , _ ) in enumerate ( factors ) : h = dmp_convert ( factor , u , K . dom , K ) h , _ , g = dmp_inner_gcd ( h , g , u , K ) h = dmp_compose ( h , H , u , K ) factors [ i ] = h return lc , dmp_trial_division ( F , factors , u , K )