octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #29786] Octave does not save sparse matrices c


From: Rik
Subject: [Octave-bug-tracker] [bug #29786] Octave does not save sparse matrices correctly in -mat format
Date: Sat, 08 May 2010 14:20:48 +0000
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.9) Gecko/20100402 Ubuntu/9.10 (karmic) Firefox/3.5.9

Update of bug #29786 (project octave):

                  Status:                    None => Confirmed              
                 Summary: Data file can not be loaded in Octave => Octave
does not save sparse matrices correctly in -mat format

    _______________________________________________________

Follow-up Comment #2:

Apparently Octave has trouble saving sparse matrices and has for quite a
while.

I spent some time narrowing the problem down.  The following code is
sufficient to provoke an error.

a = sparse(1,1);
a(1,1) = 1;
b = 2;
save -mat test.mat
clear
load test.mat

The error is reproducible with the current development sources as well as an
ancient 3.0.5 version I tried.

During the load the error message is:
error: load: invalid element type = 1016

I suspect that binary structures are not being properly aligned during the
save process.  For instance, if the variables are reversed so that the sparse
matrix is called b and the double variable is a then everything works.  This
puts the sparse matrix at the end of the file where it can't collide with any
following variables.  Similarly, if the sparse matrix is empty the test
passes.  

These results were obtained on an x86_64 machine.  The original reporter
didn't note whether they were using a 64 bit machine but it could be something
as simple as using an int value and expecting that to be a defined size rather
than using named sizes such as int32_t.

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?29786>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]