Mathc matrices/a86
Fonctions matricielles ex : cos(A)
Installer et compiler ces fichiers dans votre répertoire de travail.
c00a.c |
---|
/* ------------------------------------ */
/* Save as : c00a.c */
/* ------------------------------------ */
#include "v_a.h"
/* ------------------------------------ */
#define RCA RC5
/* ------------------------------------ */
/* ------------------------------------ */
void fun(void)
{
double **A = rEsymmetric_mR(i_mR(RCA,RCA),555.,1E-3);
double **cosh_A = i_mR(RCA,RCA);
double **EigsVector = i_mR(RCA,RCA);
double **T_EigsVector = i_mR(RCA,RCA);
double **EigsValue = i_mR(RCA,RCA);
double **cosh_EigsValue = i_mR(RCA,RCA);
double **T1 = i_mR(RCA,RCA);
clrscrn();
printf(" A :");
p_mR(A,S10,P4,C6);
/* ================================================================== */
eigs_V_mR(A,EigsVector);
transpose_mR(EigsVector,T_EigsVector);
/* EigsValue : T_EigsVector * A * EigsVector */
mul_mR(T_EigsVector,A,T1);
mul_mR(T1,EigsVector,EigsValue);
printf(" cosh(A):");
f_eigs_mR(cosh,EigsValue,cosh_EigsValue);
mul_mR(EigsVector,cosh_EigsValue,T1);
mul_mR(T1,T_EigsVector,cosh_A);
p_mR(cosh_A,S10,P4,C6);
/* ================================================================== */
eigs_V_mR(cosh_A,EigsVector);
transpose_mR(EigsVector,T_EigsVector);
/* EigsValue : T_EigsVector * cosh_A * EigsVector */
mul_mR(T_EigsVector,cosh_A,T1);
mul_mR(T1,EigsVector,EigsValue);
printf(" acosh(cosh(A)) = A :");
f_eigs_mR(acosh,EigsValue,cosh_EigsValue);
mul_mR(EigsVector,cosh_EigsValue,T1);
mul_mR(T1,T_EigsVector,A);
p_mR(A,S10,P4,C6);
f_mR(A);
f_mR(cosh_A);
f_mR(EigsVector);
f_mR(T_EigsVector);
f_mR(EigsValue);
f_mR(cosh_EigsValue);
f_mR(T1);
}
/* ------------------------------------ */
int main(void)
{
time_t t;
srand(time(&t));
do
{
fun();
} while(stop_w());
return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */
acosh(cosh(A)) = A
Exemple de sortie écran :
------------------------------------
A :
+0.6608 +0.4029 -0.7211 +0.1469 -0.4697
+0.4029 +0.2884 -0.4317 +0.1532 -0.2475
-0.7211 -0.4317 +0.8667 -0.2079 +0.4934
+0.1469 +0.1532 -0.2079 +0.6138 -0.0042
-0.4697 -0.2475 +0.4934 -0.0042 +0.4031
cosh(A):
+1.9697 +0.5938 -1.0963 +0.2932 -0.6794
+0.5938 +1.3675 -0.6728 +0.2017 -0.4106
-1.0963 -0.6728 +2.2430 -0.3465 +0.7646
+0.2932 +0.2017 -0.3465 +1.2675 -0.1705
-0.6794 -0.4106 +0.7646 -0.1705 +1.4845
acosh(cosh(A)) = A :
+0.6608 +0.4029 -0.7211 +0.1469 -0.4697
+0.4029 +0.2884 -0.4317 +0.1532 -0.2475
-0.7211 -0.4317 +0.8667 -0.2079 +0.4934
+0.1469 +0.1532 -0.2079 +0.6138 -0.0042
-0.4697 -0.2475 +0.4934 -0.0042 +0.4031
Press return to continue
Press X return to stop