On 6 December 2011 23:52, Carnë Draug <carandraug+...@gmail.com> wrote: > On 6 December 2011 23:23, Ferran Mesas <ferran.mesa...@gmail.com> wrote: >> Hello Carnë, >> >> Yes, i think it can be made a subfunction. The thing is, the dictionary from >> huffmandict() is very efficient for encoding and memory-wise, but the >> array-tree is good at decoding but not memory-efficient. >> Embedding dict2tree into huffmandeco seems like a good idea. >> >> I copied the license-help and input validation from the "old" huffmandeco >> because I wasn't aware newer functions use GPLv3+, but you can change it if >> you want, no problem. Same for error-checking, print_usage() makes more >> sense. >> >> I made the following changes: >> - Made dict2tree into a subfunction. >> - Changed license text to v3+. >> - Made invalid input print the function usage. >> >> Let me know if anything else should be changed. > > If the first argument hcode, is supposed to be only binary, shouldn't > we check instead if it's a logical matrix? "islogical (hcode)". Also, > your current check would allow for values between 0 and 1. If you want > to allow a matrix of doubles of 0 and 1, should we check any (hcode(:) > != 0) || any (hcode(:) != 1) (not tested). > > Carnë
A made a few more changes. It's not commited yet. http://agora.panocha.org.mx/snippet/LTo5/ I added Muthiah Annamalai back to the copyright notice since at least the documentation and help text are the same as before. I re-added the test that was at end of the old file (if you can write more test cases that would be great). I used ! instead of ~ and marked end of blocks (endfunction/if/for, etc). I also pretiffied a bit the help text and added a imperative first sentence to the help text (octave core type). Also, the print_usage is more for a error such as wrong call of the function. For more specific, such as wrong class, the norm is to specify it. Does the code looks good? Can I commit it? Carnë ------------------------------------------------------------------------------ Cloud Services Checklist: Pricing and Packaging Optimization This white paper is intended to serve as a reference, checklist and point of discussion for anyone considering optimizing the pricing and packaging model of a cloud services business. Read Now! http://www.accelacomm.com/jaw/sfnl/114/51491232/ _______________________________________________ Octave-dev mailing list Octave-dev@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/octave-dev