Mathc complexes/Fichiers c :mmul c

Application

Installer et compiler ce fichier dans votre répertoire de travail.

M_mulC.c
/* ------------------------------------ */
/*  Save as :   M_mulC.c                */
/* ------------------------------------ */
#include "w_a.h"
/* ------------------------------------ */
void fun(int r,int c)
{               
double **A = r_mZ(i_mZ(r,c),9); 

int c1 = C3;

nb_Z z = i_Z(100,0);

 clrscrn();
 
 printf(" A : \n");
 p_mZ(A, S5,P0, S3,P0, C6);

 printf(" multiply column C%d by ",c1);
 p_Z(z, S1,P0, S1,P0); 
 printf("\n\n\n");
 
 printf(" A : \n");
 p_mZ(M_mulC_mZ(A,z,c1), S5,P0, S4,P0, C6);

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

  srand(time(&t));
  
   do 
        fun(rp_I(R3)+R2,rp_I(C3)+C3);
        
    while(stop_w());
        
  return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */


La fonction M_mulC_mZ(); multiplie une colonne par z.


Exemple de sortie écran :

 A : 

   -4 -2i    -1 -9i    -2 +4i    +9 -1i    -9 -4i 
   -8 +5i    -8 -1i    -5 -3i    +1 +3i    -8 +1i 
   +5 +4i    +7 -1i    +3 -3i    +4 +3i    +1 -9i 
   -1 -1i    +3 -6i    +1 -8i    +5 -4i    -6 +6i 

 multiply column C3 by +100+0i 


 A : 

   -4  -2i    -1  -9i  -200+400i    +9  -1i    -9  -4i 
   -8  +5i    -8  -1i  -500-300i    +1  +3i    -8  +1i 
   +5  +4i    +7  -1i  +300-300i    +4  +3i    +1  -9i 
   -1  -1i    +3  -6i  +100-800i    +5  -4i    -6  +6i 


 Press return to continue
 Press X      to stop