From help-request at octave dot org Thu Mar 10 02:20:18 2005 Subject: Re: save function From: David Bateman To: Mike Miller Cc: Hamish Allan , "John W. Eaton" , Help-Octave List Date: Thu, 10 Mar 2005 09:23:50 +0100 Mike Miller wrote: > On Wed, 9 Mar 2005, David Bateman wrote: > >> Getting rid of the "# type:" line basically then means that we go >> back to a monolithic and non-extensible function that can only >> load/save certain types of variables ("scalar" and "matrix" only). > > > I would think that most ascii saves are of matrix data. Wouldn't an > additional option like "-ascii-noheader" satisfy those of us who would > like to be able to save a matrix without header lines? You thinking about the problem as a user not a developer. Take a look at the ls-oct-ascii.cc file in 2.1.50 and what it looks like today. The monolithic code that was there in 2.1.50 is difficult to maintain, and frankly huge. Splitting the functionality simplified things significantly > > I think we should ask ourselves why someone would want to save Octave > data in ascii format. I think it would mostly be for export to > another program that cannot use the header lines. If it were for > storage purposes to re-import to Octave, the binary format seems to be > better: I created a variable x=rand(200,200) and saved it in ascii > and binary formats... > > bytes filename > ------ ------------ > 720305 x_ascii.txt > 320031 x_binary.bin Human readability counts in some cases... Additionally for user types the ascii functions are much easier to write. You'll note that Andy added the ascii save functions for the octave-forge sparse matrix functions first. > > The binary file was smaller. Both save and load functions were > noticably faster for binary than for ascii. ASCII therefore seems to > be a poor choice for storing Octave data. On the other hand, a "save > -ascii-noheader" > option would be useful. I would not encourage people to use "save > -ascii" when they can use "save -binary", but I am interested in other > opinions on that issue. > > What's wrong with having a "save -ascii-noheader" option? Show me the code... D. -- David Bateman David dot Bateman at motorola dot com Motorola 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 -------------------------------------------------------------