matrix inversion

Go To Last Post
3 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have implemented two matrix inversion algorithms and built them into a library.  If anyone is interested in solving n equations in n unknowns on an avr I will post my code.  One method is the LU, and the other is Gauss-Jordan.  The LU method adds about 3350 bytes of flash program memory, and the Gauss-Jordan adds about 2106 bytes of flash.  I believe the LU is faster and the Gauss-Jordan produces the matrix inverse.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

hmmm, to solve linear system, one usually doesn't use matrix inversion because it's slow and numerically unstable.  Better way to go would be QR decomposition, for example.  There are also implementations that perform the computations in place to reduce memory footprint.

avrfreaks does not support Opera. Profile inactive.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi SprinterSB,

Yeah, I know the inverse is pretty much useless, which is one of the downsides of the Gauss-Jordan method for linear system solution I got out of the book "Numerical Recipes in C:  The Art of Scientific Computing", Cambridge University Press.  I attached the partial book chapter i got off the web.  That implementation does the computations in place to limit memory use to one double A{NxN} and one double b{N} and a couple int I{N} . 

 

I have a friend who is an expert in doing these linear solutions.  He parallelized a lot of the BLAS routines when he worked for Cray Research.  He sent me the LU decomposition routines out of the BLAS library to do the linear system solution, which also does things in place to limit memory use.  I think this is a modern well used method, and coming from him I think it's pretty good one.  It takes up a little more flash than the G-J method, but I think it is faster and may handle ill conditioned matrices better, although it is partial pivoting and the G-J has full pivoting.

 

Thanks for your interest,

mark

Attachment(s):