Mathc matrices/a78
Application
Installer et compiler ces fichiers dans votre répertoire de travail.
/* Save as : c00b.c */
void fun(void)
int n = 10; 
int i = 0; 
double **A = rE_mR(i_mR(RCA,RCA),999,+1.E-3); 
double **A_n = i_mR(RCA,RCA);
double **sA = i_mR(RCA,RCA);
double **ExpA = i_mR(RCA,RCA); 
double **NewExpA = i_mR(RCA,RCA); 
 clrscrn(); 
 printf(" Copy/Past into the octave window. \n\n");
 p_Octave_mR(A, "A", P3);
 printf(" expm (A)\n\n");
 stop(); 
 clrscrn(); 
 printf(" A :");
 p_mR(A,S4,P4,C6);
 for(i = 0; i <= n; i++)
 pow_mR(i, A, A_n); 
 smul_mR(1./factorial(i), A_n, sA); 
 add_mR(ExpA,sA,NewExpA);
 printf(" NewExpA n = %d :",i);
 p_mR(NewExpA,S8,P6,C6); 
 c_mR(NewExpA,ExpA);
 stop();
 clrscrn(); 
 printf(" ExpA :");
 p_mR(ExpA,S8,P6,C6);
 f_mR(A);
 f_mR(A_n);
 f_mR(sA);
 f_mR(ExpA);
 f_mR(NewExpA);
/* ------------------------------------ */
int main(void)
time_t t;
 srand(time(&t));
do
 fun();
} while(stop_w());
 return 0;
/* ------------------------------------ */
 ExpA = Ide + A + (1/2) A**2 + (1/6) A**3 + ... + 1/(n-1)! A**(n-1)
 Exemple de sortie écran :
 Copy/Past into the octave window. 
 A=[
-0.580,-0.577,-0.752,-0.562;
+0.179,-0.617,-0.719,-0.452;
-0.625,+0.309,-0.478,+0.061;
+0.701,-0.277,+0.500,+0.474]
 expm (A)
 Press return to continue. 
/* ------------------------------------ */
 A :
-0.5800 -0.5770 -0.7520 -0.5620 
+0.1790 -0.6170 -0.7190 -0.4520 
-0.6250 +0.3090 -0.4780 +0.0610 
+0.7010 -0.2770 +0.5000 +0.4740 
 NewExpA n = 0 :
+1.000000 +0.000000 +0.000000 +0.000000 
+0.000000 +1.000000 +0.000000 +0.000000 
+0.000000 +0.000000 +1.000000 +0.000000 
+0.000000 +0.000000 +0.000000 +1.000000 
 Press return to continue. 
 NewExpA n = 1 :
+0.420000 -0.577000 -0.752000 -0.562000 
+0.179000 +0.383000 -0.719000 -0.452000 
-0.625000 +0.309000 +0.522000 +0.061000 
+0.701000 -0.277000 +0.500000 +1.474000 
 Press return to continue. 
/* ------------------------------------ */
 ExpA :
+0.519319 -0.319339 -0.418906 -0.461400 
+0.108749 +0.487433 -0.549794 -0.498540 
-0.328677 +0.269455 +0.687243 +0.127971 
+0.539508 -0.345931 +0.417752 +1.513893 
 Press return to continue
 Press X to stop

Mathc matrices/a79
Application
Installer et compiler ces fichiers dans votre répertoire de travail.
/* Save as : c00c.c */
double **Exp_mR(
double **A,
double **ExpA
double **A_n = i_mR(RCA,RCA);
double **sA = i_mR(RCA,RCA);
double **NewExpA = i_mR(RCA,RCA);
int n = 10; 
int i = 0; 
 for(i = 0; i <= n; i++)
 pow_mR(i, A, A_n); 
 smul_mR(1./factorial(i), A_n, sA); 
 add_mR(ExpA,sA,NewExpA); 
 c_mR(NewExpA,ExpA);

f_mR(A_n);
 f_mR(sA);
 f_mR(NewExpA);
 return (ExpA); 
/* ------------------------------------ */
void fun(void)
double **A = rE_mR(i_mR(RCA,RCA),999,+1.E-3); 
double **ExpA = i_mR(RCA,RCA); 
 clrscrn(); 
 printf(" Copy/Past into the octave window. \n");
 p_Octave_mR(A, "A", P4);
 printf(" expm (A)\n\n");
 Exp_mR(A, ExpA);
 printf(" ExpA :");
 p_mR(ExpA,S8,P6,C6);
 f_mR(A);
 f_mR(ExpA);
/* ------------------------------------ */
int main(void)
time_t t;
 srand(time(&t));
do
 fun();
} while(stop_w());
 return 0;
/* ------------------------------------ */
 ExpA = Ide + A + (1/2) A**2 + (1/6) A**3 + ... + 1/(n-1)! A**(n-1)
 Exemple de sortie écran :
 Copy/Past into the octave window. 
 A=[
+0.3230,+0.4220,+0.4330,+0.4660;
+0.4080,+0.9810,-0.8480,+0.7700;
+0.9930,+0.1970,-0.7240,-0.4430;
-0.2110,-0.7220,-0.8730,-0.7070]
 expm (A)
 ExpA :
+1.534408 +0.620268 +0.022490 +0.571371 
-0.019000 +2.058830 -1.292284 +1.109739 
+0.997799 +0.608442 +0.508767 +0.105784 
-0.577654 -1.040181 -0.126381 +0.171784 
 Press return to continue
 Press X to stop

