2011/9/18 Juan Pablo Carbajal <[email protected]>: > 2011/9/18 Jordi Gutiérrez Hermoso <[email protected]>: >> 2011/9/17 Juan Pablo Carbajal <[email protected]>: >> >>> I changed the names of the functions. I added an optional argument >>> to multinom_exp to make it compatible with the original version, >>> since the order of the exponents was not the same. >>> >>> I added the new functions here >>> https://sourceforge.net/tracker/?func=detail&aid=3410842&group_id=2888&atid=352888 >> >> I guess you really want this to run in Matlab, which is why you >> changed the comment characters to % from #. There are number of >> further changes in order to fit this with the more limited Matlab >> languagen: >> >> 1) rows(x) has to be changed to size(x,1) >> >> 2) foo(x)(:) has to be changed to temp = foo(x); temp(:) >> >> Additionally, I made a few stylistic changes while keeping Matlab >> compatibility (I hope): >> >> 3) Octave style is to write foo (x) when foo is a function and >> foo(x) when foo is an array to visually distinguish function >> calls from array indexing. The exception is inside matrices, >> since the interpreter reads [foo (x)] as [foo, (x)]. >> >> 4) There was no need to call ones () in the accumarray call, which >> seems like undocumented behaviour. Simply "1" instead was >> enough. I'll push a documentation fix for that now. >> >> 5) A stray "%%s" seems to have happened when you replaced my ## >> with %%. >> >> 6) I find it visually cleaner to use ndims than varargin for the >> optional sorting parameter, since then you can easily use an >> explicit for the third optional argument. >> >> 7) I changed [dummy, foo] = bar (...) to [~, foo] = bar (...), >> which is syntax that works since Octave 3.4 and is more >> explicit about discarding output parameters. >> >> 8) I added spaces after commas. >> >> Given that I'm now making stylistic editorial decisions, I think I do >> want my name on this thing. Thank you for that. ;-) >> >> HTH, >> - Jordi G. H. >> > > Thank you very much Jordi, > > I am learning a lot of Octave culture, this is really good! I was > unaware of 3) and I fully agree with 6). > I will modify the other functions to follow 6). > > I share most of my code with colleagues that use Matlab, so I try to > keep conflicts as much as I can, but full compatibility is not > compulsory as soon as changes needed are minimum. > > Your name was there already! ;D > > Thanks again! > > -- > M. Sc. Juan Pablo Carbajal
Hi I have submitted these functions to the specfun package. After some discussion and code improvements of Jordi on #octave which were uploaded on the SF tracker https://sourceforge.net/tracker/?func=detail&aid=3410842&group_id=2888&atid=352888 To not that one of cthem nchoosek_vec is not part of the package anymore and was merged into one of the other new functions. Carnë ------------------------------------------------------------------------------ All the data continuously generated in your IT infrastructure contains a definitive record of customers, application performance, security threats, fraudulent activity and more. Splunk takes this data and makes sense of it. Business sense. IT sense. Common sense. http://p.sf.net/sfu/splunk-d2dcopy1 _______________________________________________ Octave-dev mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/octave-dev
