bugGNU Octave - Bugs: bug #44315, sparse-times-single operators...


bug #44315: sparse-times-single operators unimplemented

Submitter:  Ceral Paquet <octavebugs>
Submitted:  Thu 19 Feb 2015 09:44:43 PM UTC
Category:  Libraries Severity:  1 - Wish
Priority:  1 - Later Item Group:  Feature Request
Status:  Postponed Assigned to:  None
Originator Name:  Open/Closed:  * Open
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup

Fri 15 Jan 2016 12:27:08 PM UTC, comment #4: 

As Jordi said, it is unlikely that Octave will add a sparse-single type.  Although it is a "fixed" Matlab, it shouldn't become bloated.

What type should sparse*single return?  If the single is a scalar, then I suppose a sparse is best, but if the single is a matrix, then I suppose a single matrix is best.  Is that right?

Lachlan Andrew <lachlan>
Sat 05 Sep 2015 09:20:12 AM UTC, comment #3: 

I emailed Tim Davis asking if there was any chance of extending SuiteSparse to singles and he told me I need to compile it myself to get that behavior.

In fact I don't really use any of the sparse decompositions, only the basic operations + * etc.

I'm kind of lost in the Octave sparse code - there are templates for each supported type in:


Would it be possible to extend the core functionality of Octave to sparse single precision? Not the SuiteSparse decompositions, just multiply and addition.

I know Matlab does not support this but Octave is a "fixed" version of Matlab in many ways (e.g. sparse() accepts non-double arguments).

Ceral Paquet <octavebugs>
Fri 20 Feb 2015 08:13:57 AM UTC, comment #2: 

OK thanks for the info Jordi. I spent some time looking in sparse.cc and MSparse.cc



and saw the latter is templated so I wondered if it was a simple change. BTW is this fall-back code if SuiteSparse is not used?

Also, interesting about single*sparse. I had to check it out - unfortunately it looks like it has the same limitation.


error: binary operator '*' not implemented for 'float matrix' by 'sparse matrix' operations

Ceral Paquet <octavebugs>
Thu 19 Feb 2015 10:04:41 PM UTC, comment #1: 

A new class of sparse matrices seems unlikely to happen, since we rely on SuiteSparse, which only uses doubles.

I think single*sparse should work, though. I have retitled the bug to reflect this. Since there's a simple workaround, I have downgraded the severity.

Jordi GutiƩrrez Hermoso <jordigh>
Group Member
Thu 19 Feb 2015 09:44:43 PM UTC, original submission:  

I would like to request thoughts on implementing sparse single matrices. The main reason would be so that addition and multiply can be performed on non-sparse single matrices and vectors. E.g.

 A = sparse(randn(10));
 x = randn(10,1,"single");
 b = A*x;

error: binary operator '*' not implemented for 'sparse matrix' by 'float matrix' operations

I have an application that uses a sparse matrix multiply in amongst other operations (FFT, dense multiplies, etc.) and it all has to be done in doubles because of the sparse operator. The data comes in as 16-bit ints so single precision is plenty.

Ceral Paquet <octavebugs>


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

Attach Files:

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by lachlan (Posted a comment)
  • -email is unavailable- added by jordigh (Posted a comment)
  • -email is unavailable- added by octavebugs (Submitted the item)

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.


    Follow 8 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-02-27 mtmiller Carbon-CopyRemoved 80942 -
    2018-05-01 mtmiller Severity2 - Minor 1 - Wish
        Priority5 - Normal 1 - Later
        StatusNone Postponed
        Release3.8.2 dev
    2015-02-22 mtmiller CategoryNone Libraries
    2015-02-19 jordigh Severity3 - Normal 2 - Minor
        SummarySparse single type sparse-times-single operators unimplemented

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code