-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
array type hierarchy #987
Comments
While the topic is up for consideration: it also might be useful to be able to test whether an array is stored in-memory or is mmapped. There are times when the best algorithm will depend upon access patterns. I don't know whether this issue can be solved by the type hierarchy, though---seems like a multiple inheritance problem? |
I originally proposed On a related note: in #750 I also proposed to make Wouldn't it make sense to restrict |
The non-scalar indexing functions for SubArray are pretty generic, since they just transform indexes. We might have to use a Union of |
I see, you're definitely right of course. Speaking about Unions, it would probably be nice to have some common convention for those things, e.g. that used for DArrays seems nice (the only problem would be that |
Given that we have AbstractSparseMatrix, it seems to make sense to add AbstractDenseArray. A distributed array might manage (distribute) any kind of array, and so is neither inherently dense nor sparse. The type system is not able to express that a distributed array is dense iff its component arrays are. Note: not a breaking change, so not urgent. |
This would also help address #1276. |
related: JuliaLang/LinearAlgebra.jl#2 |
I'm not sure where to put this, but I want to call attention to some comments by Prof. Stephen Boyd regarding a system that would keep track of special structure of arrays. He suggests a name "disciplined linear algebra". https://www.youtube.com/watch?v=Ap8LGbCVx4I&t=49m50s
|
@jiahao, @alanedelman and I discussed this today. Our current thinking is:
Basically, A An The goals are
We found |
In the final round of conclave voting, On a more serious note, what we wanted was a way to unify the notions of Also, I wouldn't be sad to banish |
This is a problem where the decision would have profound impact to the future evolution of Julia. I read the proposal outlined by @JeffBezanson above carefully, and I am quite happy (actually excited) with that. |
I still have a question though. Where is sparse matrix going? I guess it is under |
We envisioned it to be a subtype of More generally, we thought that the hierarchies should reflect also the computational cost of indexing. For example, one could consider a matrix
|
Are you sure I think even figuring out whether an element is non-zero in a sparse matrix may require |
Not really. In @alanedelman's terms, we distinguish between cases where |
Maybe a better way to express the difference is to differentiate between things that behave like matrices and have matrix elements stored somewhere in memory, and things that behave like matrices but don't have explicitly stored values that correspond to matrix elements and have to be reconstructed by some kind of vector or matrix arithmetic. |
Our Sparse indexing is O(1) to find the column and binary search in the column for the row. |
Yes, the complexity issue is more of a guideline --- if I wonder where We might need finer distinctions within |
We also didn't discuss where |
I for one would love a world where I can type full( StoredArray( cumsum, 5)) or some such and obtain |
Does |
My previous note written before coffee had the right idea but the wrong details.. Would it make sense to create a linear operator out of Thus we get a linear operator by creating
and then one could type one could then make sense of
I think what I was missing until yesterday is that to me at the highest level of abstraction, I always Stencils would fit nicely here. |
Another family of arrays that need to be taken into account when designing such a hierarchy are those from remote machines/devices -- such arrays (e.g. DArray, Arrays on GPU, etc) are increasingly used in practice. For these arrays, their elements are probably stored somewhere (but not in the memory that CPU can directly access), so you are not expected to directly do |
Star-P went very far with this , but somehow one wishes this could be done without types. |
I think a |
The algorithmic pattern of looping over arrays using linear index consists of a very large part of the current code base (in both Base and packages). I think it is important to give such class of arrays a short and easy-to-remember name. In my opinion, |
We actually don't have a very good way to document abstract types. |
How about laying out the meaning of the types here? |
The reason for the switch to `AbstractVector` is to allow for generalization to DArray and SharedArray types.
…ng#6212, JuliaLang#987); UniformScaling is no longer an AbstractArray (JuliaLang#5810)
…ng#6212, JuliaLang#987); UniformScaling is no longer an AbstractArray (JuliaLang#5810)
…ling is no longer an AbstractArray (JuliaLang#5810)
…ling is no longer an AbstractArray (JuliaLang#5810)
…ling is no longer an AbstractArray (JuliaLang#5810)
…ling is no longer an AbstractArray (JuliaLang#5810)
We have discussed the need for more types above
Array
, e.g. in #750. Candidates includeDenseArray
,UniformDenseArray
,ContiguousArray
,UniformAccessArray
, etc.The text was updated successfully, but these errors were encountered: