4.25

4.2 | 4 ratings Rate this file 31 downloads (last 30 days) File Size: 2.01 KB File ID: #4671

Fast Pentadiagonal System Solver

by Greg von Winckel

 

23 Mar 2004 (Updated 26 Mar 2004)

Code covered by the BSD License  

Solves symmetric and asymmetric pentadiagonal systems.

Download Now | Watch this File

File Information
Description

Solves the problem Ax=b when A is pentadiagonal (5-banded) and strongly nonsingular. This is much faster than x=A\b for large matrices. The algorithm will check to see if A is symmetric and use a more efficient algorithm if it is. Users are encouraged to improve and redistribute this script.

Acknowledgements

The author wishes to acknowledge the following in the creation of this submission:
Fast Tridiagonal System Solver

MATLAB release MATLAB 6.0 (R12)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (5)
26 Apr 2004 Jagadeesha Kumar

Thanks a lot for this matlab code.. This has really made the execution of programs faster.. Thanks again...

17 Aug 2004 Bastiaan Huisman

Great Stuff!

14 Apr 2007 Mohd osman  
30 Jul 2007 Hassan R.

You can make slight changes to the code to fit your problem. You can save a lot of computation time.

08 Dec 2007 Tim Davis

For production use, this function is superseded by x=A\b in MATLAB, which now includes a test for banded matrices (and uses LAPACK). I compared it in MATLAB 7.5 with A=spdiags(rand(n,5),-2:2,n,n); A=A+A'+10*speye(n) which is symmetric and positive definite. This pentsolve function was from 20x to 230x slower than x=A\b, as n increased from 100 to 10,000. The slowdown is linear; that is, this function seems to behave like O(n^2) time (which is surprising since the code doesn't have an O(n^2) behavior in it). The same thing occurs with unsymmetric banded matrices.

The accuracy of this function is fine. Its purpose now on the File Exchange is now no longer the need for speed; it's only for illustrating an algorithm (for which it's still useful).

Thus, if you're looking just to solve Ax=b for your pentadiagonal system, just use x=A\b. If you want to read the code to understand an algorithm, then this code is still useful.

Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
linear algebra Greg von Winckel 22 Oct 2008 07:16:58
pentadiagonal Greg von Winckel 22 Oct 2008 07:16:58
5band Greg von Winckel 22 Oct 2008 07:16:58
matrix Greg von Winckel 22 Oct 2008 07:16:58
sparse Greg von Winckel 22 Oct 2008 07:16:58
solver Greg von Winckel 22 Oct 2008 07:16:58
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com