golem is hosted by Hepforge, IPPP Durham

src/kinematic/inverse_matrice [ Modules ]

[ Top ] [ Modules ]

NAME

  Module inverse_matrice

USAGE

  use inverse_matrice

DESCRIPTION

 This module provides some routines and tools to inverse a n x n matrix. 

OUTPUT

  This module exports two routines:
  * inverse -- to inverse a nXn matrix
  * imprime_mat -- to print a nXn matrix

USES

  * precision (src/module/precision_golem.f90)
  * equal (src/module/equal.f90)
  * s_matrix_type (src/module/s_matrix_type.f90)
  * constante (src/module/constante.f90)

src/kinematic/inverse_matrice/imprime_mat [ Functions ]

[ Top ] [ Functions ]

NAME

  Subroutine imprime_mat

USAGE

  call imprime_mat(mat)

DESCRIPTION

  This routine prints a n x n matrix

INPUTS

  * mat -- a real/complex (type ki) array of rank 2

SIDE EFFECTS

  No side effect

RETURN VALUE

  No value returned

EXAMPLE

 WARNING: swapped lines and columns! mat(line, column)

src/kinematic/inverse_matrice/inverse [ Functions ]

[ Top ] [ Functions ]

NAME

  Subroutine inverse

USAGE

  call inverse(mat,inv_mat,error,pinch1,pinch2,pinch3,pinch4,pinch5)

DESCRIPTION

 This routine first tries the Gauss method with partial pivoting strategy. 
 If the error returned is too large (greater than the global variable accuracy_par),
 then it switches to another method : the Greville method.
 In the case of the Gauss method, if some reduced matrices need to be inverted, a new matrix is built
 by removing the row(s) and column(s) pinch1,pinch2, etc. then the inverse is computed and the result returned
 is a nXn matrix where the column(s) and row(s) pinch1, pinch2, etc. are filled by 0, the other elements
 are those of the inverse computed. In the Greville method, the reduce matrix which is a nXn matrix
 where the column(s) and row(s) pinch1, pinch2, etc. are filled by 0 is directly inverted.
 Note that the error is computed in the following way:
 first the matrix is rescaled : i. e. divided by the greatest (in absolute value) element
 then the inverse is computed and the two matrices abs(1 - A^(-1) A) and abs(1 - A A^(-1)) are computed
 the error is the greatest element of these two matrices.
 In the case of the Greville method, the Moore_Penrose conditions are also tested

INPUTS

  * mat -- a real/complex (type ki) array of rank 2, or an s_matrix_poly type.
  * pinch1 -- an integer (optional), specified a pinch
  * pinch2 -- an integer (optional), specified a pinch
  * pinch3 -- an integer (optional), specified a pinch
  * pinch4 -- an integer (optional), specified a pinch
  * pinch5 -- an integer (optional), specified a pinch

SIDE EFFECTS

  No side effect

RETURN VALUE

  * inv_mat -- a real (type ki) array of rank 2, same shape, the inverse 
               of the matrix mat
  * error -- a real (type ki), the estimation of the error of the numerical inversion

EXAMPLE