octave-maintainers
[Top][All Lists]
Advanced

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

Re: new gsvd function incompatible w/Matlab


From: Daniel J Sebald
Subject: Re: new gsvd function incompatible w/Matlab
Date: Wed, 17 Aug 2016 11:05:48 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2

On 08/17/2016 10:28 AM, Rik wrote:
All,

I don't want to look a gift horse in the mouth, but the new gsvd function
doesn't calculate the same values as Matlab.  This is a shame, because no
one with existing Matlab gsvd code will switch to Octave unless it is clear
that they can get the same results.  I filed a bug report about it here
(https://savannah.gnu.org/bugs/index.php?48807).

If we are lucky, it is simply a matter of recombining the outputs in a
different format, but I am not a linear algebra expert so I haven't tried.

--Rik

What is not the same? (I haven't looked closely.) Is it something like the order of generalized eigenvalues/vectors?

What is important is that the function is consistent. There is an example in the documentation:

a = hilb (3);
b = [1 2 3; 3 2 1];
[u, v, c, s, x, r] = gsvd (a, b);
u' * a * x
ans =

  -1.4093e-01  -1.2434e+00   4.3737e-01
  -1.3878e-17  -4.0950e-01   2.7068e-01
   5.5511e-17  -1.8486e-17  -8.0222e-03

[1 0 0; [0;0] c] * [r]
ans =

  -0.14093  -1.24345   0.43737
   0.00000  -0.40950   0.27068
   0.00000   0.00000  -0.00802

The two sides of the equation seem correct.

Note, the following error messages don't seem accurately descriptive:

demo gsvd
warning: demo: no function gsvd found
warning: called from
    demo at line 117 column 5

[No function gsvd found?  I just called it.]

test gsvd
????? gsvd is a built-in function

[Built-in functions don't have tests?]

Dan



reply via email to

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