-
-
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
why do we have both full() and dense()? #4759
Comments
julia> methods(dense)
# 4 methods for generic function "dense":
dense{Tv}(S::SparseMatrixCSC{Tv,Ti<:Integer}) at sparse/sparsematrix.jl:165
dense(x::AbstractArray{T,N}) at abstractarray.jl:312
dense(A::CholmodSparse{Tv<:Union(Complex{Float64},Float32,Float64,Complex{Float32}),Ti<:Union(Int64,Int32)}) at linalg/cholmod.jl:1041
dense(A::CholmodDense{T<:Union(Complex{Float64},Float32,Float64,Complex{Float32})}) at linalg/cholmod.jl:1042 In all four methods, |
For what it's worth, I much prefer the name |
We need a good name too convert all the various diagonal matrix types to Matrix. |
We should certainly have just one. Let's do this in 0.3 |
As @ViralBShah mentions, |
I was thinking about using |
I'd prefer In DataFrames, we use |
|
Arguably a DataFrame isn't really a matrix from Julia's perspective. It's not even a subtype of |
The main reason I never really moved away from |
@johnmyleswhite Just to clarify, it makes sense to have a |
Ok. I think we're in agreement. My point is that I'd |
let's just plan to deprecate |
That's a shame. I know full is the standard term, but it's really vague and not a great word for this. Matrix is worse – anything you're applying this too should already be some kind of matrix. Dense is the only term that describes what this actually does, IMO, which is turn some non-dense matrix representation into your normal dense version. |
I think there is a critique of the naming scheme for matrices hidden here. |
Definitely. We started out with array, vector and matrix being abstract types and having DenseArray, etc. as the concrete types. But it turns out that you spend a lot more time writing code for the concrete types than abstract ones, so we made the concrete types the shorter names. I don't regret the decision as I think it's still the least confusing choice, but I agree that it's a bit of a disconnect. |
I’m not thrilled by the semantic of |
The ambiguity of the I guess all I’m really saying is that it’s really hard to construct a robust metaphor between the mathematical object known as a matrix and a convenient representation of it in memory in some suitable basis, and that any semantic that conflates mathematical density/sparsity and the compactness of a data structure could cause problems down the road. Even though in many cases it is fruitful to use representations of matrices that take advantage of sparsity patterns, the most useful representation of a matrix may be in forms where the sparsity is not explicit. |
Can't remember if this has come up before, but I noticed we have both of these functions. Are they different? Do we need both?
cc @ViralBShah
The text was updated successfully, but these errors were encountered: