Télécharger inv33.eso

Retour à la liste

Numérotation des lignes :

  1. C INV33 SOURCE CHAT 07/10/22 21:16:27 5921
  2. SUBROUTINE INV33(AA,USA,DET,LRET)
  3. IMPLICIT REAL*8(A-H,O-Z)
  4. IMPLICIT INTEGER(I-N)
  5.  
  6. *
  7. *--------------------------------------------------------------------
  8. * CALCUL DE L'INVERSE D'UNE MATRICE 3*3 (METHODE DES MINEURS)
  9. * H. BUNG 03-95
  10. *--------------------------------------------------------------------
  11. *
  12. * ENTREE : AA(3,3)
  13. * SORTIE : USA(3,3) ET DET , LRET (=0 OK, =1 ERREUR)
  14. *
  15. * IMPLICIT NONE
  16. *
  17. *
  18. * REAL *8 AA(3,3),USA(3,3),DET
  19. * INTEGER LRET
  20. DIMENSION AA(3,3),USA(3,3)
  21. *
  22. * REAL *8 PRECIS,GRAND,CC1,CC2,CC3,UNSDET
  23. * INTEGER I
  24. *
  25. DATA PRECIS/1D-40/,GRAND/1D+40/
  26. *
  27. *
  28. *
  29. *--- CALCUL DU DETERMINANT
  30. *
  31. CC1 = AA(2,2)*AA(3,3) - AA(3,2)*AA(2,3)
  32. CC2 = - AA(1,2)*AA(3,3) + AA(3,2)*AA(1,3)
  33. CC3 = AA(1,2)*AA(2,3) - AA(2,2)*AA(1,3)
  34. DET = AA(1,1)*CC1 + AA(2,1)*CC2 + AA(3,1)*CC3
  35. *
  36. IF(ABS(DET).GT.PRECIS) THEN
  37. LRET=0
  38. ELSE
  39. LRET=1
  40. DET=0
  41. DO I=1,9
  42. USA(I,1) = GRAND
  43. END DO
  44. GOTO 9
  45. ENDIF
  46. *
  47. UNSDET=1D0/DET
  48. *
  49. USA(1,1)= CC1 * UNSDET
  50. USA(1,2)= CC2 * UNSDET
  51. USA(1,3)= CC3 * UNSDET
  52. USA(2,1)= ( - AA(2,1)*AA(3,3) + AA(3,1)*AA(2,3) ) * UNSDET
  53. USA(2,2)= ( AA(1,1)*AA(3,3) - AA(3,1)*AA(1,3) ) * UNSDET
  54. USA(2,3)= ( - AA(1,1)*AA(2,3) + AA(2,1)*AA(1,3) ) * UNSDET
  55. USA(3,1)= ( AA(2,1)*AA(3,2) - AA(3,1)*AA(2,2) ) * UNSDET
  56. USA(3,2)= ( - AA(1,1)*AA(3,2) + AA(3,1)*AA(1,2) ) * UNSDET
  57. USA(3,3)= ( AA(1,1)*AA(2,2) - AA(2,1)*AA(1,2) ) * UNSDET
  58. *
  59. 9 CONTINUE
  60. *
  61. END
  62.  
  63.  
  64.  

© Cast3M 2003 - Tous droits réservés.
Mentions légales