-
-
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
eliminate StoredArray #6258
eliminate StoredArray #6258
Conversation
Hmm, slight problem: our One option would be to make |
A easy way is to define |
Why doesn't |
Yes, I think it should work with |
I asked the same thing once, see this discussion. In a nutshell, the original argument was that rather then having general fallback algorithms (in particular for linear algebra) which would perform horribly on some array types (e.g. DArrays, SparseMatrixCSC), it was preferable to restrict the signature to those types where it was known that performance could be reasonable. This was one of the reasons for wanting some super-type incuding Arrays and BitArrays but not other array types whose element access time was not uniform, which led to the introduction of DenseArray. |
Under the new definition, It don't think it would be a problem to have fallback methods using permissive interface, as long as it still yields correct results. When efficient multiplication between certain types of matrices becomes needed, one can always add a specialized method. The same apply to many other functions: |
@lindahua, I agree that as long as the fallback has the expected complexity and is correct, there is no reason to restrict it to cases where the constant factor is bad. Subtypes are responsible for providing specialized methods where needed, if possible. It looks like |
Overall this is a good change but I don't find the word "regular" very evocative. |
I can always change it back to |
It's really just a StridedArray, no? But that's the currently a typealias to include dense SubArrays in a Union. Perhaps it should go back to DenseArray for now and then if/when ArrayViews lands, that level of the hierarchy can be removed since |
I restored the status of Since they don't define |
…ling is no longer an AbstractArray (JuliaLang#5810)
(Rebased.) |
Eventually we may also work with DArrays and sparse matrices, but as far as I know, we don't yet.
Eventually we may also work with DArrays and sparse matrices, but as far as I know, we don't yet.
Fixes #6212, #987; also,
UniformScaling
is no longer anAbstractArray
(#5810).Update: Changed to keep the name
DenseArray
, as there was no consensus forRegularArray
Also,BitArray
andSharedArray
are now subtypes ofAbstractArray
; they are notRegularArray
s since they don't implementstride
and don't have the requisite memory layout. (One of the main purposes of havingRegularArray
as a type is to know the memory layout ofPtr{T}
conversions, as otherwise it is impossible to safely do accall
.)