From: David B. <Dav...@mo...> - 2004-01-07 14:38:19
|
Dear All, I've committed load/save support for the Galois field type that is useable with the current octave CVS. This might be the basis for similar support for the symbolic, sparse, etc user types. You'll need to include the $(CLASS_HAS_LOAD_SAVE) Makeconf variable in your defines for mkoctfile and place the new code in "#ifdef CLASS_HAS_LOAD_SAVE ... #endif" to keep backwards compatibility. Files to check to the example code are in main/comm/ov_galois.h and main/comm/ov_galois.cc and in particular the functions save_{ascii,binary,hdf5} and load_{ascii,binary,hdf5}. Other examples of these functions can be found in the octave CVS itself. One important point to remember with user defined types, is that the type must be registered prior to the re-loading of the saved file within octave. That is "octave_foo::register_type ()" must be called before the load. This can usually be done by using the type one prior to the load. For the Galois field type an example would be octave:1> dummy = gf(1); octave:2> load test.mat Now the only thing keeping user types as second class citizens is the concatenation operators..... :-) Regards David -- David Bateman Dav...@mo... 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 |