Mathc matrices/c072e
Apparence
Installer et compiler ces fichiers dans votre répertoire de travail.
c00g.c |
|---|
/* ------------------------------------ */
/* Save as : c00g.c */
/* ------------------------------------ */
#include "v_a.h"
/* ------------------------------------ */
void fun(int r)
{
int c1 = C1;
int c2 = C2;
double **A = r_mR( i_mR(r,r),9.);
double **B = swapC_mR(c_mR(A, i_mR(r,r)),c1,c2) ;
clrscrn();
printf(" A:");
p_mR(A, S3,P0,C6);
printf(" B:");
p_mR(B, S3,P0,C6);
printf(" If B is the matrix that results when \n");
printf(" two columns (c[%d],c[%d]) are interchanged\n",c1,c2);
printf(" then : det(B) = - det(A)\n\n\n");
printf(" det_R(A) = %+.0f\n", det_R(A));
printf(" det_R(B) = %+.0f\n", det_R(B));
f_mR(A);
f_mR(B);
}
/* ------------------------------------ */
int main(void)
{
time_t t;
srand(time(&t));
do
{
fun(rp_I(RC4)+RC1);
} while(stop_w());
return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */
Nous pouvons vérifier numériquement que si l'on échange deux colonnes le déterminant change de signe
Exemple de sortie écran :
A:
+4 -3 +2 +8
-3 +4 +6 +4
-9 -5 -3 -9
-7 -9 +4 -5
B:
+4 +2 -3 +8
-3 +6 +4 +4
-9 -3 -5 -9
-7 +4 -9 -5
If B is the matrix that results when
two columns (c[2],c[3]) are interchanged
then : det(B) = - det(A)
det_R(A) = -3723
det_R(B) = +3723
Press return to continue
Press X to stop