invrs
C INVRS SOURCE PV 05/09/22 21:19:15 5181 C----------------------------------------------------------------------- C Inversion d'une matrice au plus 3*3. C----------------------------------------------------------------------- C C--------------------------- C Parametres Entree/Sortie : C--------------------------- C C E/ D : Matrice a inverser. C E/ IDIM : Dimension des matrices. C /S DINV : Matrice inverse. C /S DJAC : Determinant de D. C C XZERO : Contient 0.d0 (cf CCREEL.INC) C C----------------------------------------------------------------------- C C Langage : FORTRAN77 C C Auteurs : F.DABBENE 08/93 C C----------------------------------------------------------------------- IMPLICIT INTEGER(I-N) IMPLICIT REAL*8 (A-H,O-Z) C -INC CCREEL C DIMENSION D(IDIM,*),DINV(IDIM,*) DATA UN /1.D0/ C IF (IDIM.EQ.1) THEN C-------- C CAS 1D C-------- DJAC = D(1,1) XXXX = DJAC IF (DJAC.NE.XZERO) XXXX=UN/DJAC DINV(1,1) = XXXX ELSEIF (IDIM.EQ.2) THEN C-------- C CAS 2D C-------- DJAC = D(1,1)*D(2,2) - D(2,1)*D(1,2) XXXX = DJAC IF (DJAC.NE.XZERO) XXXX=UN/DJAC DINV(1,1) = D(2,2)*XXXX DINV(1,2) =-D(1,2)*XXXX DINV(2,1) =-D(2,1)*XXXX DINV(2,2) = D(1,1)*XXXX ELSEIF (IDIM.EQ.3) THEN C-------- C CAS 3D C-------- DINV(1,1) = D(2,2)*D(3,3) - D(2,3)*D(3,2) DINV(2,2) = D(1,1)*D(3,3) - D(1,3)*D(3,1) DINV(3,3) = D(1,1)*D(2,2) - D(1,2)*D(2,1) DINV(1,2) =-D(1,2)*D(3,3) + D(3,2)*D(1,3) DINV(2,1) =-D(2,1)*D(3,3) + D(2,3)*D(3,1) DINV(1,3) = D(1,2)*D(2,3) - D(2,2)*D(1,3) DINV(3,1) = D(2,1)*D(3,2) - D(2,2)*D(3,1) DINV(2,3) =-D(1,1)*D(2,3) + D(2,1)*D(1,3) DINV(3,2) =-D(1,1)*D(3,2) + D(1,2)*D(3,1) DJAC = D(1,1)*DINV(1,1) + D(2,1)*DINV(1,2) + D(3,1)*DINV(1,3) XXXX = DJAC IF (DJAC.NE.XZERO) XXXX=UN/DJAC DO 10 IA=1,3 DO 10 IB=1,3 DINV(IA,IB) = DINV(IA,IB)*XXXX 10 CONTINUE ELSE C-------- C AUTRES C-------- ENDIF C RETURN END
© Cast3M 2003 - Tous droits réservés.
Mentions légales