JuliaLang/julia — pull request #7029 by tanmaykm (2014-05-29 12:19:02+00:00)
Title: WIP: Sparse CSR Matrices

This would introduce Sparse CSR matrix data type.

- `SparseMatrixCSC` and `SparseMatrixCSR` implement `CompressedSparseMatrix`
- `CompressedSparseMatrix` is `AbstractSparseMatrix` and parameterized with a `CompressedSparseType` (`CSC` or `CSR`)
- made the existing CSC matrix methods generic wherever possible to be used on `CompressedSparseMatrix` by working on the abstraction of compressed and uncompressed dimension.

All the linalg methods and a few matrix methods are yet to be implemented for CSR. This does not break any existing APIs. In brief, the API changes are:

- There is a `SparseMatrixCSR` constructor, similar to the one for CSC.
- The `sparse` constructor can now optionally take `CSR` or `CSC` as the first parameter.
- The `sparse` constructor now has a variant that takes a sparse store (`CompressedSparseStore` or a `TripletSparseStore`) specifying the data. This seemed to be a good uniform way to overload the `sparse` constructor for different data formats.
- Methods like `spzeros`, `sprand` take a keyword argument `format` that can either be `CSC` (default) or `CSR`.

Would appreciate feedbacks and whether this is in the right direction.