patchGNU Octave - Patches: patch #8569, QMR iterative solver

 
 

patch #8569: QMR iterative solver

Submitted by:  None
Submitted on:  Tue 11 Nov 2014 01:04:04 AM UTC  
 
Category:  None Priority:  5 - Normal
Status:  Done Privacy:  Public
Assigned to:  Kai Torben Ohlhus <siko1056> Originator Email:  -email is unavailable-
Open/Closed:  Closed

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Wed 26 Nov 2014 10:34:26 PM UTC, comment #5:

Thanks Kai,

All changes look good to me. I'll see if I can get MINRES and SYMMLQ scripts up sometime soon...

Nathan

Nathan Podlich <enpey>
Tue 25 Nov 2014 03:24:02 PM UTC, comment #4:

Dear Nathan Podlich,

Finally I pushed your function to the main repository.

http://hg.savannah.gnu.org/hgweb/octave/rev/cc6000ccd627

A few small changes regarding the MATLAB compatibility were made, regarding iter, resvec, and input checking order but in general the code is left as it is.

Thank you very much for your work and sorry for the two weeks delay. And comments on the changes are still welcome!

Kai

Kai Torben Ohlhus <siko1056>
Project MemberIn charge of this item.
Mon 17 Nov 2014 11:49:38 PM UTC, comment #3:

The MATLAB compatibility issue has been discussed a lot on the maintainers list. Personally, I strive to stay as compatible to MATLAB as possible, if no bad design decisions have to be made. I use both environments and don't like to write my code twice. If you really "break" MATLAB compatibility intentionally, please make a not in the documentation, like you can find it in the spline method or on many other functions as well.

https://www.gnu.org/software/octave/doc/interpreter/One_002ddimensional-Interpolation.html#XREFspline

Anyways thank you for your clean code and big effort! I hope it will soon get attention from other maintainers.

Kai Torben Ohlhus <siko1056>
Project MemberIn charge of this item.
Mon 17 Nov 2014 09:15:26 PM UTC, comment #2:

I followed PCG and GMRES scripts in that the actual iterations start at 2, but have forgotten to reduce the iteration count before ending. I am happy for resvec to be a column-vector. (Note that the Octave BiCG script returns a row-vector that is 8x1 with iter = 9 for this case - I was having some trouble figuring out which scripts to follow, as there are considerable differences between them.)

If matching MATLAB is the aim, then should the resvec array return the residual norms instead of relative residual norms?

Nathan Podlich <enpey>
Mon 17 Nov 2014 02:32:43 PM UTC, comment #1:

This code looks good so far, but there are some MATLAB compatibility issues. Do you have a MATLAB version to compare your results?

n = 100;
on = ones(n,1);
A = spdiags([-2*on 4*on -on],-1:1,n,n);
b = sum(A,2);
tol = 1e-8; maxit = 15;
M1 = spdiags([on/(-2) on],-1:0,n,n);
M2 = spdiags([4*on -on],0:1,n,n);
[x,flag,relres,iter,resvec] = qmr(A,b,tol,maxit,M1,M2);

iter = iter
resvec = resvec
resvec = length(resvec)

MATLAB gets here 9 iterations with a 10x1 resvec of,
your code says 10 iterations with a 1x10 resvec. Maybe the number of iterations is counted differently?

Kai Torben Ohlhus <siko1056>
Project MemberIn charge of this item.
Tue 11 Nov 2014 01:04:04 AM UTC, original submission:
  • scripts/sparse/qmr.m: New script for QMR iterative solver.
Anonymous

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #32408:  qmr.diff added by None (10KiB - 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 enpey (Posted a comment)
  • -email is unavailable- added by siko1056 (Posted a comment)
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

     

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2014-11-25 siko1056 StatusNone => Done
        Assigned toNone => siko1056
        Open/ClosedOpen => Closed
    2014-11-11 None Attached File- => Added qmr.diff, #32408

    Back to the top


    Powered by Savane 3.4