-
Notifications
You must be signed in to change notification settings - Fork 62
Support generic arrays #706
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
Support generic arrays #706
Conversation
Co-authored-by: Dominique <[email protected]>
Co-authored-by: Dominique <[email protected]>
Co-authored-by: Dominique <[email protected]>
1c79f02
to
f00e46b
Compare
Because 0 is an integer, similar(S, 0) can't be used for some storage types that are not a subtype of a DenseVector. I must allocate all optional vectors required for warm-start, regularization or preconditioners in the Krylov workspaces. Thanks for the details. Isn't that strange the empty vector is not defined even for sparse arrays ? In the worst-case could you do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few more comments, and then looks good to me, thanks!
I don't understand your comment Tangi. 1 is also an integer like 0. The problem is not the value 0, I just want to create a vector that satisfy For the sparse arrays, I will add a check to insure that |
a346c40
to
aff18f8
Compare
Co-authored-by: tmigot <[email protected]>
Ok, I didn't understand the problem at first. Do you have an example that would not work? |
Yes, I do. using BlockArrays, Krylov
T = Float64
n = 10
x = BlockVector(rand(T,n), [n-2,2])
S = Krylov.ktypeof(x)
similar(S, 0) |
Well... that won't really help but you could create an issue on this package and on the packages where the empty vector is not defined. To me, it looks like a very natural property for any vector type, |
@amontoison sorry to revive old threads, can you explain why this was closed? |
@gdalle I added a It should handle many fancy array types. Documentation: https://jso.dev/Krylov.jl/dev/inplace/#Krylov.KrylovConstructor PS: Corner cases are LN / LS problems with array types that hardcode the length of the vector in the type. |
close #605