Aller au contenu

Mathc matrices/c091a

Un livre de Wikilivres.


Application

Installer et compiler ces fichiers dans votre répertoire de travail.

c00a.c
/* ------------------------------------ */
/*  Save as :   c00a.c                  */
/* ------------------------------------ */
#include "v_a.h"
/* ------------------------------------ */
void fun(int r)
{
double **A    =     r_mR(   i_mR(r,r),9999);
double **InvA = invgj_mR(A, i_mR(r,r));

  clrscrn();
  printf(" A:");
  p_mR(A,S8,P0,C6);

  printf(" invgj_mR(A,invA):");
  pE_mR(InvA,S12,P4,C6);
  stop();

  clrscrn();
  printf(" Copy/Paste into the octave window.\n\n");
  p_Octave_mR(A,"A",P0);
  
  printf(" inv(A):");
  pE_mR(InvA,S12,P4,C6);

  f_mR(InvA);
  f_mR(A);
}
/* ------------------------------------ */
int main(void)
{
time_t t;

  srand(time(&t));
  
do
{
   fun(rp_I(C2)+C4);

} while(stop_w());

  return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */
Exemple de sortie écran :
 A:
   +7584    +5126    -8799    +2290    +3595 
    -574    -6860    +6301    +5440    -7283 
   -3662    +9755    +1697    -4971    +7407 
   +9748    +4017    +3549    +3160    -8204 
   -4219    -9451     -470     -472     +862 

 invgj_mR(A,invA):
 +9.9717e-05  +2.0759e-07  +1.5325e-04  +2.1370e-04  +3.0294e-04 
 -3.7934e-05  -4.8067e-06  -5.7316e-05  -8.7123e-05  -2.1908e-04 
 +5.6086e-05  +1.1143e-04  +2.2006e-04  +1.4957e-04  +2.4024e-04 
 +1.3206e-04  +2.2800e-04  +4.6782e-05  -1.1210e-04  -9.3226e-05 
 +1.7504e-04  +1.3392e-04  +2.6724e-04  +1.1090e-04  +3.2070e-04 

 Press return to continue. 


 Copy/Paste into the octave window.

 A=[
+7584,+5126,-8799,+2290,+3595;
-574,-6860,+6301,+5440,-7283;
-3662,+9755,+1697,-4971,+7407;
+9748,+4017,+3549,+3160,-8204;
-4219,-9451,-470,-472,+862]

 inv(A):
 +9.9717e-05  +2.0759e-07  +1.5325e-04  +2.1370e-04  +3.0294e-04 
 -3.7934e-05  -4.8067e-06  -5.7316e-05  -8.7123e-05  -2.1908e-04 
 +5.6086e-05  +1.1143e-04  +2.2006e-04  +1.4957e-04  +2.4024e-04 
 +1.3206e-04  +2.2800e-04  +4.6782e-05  -1.1210e-04  -9.3226e-05 
 +1.7504e-04  +1.3392e-04  +2.6724e-04  +1.1090e-04  +3.2070e-04 


 Press   return to continue
 Press X return to stop