bugGNU Octave - Bugs: bug #36603, sparse matrices with no nonzero...

 
 

bug #36603: sparse matrices with no nonzero elements cannot be loaded in Matlab

Submitter:  None
Submitted:  Thu 07 Jun 2012 02:10:01 AM UTC
   
 
Category:  None Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Matlab Compatibility
Status:  Fixed Assigned to:  jordigh
Originator Name:  Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * 3.6.1
Operating System:  * GNU/Linux Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Tue 11 Sep 2012 01:19:08 PM UTC, comment #4: 

What the hell...

How did you figure out that this was the fix?

Yes, it works. Stupid Matlab bugs. I wish Matlab obeyed its own spec.

Jordi Gutiérrez Hermoso <jordigh>
Group Member
Tue 11 Sep 2012 05:50:04 AM UTC, comment #3: 

I checked in the following change:

http://hg.savannah.gnu.org/hgweb/octave/rev/9ed4fc294f3f

Does this fix the problem for you?

John W. Eaton <jwe>
Group administrator
Tue 11 Sep 2012 05:37:05 AM UTC, comment #2: 

I just spent some time looking byte-for-byte at the resulting mat files, and I'm quite stumped. As far as I can tell, Octave obeys the published spec for mat files.

Could you please show me the following mat files? I'll try to reverse-engineer the format that Matlab expects:


o = sparse(108,0);
save -v7 o.mat o;
x = sparse(108,108);
save -v7 x.mat x;
s = x;
s(500) = 42;
s(1000) = inf;
save -v7 s.mat s;


Then send me s.mat, o.mat, and x.mat.

Jordi Gutiérrez Hermoso <jordigh>
Group Member
Tue 11 Sep 2012 01:40:47 AM UTC, comment #1: 

Looks like sparse(5,5) (i.e. sparse matrix with no nonzero data) is also a problem.

I'm investigating this now, since it just bit me.

Jordi Gutiérrez Hermoso <jordigh>
Group Member
Thu 07 Jun 2012 02:10:01 AM UTC, original submission:  

I create a sparse matrix with one empty dimension and I save it. For example


x = sparse(zeros(1,0));
save -v7 x.mat x;


When I try to load it in Matlab, I get the following error:


??? Error using ==> load
Can't read file x.mat.



I am using Octave 3.6.1, compiled from source on 64-bit Ubuntu 11.10, and Matlab R2010a.

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 jwe (Posted a comment)
  • -email is unavailable- added by jordigh (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 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2012-09-11 jordigh StatusReady For Test Fixed
        Open/ClosedOpen Closed
    2012-09-11 jwe StatusConfirmed Ready For Test
    2012-09-11 jordigh StatusNone Confirmed
        Assigned toNone jordigh
        SummarySaving sparse matrix with one 0 dim, cannot be loaded in Matlab sparse matrices with no nonzero elements cannot be loaded in Matlab

    Back to the top

    Powered by Savane 3.13-caa5.
    Corresponding source code