/***************************************************************************/ /* Procedure d'inversion de matrice par la methode d'elimination de Gauss */ /* avec pivot total. le 16/08/90. O Strauss. */ /***************************************************************************/ #include "stdio.h" #include "math.h" #include "stdlib.h" #include "Definitions.h" #include "Gauss.h" #define EPS 1e-200 double Pivot_max(double *M,int *lm,int *cm,int k,int N) { int i,j ; double pivot,Mij ; lm[k]=k ; cm[k]=k ; pivot = (* (M+(k*N)+k) ) ; i=k ; j=k ; for(j=k ; j Fabs(pivot) ) { pivot = Mij ; lm[k] = i ; cm[k] = j ; } } } return(pivot) ; } void ech_co(double *M,int j,int k,int N,int sens) { int i ; double sol ; for(i=0 ; i=0 ; k--) { /* echange de colonnes */ il=lm[k] ; if(k!=il) ech_co(M,k,il,N,1) ; /* echange de lignes */ jc=cm[k] ; if(k!=jc) ech_li(M,k,jc,N,1) ; } DESALLOCATION(lm) ; DESALLOCATION(cm) ; return(det) ; } int PseudoInverse(double *A, int Nlin, int Ncol) { double *ATA, *AT ; int lin, col, k ; double *pt, *pt1, *pt2 ; double determinant ; ATA = ALLOCATION( Ncol*Ncol, double) ; if(ATA==NULL) return 0 ; AT = ALLOCATION( Nlin*Ncol, double) ; if(AT==NULL) { DESALLOCATION(ATA) ; return 0 ; } pt = ATA ; for( lin=0 ; lin