You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is inconsistent (I came across it while looking through Base to see if I can resolve #10385):
julia> V =view(rand(5,5), [1,3,4], :)
3×5view(::Array{Float64,2}, [1, 3, 4], :) with eltype Float64:0.686450.9067070.4740790.1563360.6891580.03666130.7059230.2864350.1694410.07889670.6022310.198180.8831980.7969780.416841
julia>isone(V)
ERROR:DimensionMismatch("multiplicative identity defined only for square matrices")
Stacktrace:
[1] _one at ./array.jl:393 [inlined]
[2] one at ./array.jl:397 [inlined]
[3] isone(::SubArray{Float64,2,Array{Float64,2},Tuple{Array{Int64,1},Base.Slice{Base.OneTo{Int64}}},false}) at ./number.jl:45
[4] top-level scope
julia>isone(rand(3,5))
false
A simple fix is to replace isone(A::StridedMatrix) definition with isone(A::AbstractMatrix).
(I don't see any reason why the definitions for isone were specialized to StridedMatrix.)
The text was updated successfully, but these errors were encountered:
I'm a first time contributor so I'm not entirely sure I've done this correctly. I opened up a pull request with the changes suggested by @dlfivefifty and I added a simple test. Do I need to take anymore action @sostock?
This is inconsistent (I came across it while looking through Base to see if I can resolve #10385):
A simple fix is to replace
isone(A::StridedMatrix)
definition withisone(A::AbstractMatrix)
.(I don't see any reason why the definitions for
isone
were specialized toStridedMatrix
.)The text was updated successfully, but these errors were encountered: