Mathc matrices/033
Installer et compiler ces fichiers dans votre répertoire de travail.
c00a.c |
---|
/* ------------------------------------ */
/* Save as : c00a.c */
/* ------------------------------------ */
#include "v_a.h"
/* ------------------------------------ */
void fun(int r)
{
double **A = rdefinite_negative_mR( i_mR(r,r), 99);
double **invA = inv_mR(A, i_mR(r,r));
double **EValue = eigs_mR(invA, i_mR(r,C1));
clrscrn();
printf(" A = Q sD QT; A : Definite negative");
p_mR(A,S12,P6,C6);
printf(" invA ");
p_mR(invA,S12,P6,C6);
printf(" InvA : EValue are negatives");
p_mR(EValue,S9,P3,C1);
f_mR(A);
f_mR(invA);
f_mR(EValue);
}
/* ------------------------------------ */
int main(void)
{
time_t t;
srand(time(&t));
do
{
fun(rp_I(R3)+R1);
} while(stop_w());
return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */
La matrice inverse d'une matrice définie négative est définie négative.
Exemple de sortie écran :
A = Q sD QT; A : Definite negative
-49.072534 -3.890228 -21.146376 -10.056176
-3.890228 -68.850928 -10.983342 -20.482193
-21.146376 -10.983342 -84.550973 +11.447895
-10.056176 -20.482193 +11.447895 -59.525565
invA
-0.024590 -0.001561 +0.007175 +0.006071
-0.001561 -0.017020 +0.003522 +0.006797
+0.007175 +0.003522 -0.014793 -0.005269
+0.006071 +0.006797 -0.005269 -0.021177
InvA : EValue are negatives
-0.036
-0.020
-0.012
-0.010
Press return to continue
Press X return to stop