Skip to content

Method error (bridge related?) #252

Closed
@joaquimg

Description

@joaquimg

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([norm_2, x[1], x[2]]))
    )
    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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions