(eq, param=symbols("t", integer=True))
Solves the diophantine equation ``eq``.

    Similar to ``diophantine()`` but doesn't try to factor ``eq`` as latter
    does. Uses ``classify_diop()`` to determine the type of the eqaution and
    calls the appropriate solver function.

    Usage
    =====

    ``diop_solve(eq, t)``: Solve diophantine equation, ``eq`` using ``t``
    as a parameter if needed.

    Details
    =======

    ``eq`` should be an expression which is assumed to be zero.
    ``t`` is a parameter to be used in the solution.

    Examples
    ========

    >>> from sympy.solvers.diophantine import diop_solve
    >>> from sympy.abc import x, y, z, w
    >>> diop_solve(2*x + 3*y - 5)
    (3*t - 5, -2*t + 5)
    >>> diop_solve(4*x + 3*y -4*z + 5)
    (3*t + 4*z - 5, -4*t - 4*z + 5,  z)
    >>> diop_solve(x + 3*y - 4*z + w -6)
    (t, -t - 3*y + 4*z + 6, y, z)
    >>> diop_solve(x**2 + y**2 - 5)
    set([(-2, -1), (-2, 1), (2, -1), (2, 1)])

    See Also
    ========

    diophantine()
Solves the diophantine equation ``eq``.
Solves the diophantine equation eq .
def diop_solve(eq, param=symbols("t", integer=True)):
    """
    Solves the diophantine equation ``eq``.

    Similar to ``diophantine()`` but doesn't try to factor ``eq`` as latter
    does. Uses ``classify_diop()`` to determine the type of the eqaution and
    calls the appropriate solver function.

    Usage
    =====

    ``diop_solve(eq, t)``: Solve diophantine equation, ``eq`` using ``t``
    as a parameter if needed.

    Details
    =======

    ``eq`` should be an expression which is assumed to be zero.
    ``t`` is a parameter to be used in the solution.

    Examples
    ========

    >>> from sympy.solvers.diophantine import diop_solve
    >>> from sympy.abc import x, y, z, w
    >>> diop_solve(2*x + 3*y - 5)
    (3*t - 5, -2*t + 5)
    >>> diop_solve(4*x + 3*y -4*z + 5)
    (3*t + 4*z - 5, -4*t - 4*z + 5,  z)
    >>> diop_solve(x + 3*y - 4*z + w -6)
    (t, -t - 3*y + 4*z + 6, y, z)
    >>> diop_solve(x**2 + y**2 - 5)
    set([(-2, -1), (-2, 1), (2, -1), (2, 1)])

    See Also
    ========

    diophantine()
    """
    var, coeff, eq_type = classify_diop(eq)

    if eq_type == "linear":
        return _diop_linear(var, coeff, param)

    elif eq_type == "binary_quadratic":
        return _diop_quadratic(var, coeff, param)

    elif eq_type == "homogeneous_ternary_quadratic":
        x_0, y_0, z_0 = _diop_ternary_quadratic(var, coeff)
        return _parametrize_ternary_quadratic((x_0, y_0, z_0), var, coeff)

    elif eq_type == "general_pythagorean":
        return _diop_general_pythagorean(var, coeff, param)

    elif eq_type == "univariate":
        l = solve(eq)
        s = set([])

        for soln in l:
            if isinstance(soln, Integer):
                s.add((soln,))
        return s

    elif eq_type == "general_sum_of_squares":
        return _diop_general_sum_of_squares(var, coeff)
def diop_solve ( eq , param = symbols ( "t" , integer = True ) ) : var , coeff , eq_type = classify_diop ( eq ) if eq_type == "linear" : return _diop_linear ( var , coeff , param ) elif eq_type == "binary_quadratic" : return _diop_quadratic ( var , coeff , param ) elif eq_type == "homogeneous_ternary_quadratic" : x_0 , y_0 , z_0 = _diop_ternary_quadratic ( var , coeff ) return _parametrize_ternary_quadratic ( ( x_0 , y_0 , z_0 ) , var , coeff ) elif eq_type == "general_pythagorean" : return _diop_general_pythagorean ( var , coeff , param ) elif eq_type == "univariate" : l = solve ( eq ) s = set ( [ ] ) for soln in l : if isinstance ( soln , Integer ) : s . add ( ( soln , ) ) return s elif eq_type == "general_sum_of_squares" : return _diop_general_sum_of_squares ( var , coeff )