Mathc matrices/00j
Apparence
Installer et compiler ces fichiers dans votre répertoire de travail.
c00a.c |
---|
/* ------------------------------------ */
/* Save as : c00a.c */
/* ------------------------------------ */
#include "v_a.h"
/* ------------------------------------ */
#define FACTOR_E +1.E-0
/* ------------------------------------ */
void fun(int r)
{
double **U = r_mR( i_mR(R1, r),9);
double **V = r_mR( i_mR(r ,C1),9);
double **A = rToeplitz_mR(U,V,i_mR(r , r) );
double **Pinv = i_mR(r,r);
double **Ide = i_mR(r,r);
clrscrn();
printf(" A :");
p_mR(A,S3,P0,C7);
printf(" Pinv = V * invS_T * U_T ");
Pinv_Rn_mR(A,Pinv,FACTOR_E);
pE_mR(Pinv,S8,P3,C7);
printf(" Ide = Pinv * A ");
mul_mR(Pinv,A,Ide);
p_mR(Ide,S8,P2,C7);
f_mR(U);
f_mR(V);
f_mR(A);
f_mR(Pinv);
f_mR(Ide);
}
/* ------------------------------------ */
int main(void)
{
time_t t;
srand(time(&t));
do
{
fun(rp_I(R4)+R1);
} while(stop_w());
return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */
Matrice de Toeplitz.
Exemple de sortie écran :
A :
+9 -6 -2 -2 +7
-9 +9 -6 -2 -2
+3 -9 +9 -6 -2
-1 +3 -9 +9 -6
-9 -1 +3 -9 +9
Pinv = V * invS_T * U_T
+5.237e-02 +3.607e-02 -1.611e-02 -8.214e-02 -9.105e-02
-2.640e-02 +4.142e-02 -8.901e-02 -1.381e-01 -8.214e-02
-9.400e-02 -8.461e-02 -4.982e-02 -8.901e-02 -1.611e-02
-7.660e-02 -1.455e-01 -8.461e-02 +4.142e-02 +3.607e-02
+4.162e-03 -7.660e-02 -9.400e-02 -2.640e-02 +5.237e-02
Ide = Pinv * A
+1.00 +0.00 -0.00 -0.00 -0.00
+0.00 +1.00 -0.00 -0.00 -0.00
-0.00 -0.00 +1.00 -0.00 -0.00
-0.00 -0.00 -0.00 +1.00 +0.00
-0.00 -0.00 -0.00 +0.00 +1.00
Press return to continue
Press X return to stop