Skip to content

Conversation

@matbesancon
Copy link
Collaborator

No description provided.

@codecov
Copy link

codecov bot commented Feb 11, 2023

Codecov Report

Base: 85.79% // Head: 86.34% // Increases project coverage by +0.54% 🎉

Coverage data is based on head (edad226) compared to base (47f06f0).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #229      +/-   ##
==========================================
+ Coverage   85.79%   86.34%   +0.54%     
==========================================
  Files          11       11              
  Lines         880      908      +28     
==========================================
+ Hits          755      784      +29     
+ Misses        125      124       -1     
Impacted Files Coverage Δ
src/QuadraticProgram/QuadraticProgram.jl 97.97% <100.00%> (+0.85%) ⬆️
src/utils.jl 100.00% <0.00%> (ø)
src/diff_opt.jl 100.00% <0.00%> (ø)
src/product_of_sets.jl 100.00% <0.00%> (ø)
src/ConicProgram/ConicProgram.jl 94.16% <0.00%> (+0.04%) ⬆️
src/moi_wrapper.jl 84.94% <0.00%> (+0.47%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.


import DiffOpt
import LinearSolve
const LS = LinearSolve
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's not introduce LS if we use it only 3 times, it just decreases readability IMO


Q = view(LHS, 1:nv, 1:nv)
partial_grads = if norm(Q) 0
-IterativeSolvers.lsqr(LHS', RHS)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@frapac
Copy link

frapac commented Feb 13, 2023

As a user of DiffOpt, I confess I am not sure it's a good idea to integrate LinearSolve.jl (compared to, let's say, ldiv!). My main concern is the number of dependencies that come with LinearSolve.jl:
https://github.com/SciML/LinearSolve.jl/blob/f2185983cfd4b25703c498975eb0174174bcc9e5/Project.toml

@matbesancon
Copy link
Collaborator Author

that's a fair point, we could readjust the design to just have an abstract attribute on top of which people can choose what solver to take

@odow
Copy link
Member

odow commented Feb 13, 2023

Yes, 126 dependencies seems like a lot... https://juliahub.com/ui/Packages/LinearSolve/WR6RC/1.35.0?page=1

@matbesancon matbesancon changed the title add LinearSolve instead of \ Abstract linear solving method instead of \ Feb 13, 2023
@matbesancon
Copy link
Collaborator Author

following the discussion, I changed the design to offer an abstract interface, people can change the linear system solve without requiring LinearSolve, since we do not batch, use cache or anything

@blegat
Copy link
Member

blegat commented Feb 14, 2023

Looks good, will be useful for the rank-1 example. Could you add a test for setting and getting the attribute ?

@matbesancon
Copy link
Collaborator Author

just did, should be good once CI passes

@matbesancon
Copy link
Collaborator Author

I also added an iterative argument, which the linear solver decides to handle (the default boils down to lsqr or \)

@test MOI.get(model, DiffOpt.QuadraticProgram.LinearAlgebraSolver()) === nothing
MOI.set(model, DiffOpt.QuadraticProgram.LinearAlgebraSolver(), TestSolver())
@test MOI.get(model, DiffOpt.QuadraticProgram.LinearAlgebraSolver()) !== nothing
MOI.empty!(model)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it is an optimizer attribute, it should not be reset by MOI.empty!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@matbesancon matbesancon requested a review from blegat February 14, 2023 13:26
@matbesancon matbesancon merged commit e0fc7af into master Feb 14, 2023
@matbesancon matbesancon deleted the add-linsolve branch February 14, 2023 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

5 participants