bugGNU Octave - Bugs: bug #40089, bsxfun fails with logical...


bug #40089: bsxfun fails with logical operation on sparse matrices

Submitted by:  David Spies <dspyz>
Submitted on:  Sun 22 Sep 2013 10:40:25 PM UTC  
Category: Octave FunctionSeverity: 2 - Minor
Priority: 5 - NormalItem Group: Incorrect Result
Status: FixedAssigned to: None
Originator Name: dspyzOpen/Closed: Closed
Release: devOperating System: GNU/Linux

Add a New Comment(Rich Markup)

You are not logged in

Please log in, so followups can be emailed to you.


Mon 29 Feb 2016 02:27:26 AM UTC, comment #3:

I applied Lachlan's patch here (http://hg.savannah.gnu.org/hgweb/octave/rev/a1aa52bff079). Closing report.

Rik <rik5>
Project Administrator
Sat 16 Jan 2016 09:54:19 AM UTC, comment #2:

The trivial patch for bug #45219 also fixes this problem. I'm attaching a changeset.

(file #36056)

Lachlan Andrew <lachlan>
Project Member
Thu 26 Sep 2013 05:09:57 PM UTC, comment #1:

Confirmed. As a workaround, if you convert both inputs to logical type, then bsxfun works.

This isn't that bad because cliques will still stay as a sparse bool matrix. v is small enough that there probably isn't much point in converting it to a sparse matrix but you could also do "sparse (logical (v))" and bsxfun will still work.

Rik <rik5>
Project Administrator
Sun 22 Sep 2013 10:40:25 PM UTC, original submission:

When attempting to use bsxfun to @and a matrix with a vector

cliques = sparse([1,1,2,2],[1,2,2,3],[1,1,1,1],2,5)
v = [1,0,1,0,1]


I get

error: concatenation operator not implemented for '<unknown type>' by 'sparse matrix' operations

David Spies <dspyz>


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):

Attached Files
file #36056:  bug_45219.cset added by lachlan (987B - application/octet-stream)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -unavailable- added by lachlan (Updated the item)
  • -unavailable- added by rik5 (Posted a comment)
  • -unavailable- added by dspyz (Submitted the item)

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.


    Please enter the title of George Orwell's famous dystopian book (it's a date):



    Follow 5 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 29 Feb 2016 02:27:26 AM UTCrik5StatusConfirmed=>Fixed
    Sat 16 Jan 2016 09:54:19 AM UTClachlanAttached File-=>Added bug_45219.cset, #36056
    Thu 26 Sep 2013 05:09:57 PM UTCrik5Severity3 - Normal=>2 - Minor

    Back to the top

    Powered by Savane 3.1-cleanup1