Mathc matrices/a80
Application
Installer et compiler ces fichiers dans votre répertoire de travail.
/* Save as : c00d.c */
double **Exp_mR(
double **A,
double **ExpA
double **A_n = i_mR(RCA,RCA);
double **sA = i_mR(RCA,RCA);
double **NewExpA = i_mR(RCA,RCA);
int n = 10; 
int i = 0; 
 for(i = 0; i <= n; i++)
 pow_mR(i, A, A_n); 
 smul_mR(1./factorial(i), A_n, sA); 
 add_mR(ExpA,sA,NewExpA); 
 c_mR(NewExpA,ExpA);

f_mR(A_n);
 f_mR(sA);
 f_mR(NewExpA);
 return (ExpA); 
/* ------------------------------------ */
void fun(void)
double **A = i_mR(RCA,RCA) ; 
double **B = i_mR(RCA,RCA) ;
double **ExpA = i_mR(RCA,RCA); 
double **ExpB = i_mR(RCA,RCA); 
double **AplsB = i_mR(RCA,RCA); 
double **ExpAplsB = i_mR(RCA,RCA);
 r_commute2_mR(A,B,9);
 add_mR(A,B,AplsB);
 clrscrn(); 
 printf(" Copy/Past into the octave window. \n\n");
 p_Octave_mR(A, "A", P12);
 printf(" expm (A)\n\n");
 p_Octave_mR(B, "B", P12);
 printf(" expm (B)\n\n"); 
 stop();
 clrscrn(); 
 p_Octave_mR(AplsB, "AplsB", P12);
 printf(" expm (AplsB)\n\n");
 printf(" expm (A)*expm (B)\n"); 
 printf(" expm (B)*expm (A)\n\n"); 
 stop();
 clrscrn(); 
 Exp_mR(A, ExpA);
 Exp_mR(B, ExpB);
 Exp_mR(AplsB, ExpAplsB);
 printf(" ExpA :");
 p_mR(ExpA,S8,P6,C6);
 printf(" ExpB :");
 p_mR(ExpB,S8,P6,C6);
 stop();
 clrscrn();
 printf(" ExpAplsB=:");
 p_mR( ExpAplsB,S10,P6,C6); 
 printf(" ExpA * ExpB:");
 mul_mR(ExpA,ExpB,A);
 p_mR(A,S10,P6,C6); 
 printf(" ExpB * ExpA:");
 mul_mR(ExpB,ExpA,A);
 p_mR(A,S10,P6,C6); 
 f_mR(A);
 f_mR(ExpA);
 f_mR(B);
 f_mR(ExpB);
 f_mR(AplsB);
 f_mR(ExpAplsB); 
/* ------------------------------------ */
int main(void)
time_t t;
 srand(time(&t));
do
 fun();
} while(stop_w());
 return 0;
/* ------------------------------------ */
 ExpA = Ide + A + (1/2) A**2 + (1/6) A**3 + ... + 1/(n-1)! A**(n-1)
 Exemple de sortie écran :
 Copy/Past into the octave window. 
 A=[
+0.277,+1.072,+0.512,+0.144;
+0.118,+0.601,-0.109,-0.060;
-0.590,+1.227,+1.458,+0.255;
+0.493,-1.070,-0.549,+0.583]
 expm (A)
 B=[
-0.787,+1.109,-0.278,-0.510;
+0.337,-0.687,-0.785,-0.624;
-0.709,+1.197,+0.594,+0.669;
+0.318,-1.081,-0.241,-0.560]
 expm (B)
 Press return to continue. 
 ------------------------------------ 
 AplsB=[
-0.510,+2.181,+0.235,-0.366;
+0.455,-0.086,-0.893,-0.684;
-1.299,+2.424,+2.052,+0.924;
+0.811,-2.152,-0.790,+0.023]
 expm (AplsB)
 expm (A)*expm (B)
 expm (B)*expm (A)
 Press return to continue. 
 ------------------------------------ 
 ExpA :
+1.226483 +2.096233 +1.019268 +0.282423 
+0.213199 +1.878791 -0.198830 -0.119400 
-1.126863 +2.400553 +3.555163 +0.524578 
+0.934023 -2.091929 -1.101056 +1.783381 
 ExpB :
+0.614186 +0.599304 -0.571202 -0.611915 
+0.301209 +0.537695 -0.774294 -0.622448 
-0.448442 +0.609939 +1.431405 +0.553673 
+0.090545 -0.571959 +0.051631 +0.715039 
 Press return to continue. 
 ------------------------------------ 
 ExpAplsB=:
+0.953182 +2.322329 -0.850100 -1.289015 
+0.775205 +1.085006 -1.867286 -1.495372 
-1.515822 +2.483828 +3.900897 +1.538817 
+0.598793 -2.256653 -0.397727 +1.396136 
 ExpA * ExpB:
+0.953182 +2.322329 -0.850101 -1.289015 
+0.775205 +1.085006 -1.867287 -1.495372 
-1.515822 +2.483828 +3.900897 +1.538818 
+0.598793 -2.256653 -0.397727 +1.396136 
 ExpB * ExpA:
+0.953182 +2.322329 -0.850101 -1.289015 
+0.775205 +1.085006 -1.867287 -1.495372 
-1.515822 +2.483828 +3.900897 +1.538818 
+0.598793 -2.256653 -0.397727 +1.396136 
 Press return to continue
 Press X to stop

Mathc complexes/a126
Bibliothèque
Installer ce fichier dans votre répertoire de travail.
/* Save as : wr.h */
/* ------------------------------------ */ 
/* Rand */
/* ------------------------------------ */