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

Deletion of ACC not working #112

Open
blegat opened this issue Oct 20, 2022 · 1 comment
Open

Deletion of ACC not working #112

blegat opened this issue Oct 20, 2022 · 1 comment

Comments

@blegat
Copy link
Member

blegat commented Oct 20, 2022

I have commented it out since it does not work, it gives a MethodError

# Deleting a constraint block means clearing non-zeros from the its
# AFE rows and resetting the underlying ACC to an empty domain. We do
# not reclaim the AFEs.
# function MOI.delete(m::Optimizer,
# cref::MOI.ConstraintIndex{F,D}) where {F <: MOI.VectorAffineFunction{Float64},
# D <: VectorConeDomain}
# MOI.throw_if_not_valid(m, cref)
# putaccname(m.task,cref.value,"")
# afeidxs = getaccafeidxlist(m.task,cref.value)
# # clear afe non-zeros, but don't delete or reuse afe idx
# # FIXME gives a MethodError
# putafefrowlist(afeidxs,zeros(Int32,length(afeidxs)),zeros(Int64,length(afeidxs)),Int32[],Float64[])
# putaccdom(m.task,
# cref.value,
# 1, # the empty zero domain,
# Int64[],
# Float64[])
# end

# TODO remove `MOI.delete` once it is implemented for ACC
exclude=Any[MOI.ConstraintName, MOI.VariableBasisStatus, MOI.ConstraintBasisStatus, MOI.delete], # result in errors for now

cc @ulfworsoe

ulfworsoe added a commit to ulfworsoe/MosekTools.jl that referenced this issue Apr 13, 2023
@ulfworsoe ulfworsoe mentioned this issue Apr 13, 2023
@ulfworsoe
Copy link
Contributor

I think I have a fix for this issue, but it seems to introduce another one. A wild guess is that quadratic objectives are now reformulated into an vector affine expression, and something breaks. Any hints:

test_quadratic_duplicate_terms: Test Failed at /home/runner/.julia/packages/MathOptInterface/4g9vU/src/Test/test_quadratic.jl:235
  Expression: obj2 ≈ MOI.get(model, MOI.ObjectiveFunction{MOI.ScalarQuadraticFunction{T}}())
   Evaluated: 0.0 + 0.0 MOI.VariableIndex(1) + 0.0 MOI.VariableIndex(2) + 0.0 MOI.VariableIndex(3) - 2.0 MOI.VariableIndex(1)² - 1.0 MOI.VariableIndex(1)*MOI.VariableIndex(2) - 1.0 MOI.VariableIndex(1)*MOI.VariableIndex(2) - 2.0 MOI.VariableIndex(2)² - 2.0 MOI.VariableIndex(2)*MOI.VariableIndex(3) - 1.0 MOI.VariableIndex(3)² - 1.0 MOI.VariableIndex(3)² ≈ 0.0
Stacktrace:
 [1] test_quadratic_duplicate_terms(model::MathOptInterface.Bridges.LazyBridgeOptimizer{MosekTools.Optimizer}, config::MathOptInterface.Test.Config{Float64})
   @ MathOptInterface.Test ~/.julia/packages/MathOptInterface/4g9vU/src/Test/test_quadratic.jl:235
 [2] macro expansion
   @ ~/.julia/packages/MathOptInterface/4g9vU/src/Test/Test.jl:235 [inlined]
 [3] macro expansion
   @ /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/Test/src/Test.jl:1151 [inlined]
 [4] runtests(model::MathOptInterface.Bridges.LazyBridgeOptimizer{MosekTools.Optimizer}, config::MathOptInterface.Test.Config{Float64}; include::Vector{String}, exclude::Vector{String}, warn_unsupported::Bool, exclude_tests_after::VersionNumber)
   @ MathOptInterface.Test ~/.julia/packages/MathOptInterface/4g9vU/src/Test/Test.jl:230

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

2 participants