Mathc matrices/Fichiers c : mul dia5
Installer et compiler ces fichiers dans votre répertoire de travail.
c00a.c |
---|
/* ------------------------------------ */
/* ------------------------------------ */
/* Save as : c00a.c */
/* ------------------------------------ */
#include "v_a.h"
/* ------------------------------------ */
void fun(void)
{
double a[R3*C3]={ 1,2,3,
1,2,3,
1,2,3 };
double id[R3*C3]={ 0,1,0,
1,0,0,
0,0,1 };
double **A = ca_A_mR(a, i_mR(R3,C3));
double **ID = ca_A_mR(id,i_mR(R3,C3));
double **AID = mul_mR(A,ID,i_mR(R3,C3));
clrscrn();
printf(" ID :");
p_mR(ID,S3,P0,C6);
printf(" A :");
p_mR(A,S3,P0,C6);
printf(" A ID : Interchange two columns.");
p_mR(AID,S3,P0,C6);
f_mR(A);
f_mR(ID);
f_mR(AID);
}
/* ------------------------------------ */
int main(void)
{
fun();
stop();
return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */
Echanger les lignes :
+0 +1 +0 +1 +0 +0 échanger la colonne C1 et C2 +0 +0 +1
+0 +0 +1 +0 +1 +0 échanger la colonne C1 et C3 +1 +0 +1 +1 +0 +0 +0 +1 +0 échanger la colonne C2 et C3 +1 +0 +0
Exemple de sortie écran :
ID :
+0 +1 +0
+1 +0 +0
+0 +0 +1
A :
+1 +2 +3
+1 +2 +3
+1 +2 +3
A ID : Interchange two columns.
+2 +1 +3
+2 +1 +3
+2 +1 +3
Press return to continue.