Télécharger inv33.eso

Retour à la liste

Numérotation des lignes :

inv33
  1. C INV33 SOURCE PV 18/06/19 21:15:08 9861
  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 J=1,3
  42. DO I=1,3
  43. USA(I,J) = GRAND
  44. END DO
  45. END DO
  46. GOTO 9
  47. ENDIF
  48. *
  49. UNSDET=1D0/DET
  50. *
  51. USA(1,1)= CC1 * UNSDET
  52. USA(1,2)= CC2 * UNSDET
  53. USA(1,3)= CC3 * UNSDET
  54. USA(2,1)= ( - AA(2,1)*AA(3,3) + AA(3,1)*AA(2,3) ) * UNSDET
  55. USA(2,2)= ( AA(1,1)*AA(3,3) - AA(3,1)*AA(1,3) ) * UNSDET
  56. USA(2,3)= ( - AA(1,1)*AA(2,3) + AA(2,1)*AA(1,3) ) * UNSDET
  57. USA(3,1)= ( AA(2,1)*AA(3,2) - AA(3,1)*AA(2,2) ) * UNSDET
  58. USA(3,2)= ( - AA(1,1)*AA(3,2) + AA(3,1)*AA(1,2) ) * UNSDET
  59. USA(3,3)= ( AA(1,1)*AA(2,2) - AA(2,1)*AA(1,2) ) * UNSDET
  60. *
  61. 9 CONTINUE
  62. *
  63. END
  64.  
  65.  
  66.  
  67.  

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