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

cond fails for null dimensions #778

Open
andreasvarga opened this issue Nov 6, 2020 · 0 comments · May be fixed by #1169
Open

cond fails for null dimensions #778

andreasvarga opened this issue Nov 6, 2020 · 0 comments · May be fixed by #1169

Comments

@andreasvarga
Copy link
Contributor

The following command fails (the result should be probably 0, as in MATLAB):


cond(ones(0,0)) 

ERROR: ArgumentError: reducing over an empty collection is not allowed
Stacktrace:
 [1] _empty_reduce_error() at .\reduce.jl:299
 [2] reduce_empty(::Function, ::Type{Float64}) at .\reduce.jl:309
 [3] mapreduce_empty(::typeof(identity), ::Function, ::Type{T} where T) at .\reduce.jl:343
 [4] reduce_empty(::Base.MappingRF{typeof(identity),typeof(max)}, ::Type{Float64}) at .\reduce.jl:329
 [5] reduce_empty_iter at .\reduce.jl:355 [inlined]
 [6] mapreduce_empty_iter(::Function, ::Function, ::Array{Float64,1}, ::Base.HasEltype) at .\reduce.jl:351
 [7] _mapreduce(::typeof(identity), ::typeof(max), ::IndexLinear, ::Array{Float64,1}) at .\reduce.jl:400
 [8] _mapreduce_dim at .\reducedim.jl:318 [inlined]
 [9] #mapreduce#620 at .\reducedim.jl:310 [inlined]
 [10] mapreduce at .\reducedim.jl:310 [inlined]
 [11] _maximum at .\reducedim.jl:727 [inlined]
 [12] _maximum at .\reducedim.jl:726 [inlined]
 [13] #maximum#631 at .\reducedim.jl:722 [inlined]
 [14] maximum at .\reducedim.jl:722 [inlined]
 [15] cond(::Array{Float64,2}, ::Int64) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\LinearAlgebra\src\dense.jl:1431
 [16] cond(::Array{Float64,2}) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\LinearAlgebra\src\dense.jl:1429
 [17] top-level scope at REPL[11]:1
martinholters referenced this issue in JuliaLang/julia Nov 10, 2020
martinholters referenced this issue in JuliaLang/julia Nov 10, 2020
martinholters referenced this issue in JuliaLang/julia Nov 10, 2020
@KristofferC KristofferC transferred this issue from JuliaLang/julia Nov 26, 2024
martinholters added a commit that referenced this issue Jan 14, 2025
@martinholters martinholters linked a pull request Jan 14, 2025 that will close this issue
martinholters added a commit that referenced this issue Jan 21, 2025
Fixes #778.

Co-authored-by: Steven G. Johnson <stevenj@alum.mit.edu>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant