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 tests on Julia 1.4: narrow element type of vv vector to fix test error on Julia 1.4 #59

Merged
merged 1 commit into from
Apr 26, 2020

Conversation

KristofferC
Copy link
Contributor

@KristofferC KristofferC commented Jan 15, 2020

While testing packages for the upcoming Julia 1.4 we found that this package tests errored. The reason boils down to the following difference:

julia> using SparseArrays

julia> a = convert(SparseMatrixCSC{AbstractFloat, Int}, sparse(rand(Float32, 2,2)));

julia> b = sparse(rand(Float32, 2,2));

julia> typeof(a*b)
SparseMatrixCSC{Any,Int64}

In 1.3, the resulting type was a SparseMatrixCSC{AbstractFloat,Int64}.

This PR fixes the test error by "narrowing" the element type of vv (so if it only contains e.g. Float32s, vv will become a Vector{Float32} instead of a Vector{AbstractFloat}).

Disregarding the change in 1.4, this is likely to be better since it will give a concrete element type to the sparse matrix in most cases which will make future operations with it more efficient.

@reworkhow
Copy link
Owner

Thanks very much for the update.

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.

2 participants