On 06/14/2013 01:29 PM, John W. Eaton
wrote:
Octave's
binary file format does not handle 64-bit dimensions, so we
are limited to saving vectors with less than 2^31
elements.
Currently, the save_binary and read_binary functions in the
octave_value class hierarchy unconditionally read and write 32-bit
signed values for matrix dimensions. The file format does have a
10-byte header to identify the file, currently it is either
Octave-1-L
or Octave-1-B (for little- and big-endian). This can change to
Octave-2- for files that have 64-bit matrix dimensions.
My proposal is to do the following:
* For versions of Octave built with --enable-64:
- write files with the Octave-2- format
- read either type of file
* For versions of Octave built without --enable-64:
- continue to write files with Octave-1- format
- attempt to read either type of file, only failing if a value
that has dimensions that are too large to store given the
limits
of 32-bit integer dimensions.
Unfortunately, I see no good way to make this change in a backward
compatible way because the save_binary and load_binary funtions in
the
derived octave_X_value classes will have to know whether they are
writing or reading version 2 files. This means that after the
change,
all octave_value types that are defined in C++ will have to change
to
handle the new function signatures.
Comments?
jwe
I do not see any better approach. But, I also do not see why this
will
cause a problem for current 32-bit users, or users who move to
64-bit
and do not switch back. There is no way that a file with dimensions
above the 32-bit limit is going to work in a 32-bit system in any
case.
Good idea to do this soon as there will be increasing pressure to
make
the 64-bit Octave fully functional.
Michael
|