scipopt / SCIP.jl

Julia interface to SCIP solver
MIT License
95 stars 24 forks source link

SCIP solver -- issue in "quadratic_constraints.jl". #280

Open ahslim opened 11 months ago

ahslim commented 11 months ago

So, in the SCIP package, there seems to be an issue in this file "quadratic_constraints.jl". Particularly, lines 190-192 in the below function. The SCIP solver generates a solution, but it outputs the below shown error. So, if I comment this error, the code works normally as expected. Do you think there should be something done in this regards?

function MOI.get(
    o::Optimizer,
    ::MOI.ConstraintPrimal,
    ci::CI{SQF,S},
) where {S<:BOUNDS}
    _throw_if_invalid(o, ci)
    c = cons(o, ci)
    expr_ref = SCIPgetExprNonlinear(c)
    isq = Ref{UInt32}(100)
    @SCIP_CALL LibSCIP.SCIPcheckExprQuadratic(o, expr_ref, isq)
    if isq[] != 1
        # error(
        #     "Constraint index $ci pointing to a non-quadratic expression $expr_ref",
        # )
    end
    sol = SCIPgetBestSol(o)
    @SCIP_CALL SCIPevalExpr(o, expr_ref, sol, Clonglong(0))
    return SCIPexprGetEvalValue(expr_ref)
end
matbesancon commented 11 months ago

Thanks for bringing this to our attention. Do you have a working example to reproduce this error? It seems that SCIP is not seeing this constraint as quadratic

matbesancon commented 11 months ago

bump here