Mathc matrices/c20n
Apparence
Installer et compiler ces fichiers dans votre répertoire de travail.
c00g.c |
---|
/* ------------------------------------ */
/* Save as : c00g.c */
/* ------------------------------------ */
#include "v_a.h"
#include "dot_diag.h"
/* ------------------------------------ */
void fun(int r)
{
double **A = rpdiag_mR(i_mR(r,r),9.);
double **U = r_mR(i_mR(r,r),9.);
double **Orth = i_mR(r,r);
double **D = i_mR(r,r);
clrscrn();
printf(" A :");
p_mR(A,S3,P0,C6);
printf(" u :");
p_mR(U,S3,P0,C6);
stop();
clrscrn();
orth_Diag_mR(A,U,Orth);
printf(" Orth :");
p_mR(Orth,S9,P3,C6);
mul_Diag_mR(A,Orth,Orth,D);
printf(" D : <Orth,Orth> ");
p_mR(D,S9,P3,C6);
f_mR(A);
f_mR(U);
f_mR(Orth);
f_mR(D);
}
/* ------------------------------------ */
int main(void)
{
time_t t;
srand(time(&t));
do
{
fun(rp_I(R3)+R2);
} while(stop_w());
return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */
On orthogonalise la matrice u
Exemple de sortie écran :
------------------------------------
A :
+8 +0 +0
+0 +1 +0
+0 +0 +4
u :
+9 -2 +8
+3 -9 -7
-2 -9 -1
Press return to continue.
------------------------------------
Orth :
+9.000 -0.676 +0.557
+3.000 -8.559 -8.419
-2.000 -9.294 +1.857
D : <Orth,Orth>
+673.000 -0.000 +0.000
-0.000 +422.437 +0.000
+0.000 +0.000 +87.164
Press return to continue
Press X to stop