Mathc matrices/c20v
Apparence
Installer et compiler ces fichiers dans votre répertoire de travail.
c00c.c |
---|
/* ------------------------------------ */
/* Save as : c00c.c */
/* ------------------------------------ */
#include "v_a.h"
#include "dot_trac.h"
/* ------------------------------------ */
void fun(void)
{
double a[R2*C2]={ 1,2,
3,4};
double b[R2*C2]={-1,0,
3,2};
double c[R2*C2]={-5,3,
4,2};
double **A = ca_A_mR(a,i_mR(R2,C2));
double **B = ca_A_mR(b,i_mR(R2,C2));
double **C = ca_A_mR(c,i_mR(R2,C2));
double **AplsB = add_mR(A,B,i_mR(R2,C2));
clrscrn();
printf(" A :");
p_mR(A,S3,P0,C6);
printf(" B :");
p_mR(B,S3,P0,C6);
printf(" C :");
p_mR(C,S3,P0,C6);
printf(" AplsB :");
p_mR(AplsB,S3,P0,C6);
stop();
clrscrn();
printf(" <A+B,C> = <A,C>+<B,C> [Additivity axiom] \n\n");
printf(" <A+B,C> = %.0f \n", dot_TR_R(AplsB,C));
printf(" <A,C>+<B,C> = %.0f \n\n", dot_TR_R(A,C)+
dot_TR_R(B,C));
f_mR(A);
f_mR(B);
f_mR(C);
f_mR(AplsB);
}
/* ------------------------------------ */
int main(void)
{
fun();
stop();
return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */
Exemple de sortie écran :
------------------------------------
A :
+1 +2
+3 +4
B :
-1 +0
+3 +2
C :
-5 +3
+4 +2
AplsB :
+0 +2
+6 +6
Press return to continue.
------------------------------------
<A+B,C> = <A,C>+<B,C> [Additivity axiom]
<A+B,C> = 42
<A,C>+<B,C> = 42
Press return to continue.