Octave and Freemat
David Bateman
David.Bateman at motorola.com
Tue Mar 4 16:44:55 CST 2008
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.
More information about the Octave-maintainers
mailing list