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

RFC: SparseVectors, Take 2 #13440

Merged
merged 5 commits into from
Oct 13, 2015
Merged

RFC: SparseVectors, Take 2 #13440

merged 5 commits into from
Oct 13, 2015

Commits on Oct 13, 2015

  1. Configuration menu
    Copy the full SHA
    9802263 View commit details
    Browse the repository at this point in the history
  2. Integrate SparseVectors.jl with Base sparse module

    Renamings:
    * Rename sparse module to SparseArrays, and improve its separation from base. This makes it very simple to dynamically reload the sparse module. Move docstrings to their proper place
    * _copy_convert → collect
    * Rename sparsevector to the existing spzeros and sparsevec.
    * Use call overloading instead of call
    
    Remove functionality from SparseVectors.jl:
    * Simplify and remove some functors
    * Remove SparseVectorView
    * Remove no-longer-needed ambiguity preventers
    
    Add functionality for SparseVectors:
    * Add similar for SparseVector
    * Allow sparsevec(::AbstractArray), not just vectors
    * Add spzeros(n); adapt some tests to SparseVector
    * Allow CHOLMOD linalg with vectors
    * Implement (c)transpose(::SparseVector). Returns a dense vector since a one-row CSC structure is effectively dense but with worse performance.
    * Add vector sprandbool and allow passing RNG to all vector sprand* functions. Harden tests against random failures.
    * Implement, test and doc spones(::SparseVector)
    
    Improve performance for SparseVector indexing:
    * Punt to SparseMatrix for some indexing behaviors. Since the datastructures are compatible and SparseMatrix's routines are more optimized, it is easiest to just construct a temporary SparseMatrix and index into that. This is faster in all but the smallest of cases (N<10)
    * Use searchsorted for indexing SparseVector by UnitRange. This is about 20% slower on very small vectors, but is faster in general.
    
    Change SparseMatrix behaviors to take advantage of vectors
    * Add indexing behaviors for SparseMatrix->SparseVector
    * `vec` and `sparsevec` for CSC return SparseVectors
    * Update documentation to incorporate vectors
    
    Minor bugfixes and changes to SparseVectors:
    * Compare to literal 0 in vector construction and setindex. This matches SparseMatrix semantics, and makes indexing semantics consistent with regard to stored zeros
    * Use checkbounds more thoroughly
    * Use error types that are consistent with SparseMatrixCSC
    * Minor sparse vector display tweaks. Turn on output limiting by default, remove unused variable `k`, implement and use Base.summary
    * Fix missing return, add test
    
    Add some tests:
    * Add a test and comment to ensure nobody else tries to share data between vectors and matrices
    * Ensure indexing is consistent between one-column sparse matrices and sparse vectors, with special attention to stored zeros.
    mbauman committed Oct 13, 2015
    Configuration menu
    Copy the full SHA
    b53644d View commit details
    Browse the repository at this point in the history
  3. Add SparseVector to NEWS.md

    mbauman committed Oct 13, 2015
    Configuration menu
    Copy the full SHA
    12fbcab View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    e316b60 View commit details
    Browse the repository at this point in the history
  5. Add missing imports

    mbauman committed Oct 13, 2015
    Configuration menu
    Copy the full SHA
    eb90416 View commit details
    Browse the repository at this point in the history