Télécharger invma2.eso

Retour à la liste

Numérotation des lignes :

  1. C INVMA2 SOURCE CB215821 16/04/21 21:17:16 8920
  2. SUBROUTINE INVMA2(A,NZ,ICRIT)
  3. C
  4. C ====================================================================
  5. C INVERSION DE MATRICE A PAR LA METHODE DES DETERMINANTS
  6. C matrice limitee a la dimension 4 georgin insa
  7. C A MATRICE (NZ*NZ) A INVERSER EN ENTREE, MATRICE INVERSEE EN SORTIE
  8. C ICRIT=1 SI MATRICE SINGULIERE, 0 SINON
  9. C
  10. C ====================================================================
  11. C
  12. IMPLICIT INTEGER(I-N)
  13. IMPLICIT REAL*8(A-H,O-Z)
  14. DIMENSION A(4,4),O(4,4)
  15. CALL ZERO(O,4,4)
  16. ICRIT=0
  17. C
  18. C ************************** TRANSPOSITION ****************************
  19. C
  20. A11=A(1,1)
  21. A12=A(1,2)
  22. A13=A(1,3)
  23. A14=A(1,4)
  24. A21=A(2,1)
  25. A22=A(2,2)
  26. A23=A(2,3)
  27. A24=A(2,4)
  28. A31=A(3,1)
  29. A32=A(3,2)
  30. A33=A(3,3)
  31. A34=A(3,4)
  32. A41=A(4,1)
  33. A42=A(4,2)
  34. A43=A(4,3)
  35. A44=A(4,4)
  36. CALL ZERO(A,4,4)
  37. C
  38. C ************************** TEST SUR LA DIMENSION ********************
  39. C
  40. GOTO (1,200,300,400),NZ
  41. 1 CONTINUE
  42. DELTA=A11
  43. O(1,1)=1.D0
  44. GOTO 500
  45. 200 CONTINUE
  46. DELTA=A11*A22-A21*A12
  47. O(1,1)=A22
  48. O(1,2)=-A21
  49. O(2,1)=-A12
  50. O(2,2)=A11
  51. GOTO 500
  52. 300 CONTINUE
  53. DELTA1=A11*A22*A33+A12*A23*A31+A21*A32*A13
  54. DELTA2=A31*A22*A13+A32*A23*A11+A21*A12*A33
  55. DELTA=DELTA1-DELTA2
  56. O(1,1)=A22*A33-A32*A23
  57. O(1,2)=A31*A23-A21*A33
  58. O(1,3)=A21*A32-A31*A22
  59. O(2,1)=A32*A13-A12*A33
  60. O(2,2)=A11*A33-A31*A13
  61. O(2,3)=A31*A12-A11*A32
  62. O(3,1)=A12*A23-A22*A13
  63. O(3,2)=A21*A13-A11*A23
  64. O(3,3)=A11*A22-A21*A12
  65. GOTO 500
  66. 400 CONTINUE
  67. O(1,1)=(A22*A33*A44+A32*A43*A24+A42*A23*A34)
  68. O(1,1)=O(1,1)-(A42*A33*A24+A32*A23*A44+A43*A34*A22)
  69. O(1,2)=-(A21*A33*A44+A31*A43*A24+A41*A23*A34)
  70. O(1,2)=O(1,2)+(A41*A33*A24+A31*A23*A44+A43*A34*A21)
  71. O(1,3)=(A21*A32*A44+A31*A42*A24+A41*A22*A34)
  72. O(1,3)=O(1,3)-(A41*A32*A24+A42*A34*A21+A31*A22*A44)
  73. O(1,4)=-(A21*A32*A43+A22*A33*A41+A31*A42*A23)
  74. O(1,4)=O(1,4)+(A41*A32*A23+A42*A33*A21+A31*A22*A43)
  75. O(2,1)=-(A12*A33*A44+A32*A43*A14+A42*A13*A24)
  76. O(2,1)=O(2,1)+(A42*A33*A14+A32*A13*A44+A12*A43*A34)
  77. O(2,2)=(A11*A33*A44+A31*A43*A14+A41*A13*A34)
  78. O(2,2)=O(2,2)-(A41*A33*A14+A31*A13*A44+A11*A43*A34)
  79. O(2,3)=-(A11*A32*A44+A31*A42*A14+A41*A12*A34)
  80. O(2,3)=O(2,3)+(A41*A32*A14+A42*A34*A11+A31*A12*A44)
  81. O(2,4)=(A11*A32*A43+A31*A42*A13+A41*A12*A33)
  82. O(2,4)=O(2,4)-(A41*A32*A13+A31*A12*A43+A42*A33*A11)
  83. O(3,1)=(A12*A23*A44+A22*A43*A14+A13*A24*A42)
  84. O(3,1)=O(3,1)-(A42*A23*A14+A22*A13*A44+A43*A24*A12)
  85. O(3,2)=-(A11*A23*A44+A21*A43*A14+A41*A13*A24)
  86. O(3,2)=O(3,2)+(A41*A23*A14+A43*A24*A11+A21*A13*A44)
  87. O(3,3)=(A11*A22*A44+A21*A42*A14+A41*A12*A24)
  88. O(3,3)=O(3,3)-(A41*A22*A14+A21*A12*A44+A11*A42*A24)
  89. O(3,4)=-(A11*A22*A43+A21*A42*A13+A41*A12*A23)
  90. O(3,4)=O(3,4)+(A41*A22*A13+A21*A12*A43+A11*A42*A23)
  91. O(4,1)=-(A12*A23*A34+A22*A33*A14+A13*A24*A32)
  92. O(4,1)=O(4,1)+(A32*A23*A14+A22*A13*A34+A12*A33*A24)
  93. O(4,2)=(A11*A23*A34+A21*A33*A14+A31*A13*A24)
  94. O(4,2)=O(4,2)-(A31*A23*A14+A21*A13*A34+A33*A24*A11)
  95. O(4,3)=-(A11*A22*A34+A12*A24*A31+A21*A32*A14)
  96. O(4,3)=O(4,3)+(A31*A22*A14+A32*A24*A11+A21*A12*A34)
  97. O(4,4)=(A11*A22*A33+A21*A32*A13+A31*A12*A23)
  98. O(4,4)=O(4,4)-(A31*A22*A13+A32*A23*A11+A21*A12*A33)
  99. DELTA=A11*O(1,1)+A12*O(1,2)+A13*O(1,3)+A14*O(1,4)
  100. DELTA2=A21*O(2,1)+A22*O(2,2)+A23*O(2,3)+A14*O(2,4)
  101. GOTO 500
  102. 500 CONTINUE
  103. IF (ABS(DELTA).LT.1.D-50) THEN
  104. ICRIT=1
  105. RETURN
  106. ENDIF
  107. DO 600 I=1,NZ
  108. DO 600 J=1,NZ
  109. A(I,J)=O(I,J)/DELTA
  110. 600 CONTINUE
  111. RETURN
  112. END
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  

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