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

Introduce AbstractSparseArray #6213

Closed
lindahua opened this issue Mar 19, 2014 · 3 comments
Closed

Introduce AbstractSparseArray #6213

lindahua opened this issue Mar 19, 2014 · 3 comments
Labels
sparse Sparse arrays

Comments

@lindahua
Copy link
Contributor

Sparse representation is also useful for arrays of other ranks (e.g. sparse vector or higher dimensional sparse arrays).

My proposal is to

abstract AbstractSparseArray{Tv, Ti<:Integer, N} <: StoredArray{Tv, N}

typealias AbstractSparseVector{Tv, Ti<:Integer} AbstractSparseArray{Tv, Ti, 1}
typealias AbstractSparseMatrix{Tv, Ti<:Integer} AbstractSparseArray{Tv, Ti, 2}

This does't break any existing codes. But it allows future generalization of sparse representation to generic arrays, and allows packages to explore such.

@lindahua
Copy link
Contributor Author

In some of my applications, sparse vectors can be useful (e.g. representing a word histogram of a document based on a large vocabulary).

@jiahao
Copy link
Member

jiahao commented Mar 19, 2014

I think we may need this anyway if we want to do implement something like CSR matrices as suggested in #5932.

@stevengj
Copy link
Member

@jiahao, we already have AbstractSparseMatrix. It makes conceptual sense to me to generalize this to AbstractSparseArray, however, since you want to include sparse multilinear operators etc, and it parallels AbstractArray/AbstractMatrix etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sparse Sparse arrays
Projects
None yet
Development

No branches or pull requests

4 participants