Mathc matrices/c22d
Installer et compiler ces fichiers dans votre répertoire de travail.
c00b.c |
---|
/* ------------------------------------ */
/* Save as : c00b.c */
/* ------------------------------------ */
#include "v_a.h"
#include "dot_au.h"
/* ------------------------------------ */
void fun(int r)
{
double **A = r_mR( i_mR(r,r ), 9.);
double **u = r_mR( i_mR(r,C1), 9.);
clrscrn();
printf(" A :");
p_mR(A,S3,P0,C6);
printf(" u :");
p_mR(u,S3,P0,C6);
printf(" <u,u> = ||u||^2 (u^t*A^t*A*u)\n\n");
printf(" (<u,u>)^(1/2) = %.3f \n",
pow(dot_Au_R(A,u,u),(1./2.)));
printf(" ||u|| = %.3f \n\n",
norm_Au_R(A,u));
f_mR(A);
f_mR(u);
}
/* ------------------------------------ */
int main(void)
{
time_t t;
srand(time(&t));
do
{
fun(rp_I(R3)+R2);
} while(stop_w());
return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */
Nous calculons la norme.
Exemple de sortie écran :
------------------------------------
A :
-1 -9 -9 -3
+4 -5 +8 -7
-9 +8 -1 +8
+8 -5 -9 -9
u :
+2
-3
-9
-9
<u,u> = ||u||^2 (u^t*A^t*A*u)
(<u,u>)^(1/2) = 257.214
||u|| = 257.214
Press return to continue
Press X to stop