(f, g, h, args, u, K)
return dmp_strip(result, u)
Apply ``h`` to pairs of coefficients of ``f`` and ``g``.

    Examples
    ========

    >>> from sympy.polys.domains import ZZ
    >>> from sympy.polys.densebasic import dmp_apply_pairs

    >>> h = lambda x, y, z: 2*x + y - z

    >>> dmp_apply_pairs([[1], [2, 3]], [[3], [2, 1]], h, (1,), 1, ZZ)
    [[4], [5, 6]]
Apply ``h`` to pairs of coefficients of ``f`` and ``g``.
Apply h to pairs of coefficients of f and g .
def dmp_apply_pairs(f, g, h, args, u, K):
    """
    Apply ``h`` to pairs of coefficients of ``f`` and ``g``.

    Examples
    ========

    >>> from sympy.polys.domains import ZZ
    >>> from sympy.polys.densebasic import dmp_apply_pairs

    >>> h = lambda x, y, z: 2*x + y - z

    >>> dmp_apply_pairs([[1], [2, 3]], [[3], [2, 1]], h, (1,), 1, ZZ)
    [[4], [5, 6]]

    """
    if not u:
        return dup_apply_pairs(f, g, h, args, K)

    n, m, v = len(f), len(g), u - 1

    if n != m:
        if n > m:
            g = dmp_zeros(n - m, v, K) + g
        else:
            f = dmp_zeros(m - n, v, K) + f

    result = []

    for a, b in zip(f, g):
        result.append(dmp_apply_pairs(a, b, h, args, v, K))

    return dmp_strip(result, u)
def dmp_apply_pairs ( f , g , h , args , u , K ) : if not u : return dup_apply_pairs ( f , g , h , args , K ) n , m , v = len ( f ) , len ( g ) , u - 1 if n != m : if n > m : g = dmp_zeros ( n - m , v , K ) + g else : f = dmp_zeros ( m - n , v , K ) + f result = [ ] for a , b in zip ( f , g ) : result . append ( dmp_apply_pairs ( a , b , h , args , v , K ) ) return dmp_strip ( result , u )