patchGNU Octave - Patches: patch #7463, add the gmres and mgorth functions

 
 

patch #7463: add the gmres and mgorth functions

Submitter:  Carlo de Falco <cdf>
Submitted:  Sun 13 Feb 2011 08:47:55 PM UTC
   
 
Category:  None Priority:  5 - Normal
Status:  None Privacy:  Public
Assigned to:  None Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Wed 16 Mar 2011 10:01:01 PM UTC, comment #7: 

great, thanks!
if you have time could also take a look at other iterative linear solver patches?

https://savannah.gnu.org/patch/index.php?7482
https://savannah.gnu.org/patch/index.php?7483
https://savannah.gnu.org/patch/index.php?7484

c.

Carlo de Falco <cdf>
Group Member
Wed 16 Mar 2011 08:56:30 PM UTC, comment #6: 

It's finally all good.  I checked in the patch here (http://hg.savannah.gnu.org/hgweb/octave/rev/e742720c5e71).

Rik <rik5>
Group administrator
Wed 16 Mar 2011 06:18:26 PM UTC, comment #5: 

Rik,

I prepared a new changeset, I left the random vector in
the first test (as that test should really work for any
input) while I removed the random data from the second test.

Whith this version of the changeset I get:


>> passed = 0;
>> for ii=1:1e3
passed += test ('mgorth');
endfor
>> passed/ii
ans =  1
>>


c.

(file #22938)

Carlo de Falco <cdf>
Group Member
Wed 16 Mar 2011 04:53:55 AM UTC, comment #4: 

Could you also choose a fixed set of test vectors for mgorth?  I find that those tests, mostly the second one, also fail if run repeatedly.

Rik <rik5>
Group administrator
Fri 11 Mar 2011 12:18:37 PM UTC, comment #3: 

Yes it is possible that the test occasionally fail as the internal check is done on the residual while the test checks for the error.
I agree that using non-random input is probably better in this case, so I modified again the patch.
mgorth_gmres_take6.changeset is attached.
Anything else to be done before this can be applied?
c.





(file #22895)

Carlo de Falco <cdf>
Group Member
Fri 11 Mar 2011 04:16:12 AM UTC, comment #2: 

I took a look at the code and made some changes necessary before importing it into the core.  One issue I have is that the built-in tests occasionally fail.  I "fixed" the issue for gmres by saving/restoring the random seed and always using the same random values for the test.  However, I'm not sure if this is the best approach.  Do you expect the algorithm to occasionally exceed the tolerance?  If so, should the test be written with a fixed set of input vectors?

To see the problem, try something like this:

pass = 0;
for i = 1:100
  pass += test ("gmres");
endfor


A new patch, mgorth_gmres_take5.changeset, is attached.

(file #22892)

Rik <rik5>
Group administrator
Sat 26 Feb 2011 07:21:37 PM UTC, comment #1: 

I just updated the changeset
to fix a typo in the code to
check the input parameters.

The corrected patch is:

mgorth_gmres_take4.changeset

c.

Carlo de Falco <cdf>
Group Member
Sun 13 Feb 2011 08:47:55 PM UTC, original submission:  

This patch adds the gmres function which was
listed as missing in the wiki.
The function is based on pgmres.m which was in
the linear-algebra package of octave-forge,
but changes the interface to be more compatible with matlab.
mgorth.cc implements the modified gram-schmidt
orthogonalization which is a step in the algorithm, but is also useful by itself.
This version the changeset includes changes suggested in this thread on the developers mailing list:

http://octave.1599824.n4.nabble.com/CHANGESET-gmres-Re-Last-review-of-PROJECTS-file-before-release-td3299396.html

c.

Carlo de Falco <cdf>
Group Member

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #22938:  mgorth_gmres_take7.changeset added by cdf (13KiB - application/octet-stream)
file #22895:  mgorth_gmres_take6.changeset added by cdf (13KiB - application/octet-stream - use non random matrix for tests)
file #22892:  mgorth_gmres_take5.changeset added by rik5 (13KiB - application/octet-stream)
file #22789:  mgorth_gmres_take4.changeset added by cdf (13KiB - application/octet-stream - fixed a minor bug in input parameter list parsing)
file #22675:  mgorth_gmres_take3.changeset added by cdf (13KiB - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by rik5 (Updated the item)
  • -email is unavailable- added by cdf (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 logged-in users can vote.

     

    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2011-03-16 rik5 Open/ClosedOpen Closed
    2011-03-16 cdf Attached File- Added mgorth_gmres_take7.changeset, #22938
    2011-03-11 cdf Attached File- Added mgorth_gmres_take6.changeset, #22895
    2011-03-11 rik5 Attached File- Added mgorth_gmres_take5.changeset, #22892
    2011-02-26 cdf Attached File- Added mgorth_gmres_take4.changeset, #22789
    2011-02-13 cdf Attached File- Added mgorth_gmres_take3.changeset, #22675

    Back to the top

    Powered by Savane 3.13-caa5.
    Corresponding source code