Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Method error (bridge related?) #252

Open
joaquimg opened this issue Dec 18, 2023 · 0 comments
Open

Method error (bridge related?) #252

joaquimg opened this issue Dec 18, 2023 · 0 comments

Comments

@joaquimg
Copy link
Member

Another error from jump-dev/ParametricOptInterface.jl#143

the code

function fallback_error()
    num_A = 2
    ##### SecondOrderCone #####
    x_hat = rand(num_A)
    μ = rand(num_A) * 10
    Σ_12 = rand(num_A, num_A)
    Σ = Σ_12 * Σ_12' + 0.1 * I
    γ = 1.0
    model = direct_model(DiffOpt.diff_optimizer(SCS.Optimizer))
    set_silent(model)
    @variable(model, x[1:num_A])
    @variable(model, norm_2)
    # (x - x_hat)^T Σ^-1 (x - x_hat) <= γ
    @constraint(
        model,
        (x - μ)' * inv(Σ) * (x - μ) <= γ,
    )
    # norm_2 >= ||x - x_hat||_2
    @constraint(model, ctr, [norm_2; x - x_hat] in SecondOrderCone())
    @objective(model, Min, norm_2)
    optimize!(model)
    MOI.set(model, DiffOpt.ForwardConstraintFunction(), ctr,
        MOI.VectorAffineFunction{Float64}(MOI.VectorOfVariables(x))
    )
    DiffOpt.forward_differentiate!(model) # ERROR
    return
end

the error:

ERROR: MethodError: no method matching throw_set_error_fallback(::MathOptInterface.Bridges.LazyBridgeOptimizer{DiffOpt.ConicProgram.Model}, ::DiffOpt.ObjectiveFunctionAttribute{DiffOpt.ObjectiveDualStart, MathOptInterface.VariableIndex}, ::MathOptInterface.Bridges.Objective.FunctionConversionBridge{Float64, MathOptInterface.ScalarAffineFunction{Float64}, MathOptInterface.VariableIndex}, ::Float64)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant