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

## [Octave-bug-tracker] [bug #57968] condest produces incorrect result for

 From: Brian Sutton Subject: [Octave-bug-tracker] [bug #57968] condest produces incorrect result for any matrix that is not symmetric/Hermitian Date: Sat, 7 Mar 2020 18:26:24 -0500 (EST) User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:73.0) Gecko/20100101 Firefox/73.0

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

Summary: condest produces incorrect result for any matrix
that is not symmetric/Hermitian
Project: GNU Octave
Submitted by: briansutton
Submitted on: Sat 07 Mar 2020 11:26:23 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
Release: 5.2.0
Discussion Lock: Any
Operating System: Any

_______________________________________________________

Details:

In the condest function, the input matrix and its transpose are swapped at one

Demonstration:

octave:1> A = reshape(sqrt(0:15),4,4);
octave:2> % Desired result:
octave:3> norm(A,1)*norm(inv(A),1)
ans =  49422.61476
octave:4> % Output of condest:
octave:5> condest(A)
ans =  52089.95402
octave:6> % What condest is actually computing:
octave:7> norm(A,1)*norm(inv(A'),1)
ans =  52089.95402

Note that in line 3, it's inv(A), but in line 7, it's inv(A').

Fix:

1. In scripts/linear-algebra/condest.m function solve_sparse, swap line 242
case "notransp"
and line 244
case "transp"
2. In scripts/linear-algebra/condest.m function solve_not_sparse, swap line
255
case "notransp"
and line 257
case "transp"

_______________________________________________________

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

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/

```