On Wed, Mar 2, 2011 at 9:05 AM, sguazt <marco.guazzone@gmail.com> wrote:
Sorry, but I don't understand why you can't use

http://www.crystalclearsoftware.com/cgi-bin/boost_wiki/wiki.pl?LU_Matrix_Inversion

It is based on LU factorization (which is part of uBLAS).
 
I am using this function.  It was my starting point.  I just wanted to use an "official" method if that was an option.
 
Apart from checking at the beginning if the input matrix is square,
what kind of other "checks" does it lack?
 
That is one of the checks I added.  I also check if the inverse matrix is the same size as the input matrix.  If the inverse is a different size I resize it to match the input matrix.  A try/catch was also needed around the lu_substitute if it failed.
  
Personally I use (a variant of) the one above,
 
This is what I wanted to avoid by using an "official" method.  I may not have caught everything in my variant of the function and would really like it not to give me problems.
 
Ryan