From bug-request at octave dot org Thu Nov 24 21:28:15 2005 Subject: Re: isequal From: "John W. Eaton" To: William Poetra Yoga H Cc: bug at octave dot org Date: Thu, 24 Nov 2005 22:27:29 -0500 On 24-Nov-2005, William Poetra Yoga H wrote: | Sorry, I wasn't quite specific about the functions isequal and | isequalwithequalnans, and I made the mistake of sending a file instead of a | patch. | | OK, here is the description: | 1. isequal checks for equality for a number of objects. It does this | recursively for objects of class "struct" and "cell" in Matlab. For Octave, we | have the "list" class, which is treated similarly to "cell". I don't know | whether Matlab checks for equality between strings, but I think that would be | useful. | 2. isequalwithequalnans is identical to isequal except that it assumes NaN == | NaN. This is useful for comparing numeric arrays. | | The current isequal.m file in the Octave distribution is well written, but it | can be easily extended to allow us to implement isequalwithequalnans. So what I | did was: | 1. Extend isequal.m's functionality a bit, to enable NaN == NaN checking. I did | this by adding an option _nan to it. I think it would be better to use a name like "equal_nans" or "nans_compare_equal"? It seems to me that a name like this is much more meaningful than "_nan". | 3. Rename isequal.m to _isequal.m "Internal" functions in Octave should have names of the form __[a-z]__. | I think this function is useful for compatibility with Matlab. I was | wrong to attach the function files last time, but now I know how to | make a diff for new files (like what I did for blkdiag.m) and add a | changelog entry ;) | | What does John think about this? Where is the patch? Is this the file you sent bzipped? Can you please fix the naming and send the patch as a text/plain attachment? It's much easier for me to handle that rather than a bzipped/tar/zip/whatever/archive, because if it is a text/plain attachment, I can easily view it in my mail reader inside Emacs instead of having to save a file and unpack it, etc. Since I seem to be the rate limiting step in getting changes into Octave now, it would help speed things up if you make things as easy as possible for me. Thanks, jwe ------------------------------------------------------------- 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 -------------------------------------------------------------