[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #55885] Wrong sparse LU permutation matrix wit
From: |
CH |
Subject: |
[Octave-bug-tracker] [bug #55885] Wrong sparse LU permutation matrix with vector option |
Date: |
Mon, 11 Mar 2019 10:07:01 -0400 (EDT) |
User-agent: |
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:65.0) Gecko/20100101 Firefox/65.0 |
URL:
<https://savannah.gnu.org/bugs/?55885>
Summary: Wrong sparse LU permutation matrix with vector
option
Project: GNU Octave
Submitted by: atcl
Submitted on: Mon 11 Mar 2019 02:07:00 PM UTC
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
Discussion Lock: Any
Release: 5.1.0
Operating System: Any
_______________________________________________________
Details:
Using the LU decomposition with four output values and the vector option seems
to lead to incorrect results for the P (row permutation) matrix:
A = sprand(5,5,0.3);
[L,U,P,Q] = lu(A);
(mod(find(P),size(P,2)))' % zeros are 5s
(mod(find(Q),size(Q,1)))' % zeros are 5s
[l,u,p,q] = lu(A,'vector');
p'
q'
gives with Octave 5.1
ans =
1 4 2 3 0
ans =
0 1 4 3 2
ans =
1 3 4 2 5
ans =
5 1 4 3 2
It seems that the vector is created from P' (transposed) instead of P since
(mod(find(P'),size(P,2)))' % zeros are 5s
gives
ans =
1 3 4 2 0
I hope I did not misinterpret anything. Thank you for your help.
BTW: Matlab (2018a) returns row vectors for P and Q while Octave (5.1) returns
column vectors.
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?55885>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
- [Octave-bug-tracker] [bug #55885] Wrong sparse LU permutation matrix with vector option,
CH <=