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 Sep 22 22:40:25 2013  
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 MarkupRich Markup):

You are not logged in

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


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

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

Rik <rik5>
Project Administrator
Sat Jan 16 09:54:19 2016, 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 Sep 26 17:09:57 2013, 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 Sep 22 22:40:25 2013, 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 Feb 29 02:27:26 2016rik5StatusConfirmed=>Fixed
    Sat Jan 16 09:54:19 2016lachlanAttached File-=>Added bug_45219.cset, #36056
    Thu Sep 26 17:09:57 2013rik5Severity3 - Normal=>2 - Minor

    Back to the top

    Powered by Savane 3.1-cleanup1