-
-
Notifications
You must be signed in to change notification settings - Fork 5
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
Factorization is not a subtype of AbstractArray #2
Comments
Ah, it's just due to the |
We should probably define a Cc: @dmbates |
Could you submit a pull request? |
I'm actually not sure whether a factorization is an array. Does it have elements you can access by indexing? AbstractArray functions assume that. |
Yes, you can do so with dense factorizations, and possibly even sparse factorizations if you try very hard. Factorizations would only meaningfully support a part of the Matrix behaviour. |
The other alternative would be to modify the routines in |
I'm sure it's possible, but is that how they're meant to be used? Often a better solution is just to remove the type restriction rather than make something an AbstractArray just so you can call the function you want. |
I think creating a |
No. A factorization is a a concept, not a representation, a point which is clearest when you realize that the factorization of different matrix types will have different representations. Moreover, take an example like LU decomposition. While a dense matrix's LU decomposition might be stored as a single chunk of memory of the same size as the matrix, it's actually representing both the L and U factors. I wouldn't know how I guess they're of type AbstractAbstractArray :-). |
Would it be fair to say that a |
Yes, I think that's the true meaning. @ViralBShah , I agree that |
I guess I didn't quite understand the definition of
So does this mean that all operations ( On a related note, perhaps |
If you want to do Array-style operations on a Factorization, then explicitly converting it to an Array first might be a good interface, since this has a cost and isn't a normal use of Factorizations. There is also an issue open about the array type hierarchy in general, which needs work. We might need abstract types both more general and more specific than AbstractArray. |
The |
Okay, that makes sense.
I think that might be the best approach. So as to avoid
|
|
True, meta is not quite right: quasi would be the more suitable latin prefix. |
I like @toivoh's |
Yes, that's a good name too. It would be nice to see if we can figure out some other things that are in the class that are neither factorizations nor matrices. This is verging on the need for multiple inheritance since matrices are linear operators but tensors generally aren't. |
|
Are stencils really linear operators in the mathematical sense? |
@simonbyrne Does the Woodbury issue still exist? Otherwise, we have really not had issues with |
The direct issue seems resolved, so I'll close this issue, but there is still the larger issue of where linear operators fit in the type hierarchy. |
Yes the larger issue still remains. |
This means that I can't use a
CholeskyDense
orLUDense
as the invertible matrix inside theWoodbury
class.However, changing the line in
base/linalg_dense.jl
:to
causes:
The text was updated successfully, but these errors were encountered: