[Top][All Lists]

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

[Octave-bug-tracker] [bug #29768] logm fix

From: Jaroslav Hajek
Subject: [Octave-bug-tracker] [bug #29768] logm fix
Date: Tue, 27 Jul 2010 09:37:30 +0000
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv: Gecko/20100506 SUSE/3.5.10-0.1.1 Firefox/3.5.10

Follow-up Comment #21, bug #29768 (project octave):

Hi Marco,

I found out I have already played with this a couple of months before and had
an incomplete Fortran implementation, so I completed and pushed it. This code
stores the rotations in helper vectors so that it can process both matrices
strictly column-wise to be cache-friendly.

I invite you to verify the new function. One thing I would like to note: you

      s = sqrt(T(m,m-1)/(T(m-1,m)-T(m,m-1)));
      c = sqrt(T(m-1,m)/(T(m-1,m)-T(m,m-1)));

I do not think, however, that T(m-1,m) > 0 is guaranteed as an output of real
schur, is it? In that case, with c complex,
      G = [c, s;-s', c];
would not be a rotation...

I used instead the formulas

      c = sqrt(abs(T(m-1,m)/(T(m-1,m)-T(m,m-1))));
      s = sqrt(abs(T(m,m-1)/(T(m-1,m)-T(m,m-1)))) * sign(T(m-1,m));

the sign of s should ensure that the conjugate with positive imaginary part
comes first.

I will let schur() and sqrtm() take advantage of the new feature.


Reply to this item at:


  Message sent via/by Savannah

reply via email to

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