MEX-files
 
In the Matlab-lab on sparse matrices, it was stated that we would fix the slow matrix-vector multiply with banded matrices. We will do that by linking Matlab with a compiled Fortran-routine from Netlib.


Fetch dgbmv.f from Netlib/BLAS. Write a MEX-file in C (you may use a wrapper m-file as well, if you like). You do not have to implement all the capabilities of dgbmv.f, it is sufficient that the MEX-file can handle y = B * x, where x and y are vectors and B is a square band matrix. It should be possible for the upper and lower bandwidths to be different.
Call your routine from Matlab and test it on some simple (i.e small) examples so you can see that everything works correctly. You should not expect much of a speedup if any, so checking speedup is not compulsory.


Back