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

Incorrect element type from specialized sparse unary broadcast methods #18974

Closed
Sacha0 opened this issue Oct 16, 2016 · 0 comments · Fixed by #19065
Closed

Incorrect element type from specialized sparse unary broadcast methods #18974

Sacha0 opened this issue Oct 16, 2016 · 0 comments · Fixed by #19065
Labels
sparse Sparse arrays

Comments

@Sacha0
Copy link
Member

Sacha0 commented Oct 16, 2016

The broadcast methods specialized for unary operations over SparseMatrixCSCs assume that the input matrix's element type is appropriate for the returned matrix (e.g. here). This assumption causes, for example,

julia> VERSION
v"0.6.0-dev.979"

julia> sin.(speye(Int, 4))
ERROR: InexactError()
 in convert(::Type{Int64}, ::Float64) at ./float.jl:637
 in _broadcast_unary_nz2z_z2z_T(::Base.#sin, ::SparseMatrixCSC{Int64,Int64}, ::Type{Int64}) at ./sparse/sparsematrix.jl:1425
 in broadcast(::Base.#sin, ::SparseMatrixCSC{Int64,Int64}) at ./sparse/sparsematrix.jl:1403

Best!

@Sacha0 Sacha0 added the sparse Sparse arrays label Oct 16, 2016
Sacha0 added a commit to Sacha0/julia that referenced this issue Nov 26, 2016
…ver a sparse matrix) from closed PR JuliaLang#18975 that was missed in PR JuliaLang#19065.
Sacha0 added a commit to Sacha0/julia that referenced this issue Nov 27, 2016
…ver a sparse matrix) from closed PR JuliaLang#18975 that was missed in PR JuliaLang#19065.
Sacha0 added a commit to Sacha0/julia that referenced this issue Dec 1, 2016
…ver a sparse matrix) from closed PR JuliaLang#18975 that was missed in PR JuliaLang#19065.
Sacha0 added a commit that referenced this issue Dec 2, 2016
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

Successfully merging a pull request may close this issue.

1 participant