octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Octave and Freemat


From: David Bateman
Subject: Re: Octave and Freemat
Date: Tue, 04 Mar 2008 23:44:55 +0100
User-agent: Thunderbird 1.5.0.7 (Windows/20060909)

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 address@hidden
    <mailto:address@hidden>. 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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]