You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You are right, I fixed it in this commit 8d0f108: (will be part of new releave v0.8.6):
If you checkout the commit or the master branch, the following script should work:
(Notice you need to load Pardiso using Pardiso independently.
using Pardiso, COSMO, JuMP, LinearAlgebra, SparseArrays, Test, Random
rng = Random.MersenneTwister(12345);
## create a random test matrix C
n =8;
C =-1.+rand(rng, n, n) .*2;
c =vec(C);
# Define problem in `JuMP`:
q =-vec(C);
r =0.5*vec(C)'*vec(C);
m = JuMP.Model(optimizer_with_attributes(COSMO.Optimizer, "verbose"=>true, "kkt_solver"=> MKLPardisoKKTSolver));
@variable(m, X[1:n, 1:n], PSD);
x =vec(X);
@objective(m, Min, 0.5* x'* x + q'* x + r);
for i =1:n
@constraint(m, X[i, i] ==1.);
end# Solve the `JuMP` model with `COSMO` and query the solution `X_sol`:
status = JuMP.optimize!(m);
obj_val = JuMP.objective_value(m);
X_sol = JuMP.value.(X);
You are right, I fixed it in this commit 8d0f108: (will be part of new releave v0.8.6): If you checkout the commit or the master branch, the following script should work:
(Notice you need to load Pardiso using Pardiso independently.
using Pardiso, COSMO, JuMP, LinearAlgebra, SparseArrays, Test, Random
rng = Random.MersenneTwister(12345);
## create a random test matrix C
n =8;
C =-1.+rand(rng, n, n) .*2;
c =vec(C);
# Define problem in `JuMP`:
q =-vec(C);
r =0.5*vec(C)'*vec(C);
m = JuMP.Model(optimizer_with_attributes(COSMO.Optimizer, "verbose"=>true, "kkt_solver"=> MKLPardisoKKTSolver));
@variable(m, X[1:n, 1:n], PSD);
x =vec(X);
@objective(m, Min, 0.5* x'* x + q'* x + r);
for i =1:n
@constraint(m, X[i, i] ==1.);
end# Solve the `JuMP` model with `COSMO` and query the solution `X_sol`:
status = JuMP.optimize!(m);
obj_val = JuMP.objective_value(m);
X_sol = JuMP.value.(X);
That works fine for me, think you can close the issue.
I am trying to use MKLPardisoKKTSolver in JuMP
model = JuMP.Model(optimizer_with_attributes(COSMO.Optimizer, "kkt_solver" => with_options(PardisoDirectKKTSolver, msg_level_on = true));
and getting the error message UndefVarError: MKLPardisoKKTSolver not defined
I think the problem is with this file:
COSMO.jl/src/linear_solver/kktsolver_pardiso.jl
Line 3 in 8689f76
MKLPardisoKKTSolver rather than MKLPardisoSolver should be exported to namespace.
Thanks,
The text was updated successfully, but these errors were encountered: