bugGNU Octave - Bugs: bug #66889, Sparse single support (MATLAB...

 
 

bug #66889: Sparse single support (MATLAB compatibility 2025a)

Submitter:  None
Submitted:  Mon 10 Mar 2025 04:00:12 PM UTC
   
 
Category:  Libraries Severity:  1 - Wish
Priority:  5 - Normal Item Group:  Feature Request
Status:  Confirmed Assigned to:  None
Originator Name:  Originator Email:  -email is unavailable-
Open/Closed:  * Open Release:  * 9.4.0
Release:  Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Mon 10 Mar 2025 04:57:55 PM UTC, comment #1: 

Marking this as a Feature Request.

Offhand, I don't think it would be hard to support this as the sparse matrix code is already uses templates which could be flipped from using "double" to "single".

Rik <rik5>
Group administrator
Mon 10 Mar 2025 04:00:12 PM UTC, original submission:  

As of version 2025a, Matlab is supporting single precision sparse matrices.

https://www.mathworks.com/help/releases/R2025a/matlab/release-notes.html

Sparse Matrix: Create and use single-precision sparse matrices
Share

Single-precision sparse matrices are now supported in all functions that support double-precision sparse matrices, including elementary math, linear algebra, and sparse matrix functions. You can create a single-precision sparse matrix using these functions:

    sparse

    speye

    spalloc

    sprand

    sprandn

    sprandsym

By default, these functions create a double-precision sparse matrix. To create single-precision sparse data, specify the new typename argument as "single". For example, create a 50-by-100 single-precision sparse matrix with density 0.1 by calling sprand(50,100,0.1,"single").

You can also create single-precision sparse matrices by providing single-precision input data to sparse. For example, create a 4-by-4 single-precision sparse matrix by calling sparse(1:4,1:4,single([3 4 5 6])).
 Compatibility Considerations

If you save a single-precision sparse matrix to a MAT file, you can load it into an earlier release of MATLAB. However, how the data is loaded depends on the release of MATLAB:

    MATLAB R2021b through R2024b — MATLAB warns that the data has an unsupported data type and loads it as a double-precision sparse matrix.

    MATLAB R2021a and earlier — MATLAB loads the data as a single-precision sparse matrix, but you cannot use the matrix because its data type is unsupported. Attempting to use the matrix can result in undefined behavior.
-verbatiim-

Anonymous

 

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

Attach Files:
   
   
Comment:
   

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 rik5 (Posted a comment)
  •  

    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 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2025-03-10 rik5 CategoryNone Libraries
        Severity3 - Normal 1 - Wish
        Item GroupNone Feature Request
        StatusNone Confirmed

    Back to the top

    Powered by Savane 3.14-7003.
    Corresponding source code