Mathc matrices/c12b2
Apparence
Installer et compiler ces fichiers dans votre répertoire de travail.
c00f.c |
|---|
/* ------------------------------------ */
/* Save as : c00f.c */
/* ------------------------------------ */
#include "v_a.h"
/* ------------------------------------ */
void fun(int rc)
{
double **A = rskewsymmetric_mR(i_mR(rc,rc),9);
double **A_2 = i_mR(rc,rc);
clrscrn();
printf(" A is a skew symmetric matrix");
p_mR(A, S4,P0,C6);
printf(" A**2 is a symmetric negative semi-definite matrix");
p_mR(mul_mR(A,A,A_2), S4,P0,C6);
f_mR(A);
f_mR(A_2);
}
/* ------------------------------------ */
int main(void)
{
time_t t;
srand(time(&t));
do
fun(rp_I(RC4)+RC1);
while(stop_w());
return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */
Si A est une matrice anti-symétrique alors A**2 est une matrice symétrique négative semi-definie.
Exemple de sortie écran :
A is a skew symmetric matrix
+0 +6 +2 +8
-6 +0 -3 +4
-2 +3 +0 +7
-8 -4 -7 +0
A**2 is a symmetric negative semi-definite matrix
-104 -26 -74 +38
-26 -61 -40 -69
-74 -40 -62 -4
+38 -69 -4 -129
Press return to continue
Press X return to stop