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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a KrylovSolver for each method #271

Merged
merged 4 commits into from
May 10, 2021

Conversation

amontoison
Copy link
Member

@amontoison amontoison commented Mar 16, 2021

#264
@geoffroyleconte After #269 I will rebase this PR and we could easily add in-place method for all krylov solvers 馃殌

For all solver, the syntax is the same and we will be able to do

KnameSolver(A, b)
kname!(solver, A, b)

instead of

kname(A, b)

and reuse the storage, which is quite user-friendly.

@codecov
Copy link

codecov bot commented Mar 16, 2021

Codecov Report

Merging #271 (38e56c5) into master (ac55536) will increase coverage by 0.49%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #271      +/-   ##
==========================================
+ Coverage   95.73%   96.22%   +0.49%     
==========================================
  Files          33       33              
  Lines        3516     3974     +458     
==========================================
+ Hits         3366     3824     +458     
  Misses        150      150              
Impacted Files Coverage 螖
src/variants.jl 75.00% <酶> (-5.77%) 猬囷笍
src/bicgstab.jl 100.00% <100.00%> (酶)
src/bilq.jl 100.00% <100.00%> (酶)
src/bilqr.jl 100.00% <100.00%> (酶)
src/cg.jl 100.00% <100.00%> (酶)
src/cg_lanczos.jl 98.06% <100.00%> (+0.23%) 猬嗭笍
src/cgls.jl 100.00% <100.00%> (酶)
src/cgne.jl 100.00% <100.00%> (酶)
src/cgs.jl 100.00% <100.00%> (酶)
src/cr.jl 64.19% <100.00%> (+1.53%) 猬嗭笍
... and 23 more

Continue to review full report at Codecov.

Legend - Click here to learn more
螖 = absolute <relative> (impact), 酶 = not affected, ? = missing data
Powered by Codecov. Last update ac55536...38e56c5. Read the comment docs.

@amontoison
Copy link
Member Author

Some benchmarks are needed to see if struct is not more relevant than mutable struct.

@dpo
Copy link
Member

dpo commented Apr 6, 2021

Before launching ahead, we should coordinate with @abelsiqueira and JuliaSmoothOptimizers/SolverCore.jl#6, where he鈥檚 proposing an AbstractSolver struct that we should be able to import here as a base solver.

@github-actions
Copy link
Contributor

Package name latest stable
CaNNOLeS.jl
DCI.jl
JSOSolvers.jl
Percival.jl

@amontoison
Copy link
Member Author

amontoison commented Apr 16, 2021

@github-actions
Copy link
Contributor

Package name latest stable
CaNNOLeS.jl
DCI.jl
JSOSolvers.jl
Percival.jl

@github-actions
Copy link
Contributor

github-actions bot commented May 6, 2021

Package name latest stable
CaNNOLeS.jl
DCI.jl
JSOSolvers.jl
Percival.jl

@github-actions
Copy link
Contributor

github-actions bot commented May 6, 2021

Package name latest stable
CaNNOLeS.jl
DCI.jl
JSOSolvers.jl
Percival.jl

@amontoison
Copy link
Member Author

@tmigot, @dpo, @geoffroyleconte
The PR is ready to be review, don't be afraid of the number of modifications.

Note : I defined a new function called ktypeof that returned the type of a vector v if it's dense or a dense storage type if it's sparse (SparseVector / CuSparseVector) or a SubArray (#290). With this new function we don't need to convert the rhs b (or c) anymore and it removes some variants in src/variants.jl.

@geoffroyleconte
Copy link
Member

Thank you for all these changes! Maybe you could add the stats to the Solver type in order to remove more allocations, like it was done with MINRES?

@amontoison
Copy link
Member Author

Thank you for all these changes! Maybe you could add the stats to the Solver type in order to remove more allocations, like it was done with MINRES?

I would like to use a generic KrylovStats for all Krylov methods before and avoid to modify all files 2 times.

@github-actions
Copy link
Contributor

Package name latest stable
CaNNOLeS.jl
DCI.jl
JSOSolvers.jl
Percival.jl

@github-actions
Copy link
Contributor

Package name latest stable
CaNNOLeS.jl
DCI.jl
JSOSolvers.jl
Percival.jl

@github-actions
Copy link
Contributor

Package name latest stable
CaNNOLeS.jl
DCI.jl
JSOSolvers.jl
Percival.jl

@amontoison amontoison merged commit d8c8a5e into JuliaSmoothOptimizers:master May 10, 2021
@amontoison amontoison mentioned this pull request May 10, 2021
29 tasks
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.

None yet

3 participants