Mathc matrices/001
Apparence
Installer et compiler ces fichiers dans votre répertoire de travail.
c0a5.c |
---|
/* ------------------------------------ */
/* Save as : c0a5.c */
/* ------------------------------------ */
#include "v_a.h"
/* ------------------------------------ */
void fun(int r)
{
double **A = rlower_mR(i_mR(r,r),999.);
double **EigsVector= i_mR(r,r);
double **EigsValue = i_mR(r,C1);
clrscrn();
printf(" Copy/Past into the octave windows \n\n");
p_Octave_mR(A,"a",P0);
printf(" [V, E] = eigs (a,%d) \n\n",r);
stop();
clrscrn();
eigs_V_mR(A,EigsVector);
printf(" EigsVector:");
p_mR(EigsVector,S5,P6,C6);
eigs_mR(A,EigsValue);
printf(" EigsValue :");
p_mR(EigsValue,S13,P6,C1);
f_mR(A);
f_mR(EigsVector);
f_mR(EigsValue);
}
/* ------------------------------------ */
int main(void)
{
time_t t;
srand(time(&t));
do
{
fun(rp_I(R4)+R2);
} while(stop_w());
return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */
Je vérifies que les valeurs propres de la matrice triangulaire inférieure A, correspondent bien aux valeurs qui se trouvent sur la diagonale.
Exemple de sortie écran :
Copy/Past into the octave windows
a=[
+694,+0,+0,+0;
-327,-91,+0,+0;
-625,+278,-710,+0;
+214,-424,+582,+940]
[V, E] = eigs (a,4)
Press return to continue.
EigsVector:
+0.000000 +0.000000 +0.798790 +0.000000
+0.000000 +0.000000 -0.332744 +0.902926
+0.000000 +0.943054 -0.421472 +0.405514
+1.000000 -0.332641 -0.271252 +0.142416
EigsValue :
+940.000000
-710.000000
+694.000000
-91.000000
Press return to continue
Press X return to stop