bugGNU Octave - Bugs: bug #36568, wrong flag returned by gmres

 
 

bug #36568: wrong flag returned by gmres

Submitter:  Gerard BURNSIDE <gerardburnside>
Submitted:  Thu 31 May 2012 03:20:47 PM UTC
   
 
Category:  None Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Inaccurate Result
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * 3.6.1 Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Fri 15 Jun 2012 05:16:30 PM UTC, comment #1: 

I pushed a patch here (http://hg.savannah.gnu.org/hgweb/octave/rev/5c269b73f467) which fixes this issue and also some others with gmres().  To access the fix you will need to build from Mercurial sources or wait until the next stable release (3.8.0).  Thanks for noticing this.

Rik <rik5>
Group administrator
Thu 31 May 2012 03:20:47 PM UTC, original submission:  

While checking out the samples for gmres and bicgstab, I noticed that gmres returned a flag 1 (max num iterations reached) where I expected it to return a flag 0 (converged).

Looking at gmres.m it seems that you just need to change the inequality after the while loop from:

 if (presn > rtol * prec_b_norm)
   flag = 0;

to:

 if (presn <= rtol * prec_b_norm)
   flag = 0;

(by default the flag is initializd to 1).

Gerard BURNSIDE <gerardburnside>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by gerardburnside (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2012-06-15 rik5 StatusNone Fixed
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code