Mathc matrices/c072f
Apparence
Installer et compiler ces fichiers dans votre répertoire de travail.
c00h.c |
|---|
/* ------------------------------------ */
/* Save as : c00h.c */
/* ------------------------------------ */
#include "v_a.h"
/* ------------------------------------ */
void fun(int r)
{
int r1 = R1;
int r2 = R2;
double **A = r_mR( i_mR(r,r),9.);
double **B = swapR_mR(c_mR(A, i_mR(r,r)),r1,r2) ;
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 rows (r[%d],r[%d]) are interchanged\n",r1,r2);
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 lignes le déterminant change de signe
Exemple de sortie écran :
A:
+6 -5 +2 -7 -1
-1 -9 -9 -1 -7
+8 +4 +4 +6 -1
+4 -1 +8 +4 -3
+2 -5 -5 -9 -9
B:
-1 -9 -9 -1 -7
+6 -5 +2 -7 -1
+8 +4 +4 +6 -1
+4 -1 +8 +4 -3
+2 -5 -5 -9 -9
If B is the matrix that results when
two rows (r[2],r[1]) are interchanged
then : det(B) = - det(A)
det_R(A) = -68293
det_R(B) = +68293
Press return to continue
Press X to stop