The SDL Component Suite is an industry leading collection of components supporting scientific and engineering computing. Please visit the SDL Web site for more information....



Invert


Unit:SDL_matrix
Class:TMatrix
Declaration:function Invert: boolean;

The method Invert calculates the inverse of a quadratic matrix and stores the result on top of the original matrix (thereby destroying the original contents). The matrix inversion is carried out using the LU-decomposition procedure (decomposition into two triangle matrices). It must not be applied to non-quadratic matrices.

The function returns the value TRUE, if the inversion has been completed successfully. In case of a FALSE value, the resulting matrix is undefined. The following reasons can cause a failure of the method Invert :

  • the matrix is not quadratic
  • the routine runs out of heap memory
  • the matrix is singular
Hint: The lower limit of the necessary free heap memory can be calculated by the equation n*((n+2)*8+2) (bytes), with 'n' being the number of columns of the matrix.

Example: This method is used in the following example program (see http://www.lohninger.com/examples.html for downloading the code): invmat



Last Update: 2007-Mai-19