Mathc matrices/c20l
Installer et compiler ces fichiers dans votre répertoire de travail.
c00c.c |
---|
/* ------------------------------------ */
/* Save as : c00c.c */
/* ------------------------------------ */
#include "v_a.h"
#include "dot_diag.h"
/* ------------------------------------ */
void fun(void)
{
double a[R2*C2]={ 2,0,
0,3};
double u[R2*C1]={ 1,
1};
double v[R2*C1]={ 3,
2};
double w[R2*C1]={ 0,
-1};
double **A = ca_A_mR(a,i_mR(R2,C2));
double **U = ca_A_mR(u,i_mR(R2,C1));
double **V = ca_A_mR(v,i_mR(R2,C1));
double **W = ca_A_mR(w,i_mR(R2,C1));
double **UplsV = add_mR(U,V,i_mR(R2,C1));
clrscrn();
printf(" A :");
p_mR(A,S3,P0,C6);
printf(" U :");
p_mR(U,S3,P0,C6);
printf(" V :");
p_mR(V,S3,P0,C6);
printf(" W :");
p_mR(W,S3,P0,C6);
printf(" UplsV :");
p_mR(UplsV,S3,P0,C6);
stop();
clrscrn();
printf(" <U+V,W> = <U,W>+<V,W> [Additivity axiom] \n\n");
printf(" <u+v,w> = %.0f \n", dot_Diag_R(A,UplsV,W));
printf(" <u,w>+<v,w> = %.0f \n\n", dot_Diag_R(A,U, W)+
dot_Diag_R(A,V, W));
f_mR(A);
f_mR(U);
f_mR(V);
f_mR(W);
f_mR(UplsV);
}
/* ------------------------------------ */
int main(void)
{
fun();
stop();
return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */
Exemple de sortie écran :
------------------------------------
A :
+2 +0
+0 +3
U :
+1
+1
V :
+3
+2
W :
+0
-1
UplsV :
+4
+3
Press return to continue.
------------------------------------
<U+V,W> = <U,W>+<V,W> [Additivity axiom]
<u+v,w> = -9
<u,w>+<v,w> = -9
Press return to continue.