octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #63281] bsxfun fails to preserve sparse output


From: Nicholas Jankowski
Subject: [Octave-bug-tracker] [bug #63281] bsxfun fails to preserve sparse output for some functions
Date: Thu, 27 Oct 2022 14:27:02 -0400 (EDT)

Follow-up Comment #2, bug #63281 (project octave):

ok, was trying to creates minimal tests. changing a couple to require
broadcasting:

plus:

>> bsxfun(@plus, sparse([0 1 0; 1 0 1]), sparse([1 0 1]))
ans =
   1   1   1
   2   0   2

bsxfun(@and, sparse([0 1 0; 1 0 1]), sparse([1 0 1]))
ans =
Compressed Column Sparse (rows = 2, cols = 3, nnz = 2 [33%])

  (2, 1) -> 1
  (2, 3) -> 1

>> bsxfun(@(x,y) x+y, sparse([0 1 0; 1 0 1]), sparse([1 0 1]))
ans =
Compressed Column Sparse (rows = 2, cols = 3, nnz = 5 [83%])

  (1, 1) -> 1
  (2, 1) -> 2
  (1, 2) -> 1
  (1, 3) -> 1
  (2, 3) -> 2



    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?63281>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]