Mathc matrices/00b
Installer et compiler ces fichiers dans votre répertoire de travail.
c00a.c |
---|
/* ------------------------------------ */
/* Save as : c00a.c */
/* ------------------------------------ */
#include "v_a.h"
/* ------------------------------------ */
void fun(int r)
{
double **U = r_mR( i_mR(R1, r),9);
double **V = r_mR( i_mR(r ,C1),9);
double **A = rHankel_mR(U,V,i_mR(r , r) );
double **Q = i_mR(r,r);
double **R = i_mR(r,r);
clrscrn();
printf(" A :");
P_mR(A,S5,P3,C7);
printf(" Copy/Past into the octave windows \n\n");
p_Octave_mR(A,"a",P0);
printf(" [Q, R] = qr (a,0) \n\n");
stop();
clrscrn();
QR_mR(A,Q,R);
printf(" Q :");
p_mR(Q,S8,P4,C7);
printf(" R :");
p_mR(R,S8,P4,C7);
stop();
clrscrn();
printf(" A :");
p_mR(A,S5,P3,C7);
printf(" A = Q * R :");
mul_mR(Q,R, A);
p_mR(A,S5,P3,C7);
f_mR(A);
f_mR(Q);
f_mR(R);
}
/* ------------------------------------ */
int main(void)
{
time_t t;
srand(time(&t));
do
{
fun(rp_I(RC5)+C2);
} while(stop_w());
return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */
Matrice de Hankel.
Exemple de sortie écran :
A :
+9.000, -7.000, +8.000, +9.000,
-7.000, +8.000, +9.000, -4.000,
+8.000, +9.000, -4.000, +1.000,
+9.000, -4.000, +1.000, +2.000
Copy/Past into the octave windows
a=[
+9,-7,+8,+9;
-7,+8,+9,-4;
+8,+9,-4,+1;
+9,-4,+1,+2]
[Q, R] = qr (a,0)
Press return to continue.
Q :
+0.5427 -0.3150 +0.6229 +0.4672
-0.4221 +0.4329 +0.7616 -0.2332
+0.4824 +0.8393 -0.1477 +0.2024
+0.5427 -0.0944 +0.1007 -0.8285
R :
+16.5831 -5.0051 -0.8442 +8.1408
+0.0000 +13.5996 -2.0755 -3.9159
+0.0000 +0.0000 +12.5292 +2.6135
+0.0000 -0.0000 -0.0000 +3.6827
Press return to continue.
A :
+9.000 -7.000 +8.000 +9.000
-7.000 +8.000 +9.000 -4.000
+8.000 +9.000 -4.000 +1.000
+9.000 -4.000 +1.000 +2.000
A = Q * R :
+9.000 -7.000 +8.000 +9.000
-7.000 +8.000 +9.000 -4.000
+8.000 +9.000 -4.000 +1.000
+9.000 -4.000 +1.000 +2.000
Press return to continue
Press X return to stop