Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

scalarmin error for minimum/maximum of sparse matrix #6036

Closed
stevengj opened this Issue Mar 3, 2014 · 2 comments

Comments

Projects
None yet
3 participants
Owner

stevengj commented Mar 3, 2014

As mentioned on julia-users:

P = spzeros(Float64, 10, 10) 
for i = 1:10
        P[i,i] = i
end 
minimum(P) 

gives scalarmin not defined in minimum at sparse/sparsematrix.jl:638.

A simple fix would be to use Base.scalarmin here (and similarly for maximum), but I'm not sure why we can't just use min.

(The bug is in both 0.2.1 and in 0.3 master.)

@stevengj stevengj added the bug label Mar 3, 2014

@timholy timholy closed this in 40fdf3e Mar 4, 2014

Owner

timholy commented Mar 4, 2014

Not sure whether this should also be added to 0.2, or whether only critical fixes go there.

Re using min, presumably the reason is arrays-of-arrays:

julia> min([1 2; 3 4], [2 2; 2 2])
2x2 Array{Int64,2}:
 1  2
 2  2
Contributor

ivarne commented Mar 4, 2014

If we care about backporting anything, this kind of typo fixes should be the most obvious candidate. I would love to read the bug report when someone complains that that this behaviour change broke their code.

The question is just whether someone cares enough to spend the 15 minutes required to actually apply and test the fix.

@ivarne ivarne added a commit to ivarne/julia that referenced this issue Mar 4, 2014

@ivarne ivarne Backport fix #6036 2a9b53e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment