Friday, March 25, 2011

Inverse Matrix by the Exchange Method

After some time off, here I am again.

Here is an interesting implementation of the inverse of a matrix that I found useful when I was developing a CUDA program. This is the most efficient method to implement the inverse of a matrix in terms of memory usage, which is handy when we want to put everything in the fast but limited shared memory.

The Mathematica code is here

InverseExchange.cdf

The cuda code is next
InverseExchange.cu

5 comments:

  1. inverse matrix is always bottleneck for my cuda applications. I'm not familiar with Mathematica. So i did a search for exchange method and inverse. It results 1973 R.Chen's paper "New Matrix Inversion Algorithms Based on Exchange Method". Is this method similar with your application ? thanks

    ReplyDelete
  2. Yes, the method I implemented is similar, but my current code does not permute columns if the pivot is zero.
    Thank you for the reference.

    http://ieeexplore.ieee.org/xpl/RecentIssue.jsp?punumber=12

    ReplyDelete
  3. Hello !

    Is the code available in Matlab ?

    ReplyDelete
  4. Hello ,

    Is the code available in Matlab ?

    ReplyDelete
    Replies
    1. No, but the cuda code is simple and can translated to any language

      Delete