|
From: | David Bateman |
Subject: | Re: hdf5-support ? |
Date: | Thu, 18 Aug 2005 15:36:45 +0200 |
User-agent: | Mozilla Thunderbird 0.8 (X11/20040923) |
John W. Eaton wrote:
This doesn't address the issue of extensibility of load/save for user types. For example for the sparse type there are three vectors that are saved, one for the row index, one for the column index and one for the values (though its in compressed column format). So how can octave tell the difference between that and two uint32 vectors and a third double vector... No there has to be a way of grouping data for such things together and having a means of telling types apart... Perhaps an attribute of a dataset might have been sufficient in many cases, but as the sparse example shows, not all of them.On 18-Aug-2005, David Bateman wrote:| Your question still has sense if you are working with a file in octave's | format... Again, the answer is no. The reason is that the "mode" | variable in Fsave is not passed to the hdf5_ofstream constructor as | defined in ls-hdf5.h. Furthermore the std::ios::ate flag of mode in not | tested in the constructor, and the stream is always opened for saving like | | file_id = H5Fcreate (name, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); | | The fact is it probably wouldn't be very hard to modify octave to allow | the functionality you want, as it would just require passing the mode to | the hdf5_ofstream constructor in load-save.cc, then testing for | std::ios:ate in the constructor and using the right flags to H5Fcreate. | Want to send a patch?Or, as another solution to this problem, I think it would be good to have a thin wrapper to the HDF5 library interface. Then you could do anything with HDF5 in Octave. That would seem to me to be the most flexible solution. If we had that, we might even think about rewriting some of the current HDF5 load-save code as .m files instead of C++. Since Matlab also has some kind of interface to the HDF5 library, it would probably be good to also provide a Matlab-compatible interface as well.
Also as Fsave and Fload are in C++, do you really want to do an eval to get to an m-file for the hdf load save stuff....
I see the value of a thin layer to hdf5, but as it can never treat all possible user data types without using groups I see it as better to keep the current structure and add a thin hdf5 interface as a separate piece of code...
Cheers David
jwe
-- David Bateman address@hiddenMotorola Labs - Paris +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
------------------------------------------------------------- Octave is freely available under the terms of the GNU GPL. Octave's home on the web: http://www.octave.org How to fund new projects: http://www.octave.org/funding.html Subscription information: http://www.octave.org/archive.html -------------------------------------------------------------
[Prev in Thread] | Current Thread | [Next in Thread] |