Mathc matrices/02y
Apparence
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 s = rp_I(9);
double **A = rdefinite_positive_mR( i_mR(r,r), 99);
double **sA = smul_mR(s,A, i_mR(r,r));
double **EValue = eigs_mR(sA, i_mR(r,C1));
clrscrn();
printf(" A = Q D QT: ");
p_mR(A,S12,P6,C6);
printf(" %+.0f*A s > 0 ",s);
p_mR(sA,S12,P6,C6);
printf(" %+.0f*A : EValue are positives",s);
p_mR(EValue,S9,P3,C1);
f_mR(A);
f_mR(sA);
f_mR(EValue);
}
/* ------------------------------------ */
int main(void)
{
time_t t;
srand(time(&t));
do
{
fun(rp_I(R3)+R1);
} while(stop_w());
return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */
Si A est définie positive et si s est un réel strictement positif, alors s*A est définie positive.
Exemple de sortie écran :
A = Q D QT:
+62.727541 +0.445866 -2.409990 -2.263642
+0.445866 +72.835983 +13.589842 +9.603327
-2.409990 +13.589842 +56.826075 -20.866481
-2.263642 +9.603327 -20.866481 +53.610401
+3*A s > 0
+188.182624 +1.337597 -7.229971 -6.790926
+1.337597 +218.507948 +40.769526 +28.809981
-7.229971 +40.769526 +170.478225 -62.599443
-6.790926 +28.809981 -62.599443 +160.831204
+3*A : EValue are positives
+243.000
+222.000
+189.000
+84.000
Press return to continue
Press X return to stop