Mathc matrices/03m
Apparence
Installer et compiler ces fichiers dans votre répertoire de travail.
c00a.c |
---|
/* ------------------------------------ */
/* Save as : c00a.c */
/* ------------------------------------ */
#include "v_a.h"
/* ------------------------------------ */
#define RCA RC4
#define EVALUE RC1
/* ------------------------------------ */
/* ------------------------------------ */
void fun(void)
{
double a[RCA*RCA] ={
-84, -39, +22, -55,
-39, +27, -33, +6,
+22, -33, +45, +44,
-55, +6, +44, +54
};
double **A = ca_A_mR(a, i_mR(RCA,RCA));
double **EigsValue = eigs_mR(A, i_mR(RCA,RCA));
double **V = i_mR(RCA,RCA);
double **b_free = i_mR(RCA,RCA);
double **Ab = i_Abr_Ac_bc_mR(RCA,RCA,C1);
double **b = m0_mR( i_mR(RCA,C1));
double **Ide = eye_mR( i_mR(RCA,RCA));
double **sIde = i_mR(RCA,RCA);
double **AmnssIde = i_mR(RCA,RCA);
clrscrn();
printf(" A :");
p_mR(A, S8,P0, C4);
smul_mR(EigsValue[EVALUE][C1],Ide,sIde);
MmnsD_mR(A,sIde,AmnssIde);
c_A_b_Ab_mR(AmnssIde,b,Ab);
GJ_PP_FreeV_mR(Ab,b_free);
c_c_mR(b_free,C2,V,EVALUE);
Normalize_mR(V);
printf(" V%d :",EVALUE);
p_mR(V, S9,P5, C4);
printf("\n\n\n\n\n\n\n\n");
stop();
f_mR(EigsValue);
f_mR(Ab);
f_mR(b);
f_mR(b_free);
f_mR(Ide);
f_mR(sIde);
f_mR(AmnssIde);
}
/* ------------------------------------ */
int main(void)
{
fun();
return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */
Calculer un vecteur propre
Exemple de sortie écran :
A :
-84 -39 +22 -55
-39 +27 -33 +6
+22 -33 +45 +44
-55 +6 +44 +54
V1 :
+0.90727 -nan -nan -nan
+0.19259 -nan -nan -nan
-0.17429 -nan -nan -nan
+0.33076 -nan -nan -nan
Press return to continue.