Skip to content

Missing method definitions for column views #699

@rasmushenningsson

Description

@rasmushenningsson

When using column views of sparse matrices, sparse_view*dense matrix multiplication works well, but sparse_view*sparse does not.
I suspect this is an oversight and that it would be easy to make it work. Is that right?
Here's an example.

julia> S = sparse(1:4, 1:4, 1:4)
4×4 SparseMatrixCSC{Int64, Int64} with 4 stored entries:
 1  ⋅  ⋅  ⋅
 ⋅  2  ⋅  ⋅
 ⋅  ⋅  3  ⋅
 ⋅  ⋅  ⋅  4

julia> Sv = @view S[:,1:2]
4×2 view(::SparseMatrixCSC{Int64, Int64}, :, 1:2) with eltype Int64:
 1  ⋅
 ⋅  2
 ⋅  ⋅
 ⋅  ⋅

julia> Sv*zeros(2)
4-element Vector{Float64}:
 0.0
 0.0
 0.0
 0.0

julia> Sv*spzeros(2)
ERROR: MethodError: no method matching indtype(::SubArray{Int64, 2, SparseMatrixCSC{Int64, Int64}, Tuple{Base.Slice{Base.OneTo{…}}, UnitRange{Int64}}, false})
The function `indtype` exists, but no method is defined for this combination of argument types.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions