-
Notifications
You must be signed in to change notification settings - Fork 55
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
ComponentArrays support #769
Comments
The issue of component array is that we don't have a constructor for |
I just tried the same fix as for StaticArrays and it seems to work julia> Krylov.ktypeof(b::ComponentVector{T,V}) where {T,V} = V
julia> gmres(A, b)
([0.9825279457773434, 0.016769695792115402], SimpleStats
niter: 2
solved: true
inconsistent: false
residuals: []
Aresiduals: []
κ₂(A): []
timer: 9.33μs
status: solution good enough given atol and rtol
) Gonna add it to #767 |
Done! Hope this is convincing enough to merge it ;) |
Actually this wasn't closed by #768 because, to my great surprise, A problem we wouldn't have had with the extensions 😉 But at least it's not blocking my release |
See also #701 |
@gdalle With the release 0.9.9, I added a new constructor for all Krylov workspaces. using Krylov
using ComponentArrays
# Specify that we also want some ComponentVector
# in the workspaces.
Krylov.ktypeof(v::ComponentArray) = typeof(v)
A = rand(2, 2)
b = ComponentVector(b1=rand(), b2=rand())
kc = KrylovConstructor(b)
solver = GmresSolver(kc)
gmres!(solver, A, b, verbose=1)
x = solution(solver) I don't know what the most efficient vector type in the Krylov workspaces for your package but you have more flexibility now. |
Similar to #766
The text was updated successfully, but these errors were encountered: