octave-maintainers
[Top][All Lists]
Advanced

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

Patch for asci load/save [ Was: Re: restructuring load-save ]


From: David Bateman
Subject: Patch for asci load/save [ Was: Re: restructuring load-save ]
Date: Sun, 23 Nov 2003 23:12:07 +0100
User-agent: Mutt/1.3.28i

Ok, as it appears that the CVS is working now, I've built the changes I
made for the ascii load/save functions. Attached you'll find a patch
against the current CVS...

In doing this conversion I made some small changes to the format with
a limited compatiability issue. Firstly, for global cell arrays only
the toplevel of the array is marked as global and not all of the
elements.  As the cell names aren't used, this should have no affect
on compatiability. The other change is that all types are now save
individually. This means

  * Ranges aren't converted into matrices in certain cases, but always
    stored as ranges
  * "bool matrix" types aren't converted to matrices to be saved. This 
    has a backward compatiability issue, as saved "bool" and "bool matrices" 
    can't be loaded on old versions. Are there other variables in the same
    situation? I propose to ignore this situation, since the only real way 
    to treat this is with an external conversion program in any case.
  * The "string" type is now saved a "string" and not "string array". The
    old "string" type has been eliminated. As the existing code can't
    save "string"'s in any case it seems that this is here only for backward
    compatibilities with even older versions of octave. Should special code
    to handle "string array" be included? Should backward compatibility with
    the old "string" saved variables be kept?

I haven't done anything to treat the saveing/loading of N-D arrays. As the
previous code didn't either I don't see this as an issue.... In any case,
not knowing much about the N-D arrays, I'm probably not the best to add
this functionality.

In the small tests I've done the code appears to work perfectly, and its a
big step forward for me as I can now save variables with user defined types..
So I hope this can make it into a future release.

The next step is to attack the octave binary format, however 1) it appears 
that there is still some discussion on what to do here and 2) I'm not around
for the next couple of days and can't do anything in any case... So I won't
touch this yet.

For the binary format, I think it is probably better to use the HDF format 
as the octave format, supplying an external script for the old octave
binary formats. This reduction in the number of supported formats is to
my liking, but at this point I don't know much about the HDF format or how
simple we could make the load_hdf and save_hdf function (similar to load_ascii
and save_ascii functions in the attached patch). I'll do the changes in this
way eventually if 1) someone else doesn't get there first, 2) I can figure
out the HDF format, 3) there are no objections, and 4) there is a chance that
such a patch might be accepted

D.


According to John W. Eaton <address@hidden> (on 11/23/03):
> On 22-Nov-2003, David Bateman <address@hidden> wrote:
> 
> | According to John W. Eaton <address@hidden> (on 11/22/03):
> | >
> | > except that now every
> | > class that uses those macros must provide a default constructor that
> | > takes no args.
> | 
> | Yeah, I found that out :-)
> 
> I tried to fix this earlier this morning but didn't get it right.
> When I have it working, I will check something in.  Until then, CVS
> Octave is broken.  Sorry.
> 
> jwe

-- 
David Bateman                                address@hidden
Motorola CRM                                 +33 1 69 35 48 04 (Ph) 
Parc Les Algorithmes, Commune de St Aubin    +33 1 69 35 77 01 (Fax) 
91193 Gif-Sur-Yvette FRANCE

The information contained in this communication has been classified as: 

[x] General Business Information 
[ ] Motorola Internal Use Only 
[ ] Motorola Confidential Proprietary

Attachment: patch
Description: Text document


reply via email to

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