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

Fix type instability in setindex! for SparseMatrixCSCs #17343

Merged
merged 1 commit into from
Jul 9, 2016

Conversation

Sacha0
Copy link
Member

@Sacha0 Sacha0 commented Jul 8, 2016

Type instability occurs when calling setindex! on a SparseMatrixCSC{Tv,Ti} with indices-value triple (i,j,v) where typeof(i) != Ti || typeof(j) != Ti || typeof(v) != Tv. Best!

@tkelman
Copy link
Contributor

tkelman commented Jul 9, 2016

This could also be solved by not using the same name for both sides of lines that look like v = convert(T, v), right?

@timholy
Copy link
Sponsor Member

timholy commented Jul 9, 2016

Might be slightly better this way, though: many variants of the short wrapper can be compiled, all of which call a single variant (per array leaftype) of the "complicated" function. Less codegen this way.

@tkelman tkelman merged commit 2065920 into JuliaLang:master Jul 9, 2016
@tkelman
Copy link
Contributor

tkelman commented Jul 9, 2016

Good point. Sold.

@Sacha0 Sacha0 deleted the stablesetindex branch July 10, 2016 16:57
@Sacha0
Copy link
Member Author

Sacha0 commented Jul 10, 2016

Thanks for the review and merge!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants