Mathc matrices/03r
Installer et compiler ces fichiers dans votre répertoire de travail.
c00a.c |
---|
/* ------------------------------------ */
/* Save as : c00a.c */
/* ------------------------------------ */
#include "v_a.h"
/* ------------------------------------ */
#define RCA RC3
#define EVALUE RC3
/* ------------------------------------ */
/* ------------------------------------ */
void fun(void)
{
double a[RCA*RCA] ={
+1.345288030, +1.760536858, -1.232763852,
+1.760536858, +4.139646496, +0.479295438,
-1.232763852, +0.479295438, +3.515065475
};
double **A = ca_A_mR(a, i_mR(RCA,RCA));
double **V = eigs_V_mR(A, i_mR(RCA,RCA));
double **V3 = c_c_mR(V,EVALUE, i_mR(RCA, C1),C1);
double **AV3 = mul_mR(A,V3, i_mR(RCA, C1));
clrscrn();
printf(" A :");
p_mR(A, S8,P5, C3);
printf(" V :");
p_mR(V, S9,P5, C4);
printf(" V%d :",EVALUE);
p_mR(V3, S8,P5, C3);
printf(" A * V%d :",EVALUE);
p_mR(AV3, S8,P5, C3);
stop();
f_mR(A);
f_mR(V);
f_mR(V3);
f_mR(AV3);
}
/* ------------------------------------ */
int main(void)
{
fun();
return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */
Vérifier A v_λ = 0 quand λ = 0 (Rappel : A v_λ = λ v_λ)
Exemple de sortie écran :
A :
+1.34529 +1.76054 -1.23276
+1.76054 +4.13965 +0.47930
-1.23276 +0.47930 +3.51507
V :
+0.45779 -0.27269 +0.84621
+0.88400 +0.24101 -0.40057
-0.09471 +0.93143 +0.35139
V3 :
+0.84621
-0.40057
+0.35139
A * V3 :
+0.00000
-0.00000
+0.00000
Press return to continue.