Mathc matrices/c11bn
Installer et compiler ces fichiers dans votre répertoire de travail.
![]() |
c0bn.c |
---|
/* ------------------------------------ */
/* Save as : c0bn.c */
/* ------------------------------------ */
#include "v_a.h"
/* ------------------------------------ */
void fun(int r)
{
double **A = rsymmetric_mR(i_mR(r,r),999.);
double **EignVector= i_mR(r,r);
double **T_EignVector= i_mR(r,r);
double **EigsValue = i_mR(r,C1);
double **T1= i_mR(r,r);
double **T2= i_mR(r,r);
clrscrn();
printf(" Copy/Past into the octave windows \n\n");
p_octave_mR(A,"a",1,0);
printf(" [V, E] = eigs (a,10) \n\n");
stop();
clrscrn();
eignVectoruv_mR(A,EignVector);
printf(" EignVector:");
p_mR(EignVector,S10,P4,C6);
transpose_mR(EignVector,T_EignVector);
mul_mR(T_EignVector,A,T1);
mul_mR(T1,EignVector,T2);
p_mR(T2,S10,P4,C6);
eigsuv_mR(A,EigsValue);
printf(" EigsValue :");
p_mR(EigsValue,S10,P4,C1);
f_mR(A);
f_mR(EignVector);
f_mR(T_EignVector);
f_mR(EigsValue);
f_mR(T1);
f_mR(T2);
}
/* ------------------------------------ */
int main(void)
{
time_t t;
srand(time(&t));
do
{
fun(rp_I(2)+R2);
} while(stop_w());
return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */
Déclaration des fichiers h. Exemple de sortie écran :
/* ------------------------------------ */
Copy/Past into the octave windows
a=[
-559,+130,+960,-477;
+130,-329,-885,-111;
+960,-885,+20,+312;
-477,-111,+312,-703]
[V, E] = eigs (a,10)
Press return to continue.
/* ------------------------------------ */
EignVector:
-0.6234 +0.4091 +0.1336 -0.6528
+0.3652 -0.4635 +0.6248 -0.5113
+0.5697 +0.7840 +0.2467 -0.0022
-0.3917 +0.0570 +0.7286 +0.5589
-1812.2996 +0.0000 -0.0000 -0.0000
+0.0000 +1066.8702 +0.0000 -0.0000
-0.0000 +0.0000 -780.0344 +0.0000
-0.0000 +0.0000 +0.0000 -45.5362
EigsValue :
-1812.2996
+1066.8702
-780.0344
-45.5362
Press return to continue
Press X to stop