Mathc complexes/Fichiers c : mul r
Installer et compiler ce fichier dans votre répertoire de travail.
mulr.c |
---|
/* ------------------------------------ */
/* Save as : mulr.c */
/* ------------------------------------ */
#include "w_a.h"
/* ------------------------------------ */
int main(void)
{
double a[R3*(C3*C2)] ={ 1,1, 2,1, 3,1,
1,1, 2,1, 3,1,
1,1, 2,1, 3,1};
double **A = ca_A_mZ(a,i_mZ(R3,C3));
nb_Z z = i_Z(10,0);
int r = R2;
clrscrn();
printf(" A : \n");
p_mZ(A, S5,P0, S4,P0, C6);
printf(" multiply row R%d by ",r);
p_Z(z,S1,P0,S1,P0);
printf("\n\n\n");
printf("A : \n");
p_mZ(mulR_mZ(A,z,r), S5,P0, S4,P0, C6);
f_mZ(A);
stop();
return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */
La fonction mulR_mZ(); multiplie la ligne r par un complexe z.
Exemple de sortie écran :
A :
+1 +1i +2 +1i +3 +1i
+1 +1i +2 +1i +3 +1i
+1 +1i +2 +1i +3 +1i
multiply row R2 by +10+0i
A :
+1 +1i +2 +1i +3 +1i
+10+10i +20+10i +30+10i
+1 +1i +2 +1i +3 +1i
Press return to continue.