Skip to content

Commit

Permalink
BUG: Fix bug with zero-assignment with nans, see #1263
Browse files Browse the repository at this point in the history
  • Loading branch information
adler-j committed Jan 21, 2018
1 parent 4d30821 commit 78fab76
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion odl/space/npy_tensors.py
Original file line number Diff line number Diff line change
Expand Up @@ -1856,7 +1856,10 @@ def fallback_copy(x1, x2, n):
_lincomb_impl(a + b, x1, 0, x1, out)
elif out is x1 and out is x2:
# All the vectors are aligned -> out = (a+b)*out
scal(a + b, out_arr, size)
if (a + b) != 0:
scal(a + b, out_arr, size)
else:
out_arr[:] = 0
elif out is x1:
# out is aligned with x1 -> out = a*out + b*x2
if a != 1:
Expand Down

0 comments on commit 78fab76

Please sign in to comment.