NAME

get_matrix_inverse - Inverts a matrix

SYNOPSIS

#include "n/n_invert.h"

Example compile flags (system dependent):
  -DLINUX_X86_64 -DLINUX_X86_64_OPTERON  -DGNU_COMPILER 
   -I/home/kobus/include
   -L/home/kobus/misc/load/linux_x86_64_opteron -L/usr/lib/x86_64-linux-gnu
  -lKJB                               -lfftw3  -lgsl -lgslcblas -ljpeg  -lSVM -lstdc++                    -lpthread -lSLATEC -lg2c    -lacml -lacml_mv -lblas -lg2c      -lncursesw 


int get_matrix_inverse
(
	Matrix **target_mpp,
	const Matrix *input_mp
);

DESCRIPTION

This routine computes the inverse of a matrix. The first argument is the adress of the target matrix. If the target matrix itself is NULL, then a matrix of the appropriate size is created. If the target matrix is the wrong size, it is resized. Finally, if it is the right size, then the storage is recycled, as is. The inverse may be calculated in one of several ways. The method used can be set using the option "matrix-inversion-method" which is normally exposed to the user. If this options is "svd" (the default), then we compute the inverse using SVD. This method has the advantage that we have precise control over the degree of permisable singularity through the option "max-matrix-condition-number" which is normally exposed to the user. I would also expect that the SVD method is more stable and accurate (but I am not sure). The disadvantage of this method is that it is, in theory, a bit slower then the other method implemented which is using Gaussian elimination ("gaussian-elimination"). However, this since we normally use a nicely optimized routine for SVD, this advantage is not likely to be true in practice.

RETURNS

NO_ERROR on success, and ERROR on failure, with an error message being set. This routine will fail if the matrix is close to singulare, or if memory allocation fails.

DISCLAIMER

This software is not adequatedly tested. It is recomended that results are checked independantly where appropriate.

AUTHOR

Kobus Barnard

DOCUMENTER

Kobus Barnard

SEE ALSO

do_gaussian_elimination_matrix_inversion , get_MP_inverse , get_MP_inverse_of_transpose