Skip to content

sparse matrix with non-Int64 index type slice assignment failure #30006

Closed
@dgenin

Description

@dgenin
julia> using SparseArrays

julia> a=SparseMatrixCSC{Float64, Int32}(spzeros(3,3))
3×3 SparseMatrixCSC{Float64,Int32} with 0 stored entries

julia> a[:,1]=[1,2,3]
ERROR: type Slice has no field stop
Stacktrace:
 [1] getproperty(::Any, ::Symbol) at ./sysimg.jl:18
 [2] getindex at ./range.jl:610 [inlined]
 [3] setindex!(::SparseMatrixCSC{Float64,Int32}, ::Array{Int64,1}, ::Colon, ::Int64) at /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/stdlib/v1.0/SparseArrays/src/sparsematrix.jl:2656
 [4] top-level scope at none:0

The same code with Int64 in place of Int32 succeeds

julia> a=SparseMatrixCSC{Float64, Int64}(spzeros(3,3))
3×3 SparseMatrixCSC{Float64,Int64} with 0 stored entries

julia> a[:,1]=[1,2,3]
3-element Array{Int64,1}:
 1
 2
 3

Metadata

Metadata

Assignees

No one assigned

    Labels

    arrays[a, r, r, a, y, s]sparseSparse arraysstdlibJulia's standard library

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions