octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #60273] Wrong result in GSVD


From: Leonardo
Subject: [Octave-bug-tracker] [bug #60273] Wrong result in GSVD
Date: Tue, 23 Mar 2021 07:15:06 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:86.0) Gecko/20100101 Firefox/86.0

URL:
  <https://savannah.gnu.org/bugs/?60273>

                 Summary: Wrong result in GSVD
                 Project: GNU Octave
            Submitted by: pocker
            Submitted on: Ter 23 Mar 2021 08:15:02 -03
                Category: Octave Function
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Incorrect Result
                  Status: None
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
                 Release: dev
         Discussion Lock: Any
        Operating System: GNU/Linux

    _______________________________________________________

Details:

Hi.

>From "help gsvd" it says that

[U, V, X, C, S] = gsvd (A, B)
A = U*C*X'
B = V*S*X'

But,

>> A = [1 1 3; 3 1 2; 2 1 1];
>> B = [2 0 1; 2 1 -1;1 0 0];
>> [U, V, X, C, S] = gsvd (A, B);
>> U*C*X'
ans =

0.206864 0.733236 0.430549
-0.510638 0.269817 0.312529
-0.294408 0.404150 -0.080575

which is clearly not matrix A.

The problem is with matrix X

>> X
X =

-0.186817 -0.981925 0.030379
0.865745 -0.149940 0.477496
0.464311 -0.115506 -0.878108

while it should be

>> X = A'*U*inv(C)
X =

2.9726e+00 3.7631e+00 5.0158e-02
1.6483e+00 8.1334e-01 7.8837e-01
3.7280e+00 -2.4142e-03 -1.4498e+00

After this, I get

>> U*C*X'
ans =

1.0000 1.0000 3.0000
3.0000 1.0000 2.0000
2.0000 1.0000 1.0000

which is matrix A and

>> V*S*X'
ans =

2.0000 0 1.0000
2.0000 1.0000 -1.0000
1.0000 -0.0000 -0.0000

which is matrix B.

This affects, at least, v. 6.2.0 and 7.0.0 (4a516dce916c+). Both compiled from
source, debian 10.

Kind regards,
Leonardo




    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?60273>

_______________________________________________
  Mensagem enviada pelo Savannah
  https://savannah.gnu.org/




reply via email to

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