Aller au contenu

Mathc complexes/a137

Un livre de Wikilivres.


Application


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

c00c.c
/* ------------------------------------ */
/*  Save as :   c00c.c                  */
/* ------------------------------------ */
#include "w_a.h"
/* ------------------------------------ */
void AplsB(int r)
{
double **A  = i_mZ(r,r);
double **B  = i_mZ(r,r);
double **C  = i_mZ(r,r);
double **D  = i_mZ(r,r);
double **T  = i_mZ(r,r);

  r_commute4_mZ(A,B,C,D,9);

  clrscrn();
  printf(" A : ");
  p_mZ(A,S5,P3,S5,P3,C6);                                
  printf(" B : ");
  p_mZ(B,S5,P3,S5,P3,C6);
  printf(" C : ");
  p_mZ(C,S5,P3,S5,P3,C6); 
  printf(" D : ");
  p_mZ(D,S5,P3,S5,P3,C6);        
  stop();

  clrscrn();
  printf(" AB : ");
  p_mZ(mul_mZ(A,B,T),S5,P5,S5,P5,C6);
  printf(" BA : ");
  p_mZ(mul_mZ(B,A,T),S5,P5,S5,P5,C6);
  stop();

  clrscrn();
  printf(" AC : ");
  p_mZ(mul_mZ(A,C,T),S5,P5,S5,P5,C6);
  printf(" CA : ");
  p_mZ(mul_mZ(C,A,T),S5,P5,S5,P5,C6);
  stop();

  clrscrn();
  printf(" BC : ");
  p_mZ(mul_mZ(B,C,T),S5,P5,S5,P5,C6);
  printf(" CB : ");
  p_mZ(mul_mZ(C,B,T),S5,P5,S5,P5,C6);   
  stop();

  clrscrn();
  printf(" AD : ");
  p_mZ(mul_mZ(A,D,T),S5,P5,S5,P5,C6);
  printf(" DA : ");
  p_mZ(mul_mZ(D,A,T),S5,P5,S5,P5,C6);
  stop();

  clrscrn();
  printf(" BD : ");
  p_mZ(mul_mZ(B,D,T),S5,P5,S5,P5,C6);
  printf(" DB : ");
  p_mZ(mul_mZ(D,B,T),S5,P5,S5,P5,C6); 
  stop();

  clrscrn();
  printf(" CD : ");
  p_mZ(mul_mZ(C,D,T),S5,P5,S5,P5,C6);
  printf(" DC : ");
  p_mZ(mul_mZ(D,C,T),S5,P5,S5,P5,C6); 
  
  f_mZ(A);
  f_mZ(B);
  f_mZ(C);
  f_mZ(D);
  f_mZ(T);
}
/* ------------------------------------ */
void hello(void)
{
  
  printf("\n                                                  ");
  printf("\n     Four Commutative matrices                    ");
  printf("\n            ****************                    \n");
  printf("\n                                                  ");
  printf("\n                                                  ");
  printf("\n                                                \n");
  stop();
}
/* ------------------------------------ */
int main(void)
{
time_t t;

  srand(time(&t));
  hello();
do
{
  AplsB(RC3);

} while(stop_w());

  return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */


Exemple de sortie écran :

 A : 
-0.324-0.047i -0.002+0.499i -0.209-0.730i 
+0.638-0.224i +0.260-0.444i +0.311+0.787i 
+0.218+0.605i +0.131-0.579i +0.293+0.491i 

 B : 
+0.452-0.073i +0.299-0.215i +0.185+0.204i 
+0.532+0.011i +0.385+0.183i +0.097-0.398i 
+0.373+0.197i +0.238+0.561i -0.009-0.111i 

 C : 
+0.341+0.086i -0.506+0.748i -0.473-0.908i 
-0.405-0.193i +0.906-0.652i +0.076+1.279i 
-0.461+0.134i -0.301-1.392i +1.596+0.566i 

 D : 
+0.366+0.075i -0.463+0.718i -0.447-0.879i 
-0.327-0.191i +0.922-0.626i +0.091+1.222i 
-0.407+0.164i -0.267-1.311i +1.555+0.551i 

 Press return to continue. 


 AB : 
-0.09044-0.04560i +0.16009-0.04350i +0.06924+0.00443i 
+0.37675-0.02611i -0.04261+0.03441i +0.09675-0.10017i 
+0.23122+0.19266i +0.14647+0.21711i -0.24907+0.01119i 

 BA : 
-0.09044-0.04560i +0.16009-0.04350i +0.06924+0.00443i 
+0.37675-0.02611i -0.04261+0.03441i +0.09675-0.10017i 
+0.23122+0.19266i +0.14647+0.21711i -0.24907+0.01119i 

 Press return to continue. 


 AC : 
+0.18484+0.06270i -0.42999+0.74503i -0.44775-0.93107i 
-0.20354-0.21276i +0.79300-0.65124i +0.13318+1.25856i 
-0.34327+0.24690i -0.22695-1.30848i +1.38620+0.58854i 

 CA : 
+0.18484+0.06270i -0.42999+0.74503i -0.44775-0.93107i 
-0.20354-0.21276i +0.79300-0.65124i +0.13318+1.25856i 
-0.34327+0.24690i -0.22695-1.30848i +1.38620+0.58854i 

 Press return to continue. 


 BC : 
-0.11511-0.02551i +0.18449-0.33422i +0.19818+0.42079i 
+0.06858+0.09784i -0.39313+0.29237i -0.06625-0.56293i 
+0.14084-0.12366i +0.09351+0.57822i -0.64854-0.26686i 

 CB : 
-0.11511-0.02551i +0.18449-0.33422i +0.19818+0.42079i 
+0.06858+0.09784i -0.39313+0.29237i -0.06625-0.56293i 
+0.14084-0.12366i +0.09351+0.57822i -0.64854-0.26686i 

 Press return to continue. 


 AD : 
+0.18538+0.05805i -0.40699+0.71876i -0.42946-0.90114i 
-0.17518-0.20750i +0.77694-0.62848i +0.13455+1.21264i 
-0.31891+0.25021i -0.21122-1.25417i +1.33925+0.57043i 

 DA : 
+0.18538+0.05805i -0.40699+0.71876i -0.42946-0.90114i 
-0.17518-0.20750i +0.77694-0.62848i +0.13455+1.21264i 
-0.31891+0.25021i -0.21122-1.25417i +1.33925+0.57043i 

 Press return to continue. 


 BD : 
-0.07691-0.03192i +0.20222-0.32486i +0.19994+0.40053i 
+0.12856+0.08857i -0.33300+0.28357i -0.04666-0.55169i 
+0.17272-0.08506i +0.11350+0.58590i -0.61040-0.25165i 

 DB : 
-0.07691-0.03192i +0.20222-0.32486i +0.19994+0.40053i 
+0.12856+0.08857i -0.33300+0.28357i -0.04666-0.55169i 
+0.17272-0.08506i +0.11350+0.58590i -0.61040-0.25165i 

 Press return to continue. 


 CD : 
+0.76768+0.20078i -1.28155+2.07434i -1.27359-2.56112i 
-0.79472-0.56830i +2.40887-1.81095i +0.30547+3.52084i 
-1.08773+0.55802i -0.71515-3.73108i +4.16787+1.61017i 

 DC : 
+0.76768+0.20078i -1.28155+2.07434i -1.27359-2.56112i 
-0.79472-0.56830i +2.40887-1.81095i +0.30547+3.52084i 
-1.08773+0.55802i -0.71515-3.73108i +4.16787+1.61017i 


 Press   return to continue
 Press X return to stop