From: David B. <Dav...@mo...> - 2003-09-15 10:12:30
|
According to pki...@us... <pki...@us...> (on 09/15/03): > Thanks for doing this. > > I was planning something considerably simpler, which is to set > the matlab compatible values in the functions that need them > and not bother restoring them later. Newer versions of Octave > won't care because the symbols don't have magic names, and > older versions will work okay since for the most part these > variables don't affect semantics and just serve to annoy. > prefer_zero_one_indexing and prefer_column_vectors are > exceptions in that changing them will change the results > of the calculation. For those my preference is to assume > compatible values. > > Is that too brutal? I really don't know what is best. My feeling was that at this point it is better to have the minimum distrubance to the functioning of the code for versions prior to 2.1.50, and let 2.1.51 and later work properly. The downside of what I did is that it introduces a lot of extra "try .. catch" code. In a yea or so, I imagine that stuff like do_fortran_indexing will be pretty much forgotten and we can cut out the code completely. I'm not sure your idea is good at this point, since it forces the 2.1.51 defaults for people using older versions of octave. However, in a year or so, I imagine it will be the preferred solution. Regards David > > Paul Kienzle > pki...@us... > > On 12 Sep 2003 at 16:44, David Bateman wrote: > > > Seeing as no one responded to this message and that I wanted > > OctaveForge to work with the latest CVS I've gone ahead and > > committed the follwoing modifications: > > > > * Protected the in-built variables that are used in 2.1.50 and > > earlier that no longer exist in the CVS and included as appropriate > > the corresponding warn variable in the dot-m files. An example is > > > > dfi = do_fortran_indexing; > > unwind_protect > > do_fortran_indexing = 1; > > unwind_protect_cleanup > > do_fortran_indexing = dfi; > > end_unwind_protect > > > > is replaced with > > > > try dfi = do_fortran_indexing; > > catch dfi = 0; end > > try wfi = warn_fortran_indexing; > > catch wfi = 0; end > > unwind_protect > > do_fortran_indexing = 1; > > warn_fortran_indexing = 0; > > unwind_protect_cleanup > > do_fortran_indexing = dfi; > > warn_fortrabn_indexing = wfi; > > end_unwind_protect > > > > This was done for the following variables if I found them in the entire > > OctaveForge sources > > > > Old Variable New Variable > > -------------- -------------- > > empty_list_elements_ok warn_empty_list_elements > > ok_to_lose_imaginary_part warn_imag_to_real > > treat_neg_dim_as_zero warn_neg_dim_as_zero > > implicit_num_to_str_ok warn_num_to_str > > resize_on_range_error warn_resize_on_range_error > > implicit_str_to_num_ok warn_str_to_num > > do_fortran_indexing warn_fortran_indexing > > prefer_zero_one_indexing <none> > > prefer_column_vectors <none> > > propagate_empty_matrices <none> > > > > If I missing a variable tell me. The changes I made should maintain > > backwards compatibility > > > > * Added to configure.base and Makeconf.base the variables > > > > HAVE_DO_FORTRAN_INDEXING > > HAVE_PROPAGATE_EMPTY_MATRICES > > HAVE_OK_TO_LOSE_IMAGINARY_PART > > > > to test for the Vdo_fortran_indexing, Vpropagate_empty_matrices and > > Vok_to_lose_imaginary_part variables. These are for use in the C++ code > > that requires them (I think this is only in the comms toolbox at the moment). > > Although OctaveForge doesn't contain code using Vok_to_lose_imaginary_part > > yet, I intend to submit some code soon with this and so its presence helps > > me. > > > > * Got rid of the references to resize_fill_value() method instatiated from > > Array.h that is no longer in the octave CVS. Again this appears to only be > > in the comms toolbox > > > > * Changes the name of the matrix_identity function in optim/lp.cc to > > lp_matrix_identity function so as not to clash with the one in utils.h > > in the current octave CVS. I couldn't use the one in the octave CVS > > since I didn't want to break backwards compatiablity. > > > > I think that is all of the changes I had to make > > > > Regards > > David > > > > > > According to David Bateman <Dav...@mo...> (on 09/09/03): > > > Dear All, > > > > > > There are a number of problems with Octave-Forge for the latest CVS. > > > Firstly the > > > > > > static T resize_fill_value (void) { return T (); } > > > > > > has been commented out of Array.h, so if you use this template in a > > > type this no longer works. I think I'm the only who supplied code that > > > did this, so this one isn't too big a problem. > > > > > > The major problem is that the variables do_fortran_indexing, > > > propagate_empty_matrices etc no longer exist. Removing them and using > > > the new options like warn_fortran_indexing will break all backwards > > > compatiablity within Octave-Forge. No doing it and the functions > > > will fail when a new release is made. > > > > > > A solution like > > > > > > have_fortran_indexing = 1; > > > try > > > tmp = do_fortran_indexing; > > > catch > > > have_fortran_indexing = 0; > > > end > > > > > > is possible, but looking at the number of places it'll need doing (including > > > in some C++ code) this is an ugly solution. > > > > > > Does anyone have any ideas? > > > > > > 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 > > > > -- > > 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 > > > > > > ------------------------------------------------------- > > This sf.net email is sponsored by:ThinkGeek > > Welcome to geek heaven. > > http://thinkgeek.com/sf > > _______________________________________________ > > Octave-dev mailing list > > Oct...@li... > > https://lists.sourceforge.net/lists/listinfo/octave-dev > > > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > Octave-dev mailing list > Oct...@li... > https://lists.sourceforge.net/lists/listinfo/octave-dev -- 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 |