Mathc matrices/c21g
Installer et compiler ces fichiers dans votre répertoire de travail.
c00f.c |
---|
/* ------------------------------------ */
/* Save as : c00f.c */
/* ------------------------------------ */
#include "v_a.h"
/* ------------------------------------ */
void fun(void)
{
double u[R2*C1]={ 1,
1};
double v[R2*C1]={ 3,
2};
double k = 3;
double **U = ca_A_mR(u,i_mR(R2,C1));
double **V = ca_A_mR(v,i_mR(R2,C1));
double **kV = smul_mR(k,V,i_mR(R2,C1));
double **UmnskV = sub_mR(U,kV,i_mR(R2,C1));
clrscrn();
printf(" U :");
p_mR(U,S3,P0,C6);
printf(" V :");
p_mR(V,S3,P0,C6);
printf(" kV :");
p_mR(kV,S3,P0,C6);
printf(" U-kV :");
p_mR(UmnskV,S3,P0,C6);
printf(" ||U-kV|| = sqrt(%.0f) \n\n",
dot_R(UmnskV,UmnskV));
f_mR(U);
f_mR(V);
f_mR(kV);
f_mR(UmnskV);
}
/* ------------------------------------ */
int main(void)
{
fun();
stop();
return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */
Exemple de sortie écran :
------------------------------------
U :
+1
+1
V :
+3
+2
kV :
+9
+6
U-kV :
-8
-5
||U-kV|| = sqrt(89)
Press return to continue.