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

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

[Octave-bug-tracker] [bug #55427] save -v7 exits with "error compressing


From: Rik
Subject: [Octave-bug-tracker] [bug #55427] save -v7 exits with "error compressing data element"
Date: Sat, 3 Jul 2021 16:36:26 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.101 Safari/537.36

Follow-up Comment #16, bug #55427 (project octave):

I think the difference in sizes may be due to differences in storage
calculations.  Octave, for example, only accounts for the storage of the
actual data, but for the overhead of structs themselves.  For example, I tried
this test code


x.a.b = ones (1e6,1);
whos x


In Octave, this returns 8,000,000 (1 million elements at 8 bytes per element. 
In Matalb, this returns, 8,000,336 (8MB of data + 336 of overhead for the
struct).

Similarly for 


y = {ones(10,1, 'uint8')};
whos y


Octave reports just 10 bytes, while Matlab reports 114 bytes.

You could always check to make sure the data itself is intact by saving a
struct "var1" from Matlab, loading the struct in Octave, renaming the variable
("var2 = var1;"), saving the struct in Octave, loading the old and new structs
in Matlab and then use "assert (var1, var2)" to verify that they are the
same.


You could run a test and save the structure 

    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?55427>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

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