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

[#179] Make compatible with IterativeSolvers v0.9+ #180

Merged
merged 2 commits into from
Jul 23, 2023

Conversation

migarstka
Copy link
Member

@migarstka migarstka commented Jul 23, 2023

  • Fix a breaking change in IterativeSolvers API
  • Add information to docs about which version of IterativeSolvers to use
  • Add version constraint to Project.toml

(as discussed in this issue)

MWE:

using COSMO, SparseArrays, LinearAlgebra, Test
using IterativeSolvers, LinearMaps

q = [1; 1.];
P = sparse([4. 1; 1 2]);
A = [1. 1; 1 0; 0 1];
l = [1.; 0; 0];
u = [1; 0.7; 0.7];


Aa = [-A; A]
ba = [u; -l]
constraint1 = COSMO.Constraint(Aa, ba, COSMO.Nonnegatives);

# use CGIndirectKKTSolver here
settings = COSMO.Settings(verbose=true, kkt_solver = CGIndirectKKTSolver)
model = COSMO.Model();
assemble!(model, P, q, constraint1, settings = settings);
res = COSMO.optimize!(model);


@testset "QP Problem" begin
  @test norm(res.x[1:2] - [0.3; 0.7], Inf) < 1e-3
  @test abs(res.obj_val - 1.88) < 1e-3
end
nothing

- Fix a breaking change in IterativeSolvers API
- Add information to docs about which version of IterativeSolvers to use
- Add version constraint to Project.toml
@migarstka migarstka force-pushed the mg/fix_iterative_solver_deps branch from 6cdb83a to ff6e8ee Compare July 23, 2023 11:49
@migarstka migarstka merged commit bad6be7 into master Jul 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant