Fri 28 Feb 2014 05:42:32 PM UTC, comment #2:
There are two things that should be avoided here:
1) avoid nested subfunctions. Instead, create a subfunction at the end of the file (or if the function is really small, create a function handle).
2) avoid loops. These are not good for performance.
Since it seems you are a GSoC canditate trying to get used to Octave development, I will also suggest some other smaller things:
1) add a test block for this feature. These are the %! blocks at the end of many m files. fspecial does not have them yet but take a look at bwmorph or imcomplement for examples.
2) add a note to the documentation of fspecial() about what the "disk" option. This needs to be documented somewhere.
3) add a note to the NEWS file about this change (note that for a new user, this is just a bug fix but someone using Octave for a long time, this is a backwards incompatible change).
4) some comment on the code about what is going on. The comment for the attachment "Each cell is weighted according to how much of it is covered by the disk" is the most useful, why was it not in the actual code or even in the commit message?
|