Skip to content
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

Missing dataids methods #26865

Open
martinholters opened this issue Apr 20, 2018 · 1 comment
Open

Missing dataids methods #26865

martinholters opened this issue Apr 20, 2018 · 1 comment
Labels
arrays [a, r, r, a, y, s]

Comments

@martinholters
Copy link
Member

E.g.

julia> x = [1,2,3];

julia> Base.mightalias(x, Diagonal(x))
false

because

julia> Base.dataids(x)
(0x00007f108ac6bbd0,)

julia> Base.dataids(Diagonal(x))
(0xce028b6f0a997db2,)

We should either go through all AbstractArray subtypes and double-check whether the dataids fallback is the right thing to do or we could try to come up with a more elaborate, probably @generated fallback.

@mbauman mbauman added the arrays [a, r, r, a, y, s] label Apr 20, 2018
@mbauman
Copy link
Member

mbauman commented Apr 20, 2018

Yup, definitely missing a few here:

julia> methods(Base.dataids)
# 10 methods for generic function "dataids":
[1] dataids(A::Array) in Base at abstractarray.jl:1167
[2] dataids(::AbstractRange) in Base at abstractarray.jl:1168
[3] dataids(A::SubArray) in Base at subarray.jl:74
[4] dataids(a::Base.ReinterpretArray) in Base at reinterpretarray.jl:39
[5] dataids(A::Base.ReshapedArray) in Base at reshapedarray.jl:185
[6] dataids(A::Union{LinearAlgebra.Adjoint, LinearAlgebra.Transpose}) in LinearAlgebra at /home/mbauman/julia-wip1/usr/share/julia/site/v0.7/LinearAlgebra/src/adjtrans.jl:50
[7] dataids(S::SparseArrays.SparseMatrixCSC) in SparseArrays at /home/mbauman/julia-wip1/usr/share/julia/site/v0.7/SparseArrays/src/sparsematrix.jl:266
[8] dataids(S::SparseArrays.SparseVector) in SparseArrays at /home/mbauman/julia-wip1/usr/share/julia/site/v0.7/SparseArrays/src/sparsevector.jl:97
[9] dataids(A::AbstractArray) in Base at abstractarray.jl:1166
[10] dataids(x) in Base at abstractarray.jl:1169

julia> subtypes(AbstractArray)
32-element Array{Any,1}:
 AbstractRange
 Base.LogicalIndex
 Base.ReinterpretArray
 Base.ReshapedArray
 BitArray
 CartesianIndices
 Core.Compiler.AbstractRange
 Core.Compiler.BitArray
 Core.Compiler.SubArray
 DenseArray
 IterativeEigensolvers.AtA_or_AAt
 IterativeEigensolvers.SVDAugmented
 LinearAlgebra.AbstractQ
 LinearAlgebra.AbstractTriangular
 LinearAlgebra.Adjoint
 LinearAlgebra.Bidiagonal
 LinearAlgebra.ConjArray
 LinearAlgebra.Diagonal
 LinearAlgebra.Hermitian
 LinearAlgebra.HessenbergQ
 LinearAlgebra.LQPackedQ
 LinearAlgebra.RowVector
 LinearAlgebra.SymTridiagonal
 LinearAlgebra.Symmetric
 LinearAlgebra.Transpose
 LinearAlgebra.Tridiagonal
 LinearIndices
 PermutedDimsArray
 SparseArrays.AbstractSparseArray
 SubArray
 SuiteSparse.CHOLMOD.FactorComponent
 Test.GenericArray

(Plus the subtypes of DenseArray).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arrays [a, r, r, a, y, s]
Projects
None yet
Development

No branches or pull requests

2 participants