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

Set MOI objective constant to CSDP #64

Merged
merged 1 commit into from
Jun 20, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions src/MOI_wrapper.jl
Original file line number Diff line number Diff line change
Expand Up @@ -301,8 +301,9 @@ function MOI.optimize!(optimizer::Optimizer)
end

optimizer.status, optimizer.pobj, optimizer.dobj = loaded_sdp(
optimizer.problem, Ref(optimizer.X), optimizer.y,
Ref(optimizer.Z), options)
optimizer.problem, optimizer.objsign * optimizer.objconstant,
Ref(optimizer.X), optimizer.y, Ref(optimizer.Z), options,
)
optimizer.solve_time = time() - start_time
end

Expand Down Expand Up @@ -372,11 +373,11 @@ end
MOI.get(m::Optimizer, ::MOI.ResultCount) = 1
function MOI.get(m::Optimizer, attr::MOI.ObjectiveValue)
MOI.check_result_index_bounds(m, attr)
return m.objsign * m.pobj + m.objconstant
return m.objsign * m.pobj
end
function MOI.get(m::Optimizer, attr::MOI.DualObjectiveValue)
MOI.check_result_index_bounds(m, attr)
return m.objsign * m.dobj + m.objconstant
return m.objsign * m.dobj
end
struct PrimalSolutionMatrix <: MOI.AbstractModelAttribute end
MOI.is_set_by_optimize(::PrimalSolutionMatrix) = true
Expand Down