Be the first to rate this file! 4 Downloads (last 30 days) File Size: 3.03 KB File ID: #27762

Small size linear solver

by Bruno Luong

 

27 May 2010 (Updated 28 May 2010)

Linear solver of multiple 2x2 and 3x3 systems

| Watch this File

File Information
Description

Solve multiple (2x2) or (3x3) linear systems:

A(:,:,k)*X(:,:,k) = B(:,:,k) for k=1,2,...,N

The method used here is basic cofactor/determinant.

DISADVANTAGE: This method may be less accurate than Matlab backslash (using in for-loop) when the matrices are ill-conditioned.

ADVANTAGE: for a large number of systems - the speed-up is about 15-30 fold.

Acknowledgements

The author wishes to acknowledge the following in the creation of this submission:
MTIMESX - Fast Matrix Multiply with Multi-Dimensional Support

MATLAB release MATLAB 7.10 (2010a)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (3)
29 May 2010 Yvan Lengwiler

Bruno, I tried to run your benchmark file (bench_inv2inv3.m) but ended up with an error:
??? Undefined function or method 'mtimesx' ...
A file seems to be missing.

29 May 2010 Yvan Lengwiler

Bruno. Please ignore my previous comment. I overlooked that another MathCentral submission is required for your program to run.

10 Aug 2010 James Tursa

FYI, I just uploaded a new version of MTIMESX that does small matrix multiplies (first two dimensions <= 4) with inline code in 'SPEED' mode. This runs faster than the previous version.

Please login to add a comment or rating.
Updates
28 May 2010

Make sure calling MTIMESX with SPEED option
Modification of H1 lines

Tag Activity for this File
Tag Applied By Date/Time
liner solver Bruno Luong 27 May 2010 11:43:25
determinant Bruno Luong 27 May 2010 11:43:25
cofactor Bruno Luong 27 May 2010 11:43:25
small systems Bruno Luong 27 May 2010 11:43:25
matrix Bruno Luong 27 May 2010 11:43:25
3x3 Bruno Luong 27 May 2010 11:43:25
2x2 Bruno Luong 27 May 2010 11:43:25
matrices Bruno Luong 28 May 2010 09:40:55

Contact us at files@mathworks.com