Octave and Freemat

David Bateman adb014 at gmail.com
Tue Mar 4 17:01:11 CST 2008


David Bateman wrote:
> Sebastien Loisel wrote:
>> Dear David,
>>
>> Thank you for your quick reply.
>>
>>
>>     That is an error, as the code on octave-forge is not part of
>>     Octave. The
>>     copyright strings were recently updated in octave-forge and I believe
>>
>>
>> OK, I see that ORTH 
>> http://velveeta.che.wisc.edu/cgi-bin/cvsweb.cgi/~checkout~/octave/scripts/linear-algebra/orth.m?rev=HEAD&content-type=text/plain
>> <http://velveeta.che.wisc.edu/cgi-bin/cvsweb.cgi/%7Echeckout%7E/octave/scripts/linear-algebra/orth.m?rev=HEAD&content-type=text/plain>
>>
>> is part of Octave, while ODE45
>> http://octave.svn.sourceforge.net/viewvc/octave/trunk/octave-forge/extra/ode/inst/ode45.m?revision=HEAD&content-type=text/plain
>> <http://octave.svn.sourceforge.net/viewvc/octave/trunk/octave-forge/extra/ode/inst/ode45.m?revision=HEAD&content-type=text/plain>
>> is not. I'll just leave the copyrights alone. For those files that I
>> lift out of Octave (like ORTH), I will put a note that the file was
>> copied into Freemat, and that Freemat's not part of Octave, and
>> otherwise leave the copyright alone. Does that sound like the right idea?
>>  
>>
>>     roots is an octave core function and not from Octave forge, so
>>     send the
>>     proposed patches to roots to maintainers at octave.org
>>     <mailto:maintainers at octave.org>. As for octave-forge
>>
>>
>> The correct implementation of roots.m is
>>
>> function z = roots(p)
>>   if(any(isnan(p) | isinf(p)))
> Octave deliberately doesn't support the short circuiting with the "|"
> operator, use "||" instead. See
> 
> http://www.gnu.org/software/octave/FAQ.html#MATLAB-compatibility
> 
> for a discussion of why.
> 
>>  
>>   while(any(isinf(p./p(1))))
>>      p=p(2:end);
>>   end
> Its bad form to use a loop here, but this is the cause of the issue you
> saw. It would be better to write that as
> 
> f = find (p ./ max(p));
> p = p (f(1):end);
> 
> assuming p is a vector of cause, so perhaps you should move your "vec"
> statement before this. I'll supply a patch to Octave's roots function
> based on this
> 
> D.
> 
> 


Ok attached is  what I would suggest as a modification to the Octave
roots function to ix this issue based on your contributed code.

D.

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: patch7633
Url: https://www.cae.wisc.edu/pipermail/octave-maintainers/attachments/20080305/6c94de6a/attachment.ksh 


More information about the Octave-maintainers mailing list