@dpo : this is right : my constraints are linear and my objective function is quadratic.
Here is the minimal working example
using LinearAlgebra
using JuMP
using COSMO
X=[1 1; 1 2; 2 2 ];
y=[+1 -1 -1 ];
n=length(y);
p=size(X,2);
G=X*X';
model = Model(with_optimizer(COSMO.Optimizer))
@variables model begin
alpha[i=1:length(y)]
end
@NLobjective(model, Min, sum(0.5*alpha[k]*G[k,i]*y[k]*y[i]*alpha[i] -alpha[k] for i=1:n for k=1:n))
@constraint(model, sum( y[i] * alpha[i] for i=1:n ) == 0)
@constraint(model, [i=1:n], -alpha[i]<=0)
optimize!(model);
alpha_opt = value.(alpha);
And here is the output I get :
julia> optimize!(model);
COSMO v0.5.0 - A Quadratic Objective Conic Solver
Michael Garstka
University of Oxford, 2017 - 2019
Problem: x ∈ R^{3},
constraints: A ∈ R^{4x3} (6 nnz),
matrix size to factor: 7x7 (19 nnz)
Sets: Nonnegatives of dim: 3
ZeroSet of dim: 1
Settings: ϵ_abs = 1.0e-04, ϵ_rel = 1.0e-04,
ϵ_prim_inf = 1.0e-06, ϵ_dual_inf = 1.0e-04,
ρ = 0.1, σ = 1.0e-6, α = 1.6,
max_iter = 2500,
scaling iter = 10 (on),
check termination every 40 iter,
check infeasibility every 40 iter,
KKT system solver: QDLDL
Setup Time: 1967.41ms
Iter: Objective: Primal Res: Dual Res: Rho:
40 0.0000e+00 0.0000e+00 0.0000e+00 1.0000e-01
Results
Status: Solved
Iterations: 40
Optimal objective: 0.0
Runtime: 2.754s (2754.23ms)
julia> alpha_opt = value.(alpha)
3-element Array{Float64,1}:
0.0
0.0
0.0
I was expecting julia to give me this solution : [2 ,2 ,0].