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

Update iterative_wrappers.jl #180

Merged
merged 5 commits into from
Aug 25, 2022
Merged

Update iterative_wrappers.jl #180

merged 5 commits into from
Aug 25, 2022

Conversation

vpuri3
Copy link
Member

@vpuri3 vpuri3 commented Aug 25, 2022

fix #140

@codecov
Copy link

codecov bot commented Aug 25, 2022

Codecov Report

Merging #180 (225870f) into main (7bf7c75) will decrease coverage by 0.09%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #180      +/-   ##
==========================================
- Coverage   65.03%   64.93%   -0.10%     
==========================================
  Files           9        9              
  Lines         652      656       +4     
==========================================
+ Hits          424      426       +2     
- Misses        228      230       +2     
Impacted Files Coverage Δ
src/iterative_wrappers.jl 69.39% <100.00%> (+0.68%) ⬆️
src/common.jl 82.00% <0.00%> (-2.00%) ⬇️
src/factorization.jl 81.59% <0.00%> (-0.50%) ⬇️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@ChrisRackauckas
Copy link
Member

format

@vpuri3
Copy link
Member Author

vpuri3 commented Aug 25, 2022

iterative solvers residual is in cacheval.residual.current

@vpuri3
Copy link
Member Author

vpuri3 commented Aug 25, 2022

Krylov.jl doesn't return residuals so im having it return nothing for now.

@vpuri3
Copy link
Member Author

vpuri3 commented Aug 25, 2022

@vpuri3
Copy link
Member Author

vpuri3 commented Aug 25, 2022

@ChrisRackauckas this is done

julia> using LinearSolve; A=rand(4,4); b=rand(4); sol=solve(LinearProblem(A,b),KrylovJL_GMRES()); sol.resid
3.897156366804788e-16

julia> using LinearSolve; A=rand(4,4); b=rand(4); sol=solve(LinearProblem(A,b),KrylovJL_CG()); sol.resid
4.187153282902027

julia> using LinearSolve; A=rand(4,4); b=rand(4); sol=solve(LinearProblem(A,b),IterativeSolversJL_CG()); sol.resid
22.84186078251024

julia> using LinearSolve; A=rand(4,4); b=rand(4); sol=solve(LinearProblem(A,b),IterativeSolversJL_GMRES()); sol.resid
8.070850399734874e-18

@ChrisRackauckas
Copy link
Member

Looks like that A isn't positive definite?

@ChrisRackauckas ChrisRackauckas merged commit bd0374f into SciML:main Aug 25, 2022
@vpuri3 vpuri3 deleted the patch-4 branch August 25, 2022 17:15
@vpuri3
Copy link
Member Author

vpuri3 commented Aug 25, 2022

^yes haha i was just making sure sol.resid is filled out.

@vpuri3
Copy link
Member Author

vpuri3 commented Aug 25, 2022

heres an SPD example on main

[vp@MBP LinearSolve]:git fetch
[vp@MBP LinearSolve]:git status
On branch main
Your branch is up to date with 'origin/main'.

nothing to commit, working tree clean
[vp@MBP LinearSolve]:jl
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.8.0 (2022-08-17)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

julia> using LinearSolve, LinearAlgebra; A=rand(4,4) + 100*I; b=rand(4); sol=solve(LinearProblem(A,b),IterativeSolversJL_GMRES()); sol.resid
5.186092731891276e-16

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.

sol.resid not returning the correct thing
2 participants