Skip to content

Commit

Permalink
Merge pull request #85 from oxfordcontrol/remove_eigen_moi
Browse files Browse the repository at this point in the history
Remove eigendecomposition of P in MOI wrapper
  • Loading branch information
migarstka authored Jul 9, 2019
2 parents ec1e48e + b267b1c commit 9761e29
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions src/MOIWrapper.jl
Original file line number Diff line number Diff line change
Expand Up @@ -134,19 +134,12 @@ MOI.is_empty(optimizer::Optimizer) = optimizer.is_empty
# MODEL --> SOLVER FORMAT FUNCTIONS
##############################

is_pos_semi_def(A::Number) = imag(A)==0 && real(A) >= 0
function is_pos_semi_def(A::AbstractMatrix)
!ishermitian(A) && return false
return minimum(eigvals(Matrix(A))) >= 0
end

function MOI.copy_to(dest::Optimizer, src::MOI.ModelLike; copy_names = false)
copy_names && error("Copying names is not supported.")
MOI.empty!(dest)
idxmap = MOIU.IndexMap(dest, src)
assign_constraint_row_ranges!(dest.rowranges, idxmap, src)
dest.sense, P, q, dest.objconstant = processobjective(src, idxmap)
!is_pos_semi_def(P) && @warn("Your MOI model does not result in a positive semidefinite objective value matrix P. Note that this violates COSMO's assumptions.")
A,b, constr_constant, convexSets = processconstraints(dest, src, idxmap, dest.rowranges)
convexSets = COSMO.merge_sets(convexSets)
COSMO.set!(dest.inner, P, q, A, b, convexSets, dest.inner.settings)
Expand Down

0 comments on commit 9761e29

Please sign in to comment.