Mathc matrices/c10c
Apparence
Installer et compiler ces fichiers dans votre répertoire de travail.
c00d.c |
---|
/* ------------------------------------ */
/* Save as : c00d.c */
/* ------------------------------------ */
#include "v_a.h"
#include "dot_au.h"
/* ------------------------------------ */
void fun(int r)
{
double a[R2*C2]={ 2,1,
1,1};
double v[R2*C1]={ 3,
2};
double **A = ca_A_mR(a,i_mR(R2,C2));
double **V = ca_A_mR(v,i_mR(R2,C1));
clrscrn();
printf(" A :");
p_mR(A,S3,P0,C6);
printf(" V :");
p_mR(V,S3,P0,C6);
printf(" ||u|| = sqrt(%.0f) \n\n", dot_Au_R(A,V,V));
f_mR(A);
f_mR(V);
}
/* ------------------------------------ */
int main(void)
{
time_t t;
srand(time(&t));
fun(rp_I(R3)+R1);
stop();
return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */
Exemple de sortie écran :
------------------------------------
A :
+2 +1
+1 +1
V :
+3
+2
||u|| = sqrt(89)
Press return to continue.