[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #59776] pcg() returns incorrect flag
From: |
anonymous |
Subject: |
[Octave-bug-tracker] [bug #59776] pcg() returns incorrect flag |
Date: |
Tue, 29 Dec 2020 08:25:00 -0500 (EST) |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:84.0) Gecko/20100101 Firefox/84.0 |
URL:
<https://savannah.gnu.org/bugs/?59776>
Summary: pcg() returns incorrect flag
Project: GNU Octave
Submitted by: None
Submitted on: Tue 29 Dec 2020 01:24:58 PM UTC
Category: Octave Function
Severity: 3 - Normal
Priority: 5 - Normal
Item Group: Incorrect Result
Status: None
Assigned to: None
Originator Name: S Mahesh
Originator Email: smahesh@iitm.ac.in
Open/Closed: Open
Release: 5.2.0
Discussion Lock: Any
Operating System: GNU/Linux
_______________________________________________________
Details:
In octave 5.2.0, pcg() returns the wrong flag, even though it correctly
computes the answer. MWE:
A = [1.00000000 -0.00054274 -0.00066848; -0.00054274 1.00000000
-0.00060330; -0.00066848 -0.00060330 1.00000000];
b = [1 1 1]';
[x, flag, relres, iter] = pcg( A, b, 1e-6, 4, [], [], [1; 1; 1] )
output:
x =
1.0012
1.0011
1.0013
flag = 1
relres = 0.000025738
iter = 1
The answer (x) is correct: norm(A*x-b) = 0.000000053976 is less than the
tolerance of 1e-6
flag = 1 is supposed to indicate the number of iterations reached the maximum
allowable, but that has not happened here.
I therefore suspect the value returned in FLAG is a bug. In octave 4.0.0 flag
= 0 is returned correctly.
Thanks for any help.
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?59776>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
- [Octave-bug-tracker] [bug #59776] pcg() returns incorrect flag,
anonymous <=