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

lmul!(0, A) should replace NaN with 0.0 #28972

Closed
dlfivefifty opened this issue Aug 30, 2018 · 2 comments
Closed

lmul!(0, A) should replace NaN with 0.0 #28972

dlfivefifty opened this issue Aug 30, 2018 · 2 comments
Labels
linear algebra Linear algebra

Comments

@dlfivefifty
Copy link
Contributor

Standard arrays have the feature that lmul!(0.0, A) replaces NaNs with 0.0, consistent with BLAS:

julia> lmul!(0.0,fill(NaN,3,3))
3×3 Array{Float64,2}:
 0.0  0.0  0.0
 0.0  0.0  0.0
 0.0  0.0  0.0

This is gone when generic_lmul! is called:

julia> lmul!(0,fill(NaN,3,3))
3×3 Array{Float64,2}:
 NaN  NaN  NaN
 NaN  NaN  NaN
 NaN  NaN  NaN

I'd propose fixing this inconsistency by making generic_lmul! follow the BLAS convention.

@raghav9-97
Copy link
Contributor

raghav9-97 commented Dec 7, 2018

I tried to reproduce the problem and got following results
julia> lmul!(0.0,fill(NaN,3,3))

 NaN  NaN  NaN
 NaN  NaN  NaN
 NaN  NaN  NaN
Julia Version 1.1.0-DEV.823
Commit c3b2bbb (2018-12-06 10:55 UTC)
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-6.0.1 (ORCJIT, skylake)

@dlfivefifty
Copy link
Contributor Author

Julia 1.1-pre has actually gone the other way and changed the behaviour for BLAS types. I think this issue can therefore be closed?

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

No branches or pull requests

3 participants