1

I'd like to compare the efficiency of solvers, so I need to optimize the same matrices with different solvers. I wonder how can I set the boundary option of the solver COSMO to inf? It worked when I type just lb=[-inf, -inf, -inf]. Is there any way like that?

Here is my code

@time begin using COSMO, SparseArrays, LinearAlgebra using NPZ

Matrix10 =
npzread("C:/Users/skqkr/Desktop/Semesterarbeit/Chiwan_Q1.npz") 
q =Matrix10["p"]; 
P = sparse(Matrix10["Q"]);
A = sparse(Matrix10["G"]);
h= Matrix10["h"]; 
l = Matrix10["l"];
 
Aa = [-A; A] ba = [h;-l]  
constraint1 = COSMO.Constraint(Aa, ba, COSMO.Nonnegatives);
 
settings = COSMO.Settings(verbose=true); > model = COSMO.Model(); assemble!(model, P, q, constraint1, settings =settings); 
res = COSMO.optimize!(model);
 
 
constraint1 = COSMO.Constraint(A, zeros(3), COSMO.Box(-l,
h));
 
model = COSMO.Model(); assemble!(model, P, q, constraint1, settings =
settings); res_box = COSMO.optimize!(model);

I had to make a matrix l, in order to run the solver but is there another way to run the codes without defining a low boundary?

Adriaan
  • 17,741
  • 7
  • 42
  • 75

0 Answers0