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

cg! sometimes returns NaNs #314

Closed
fredrikekre opened this issue Jun 22, 2022 · 0 comments
Closed

cg! sometimes returns NaNs #314

fredrikekre opened this issue Jun 22, 2022 · 0 comments

Comments

@fredrikekre
Copy link
Member

fredrikekre commented Jun 22, 2022

julia> A
2×2 Matrix{Float64}:
 2.0  1.5
 1.5  3.0

julia> x
2-element Vector{Float64}:
 0.0
 0.0

julia> y = similar(x)
2-element Vector{Float64}:
 5.0e-324
 0.0

julia> IterativeSolvers.cg!(y, A, x)
2-element Vector{Float64}:
 NaN
 NaN

It seems to happen when the allocated output vector contains garbage like above, but not if y = zeros(2) for example.
Edit: But maybe this is expected since x also doubles as the initial guess, not just a workspace vector. In particular, if x contains NaNs.

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

No branches or pull requests

1 participant