Mathc matrices/c21y
Apparence
Installer et compiler ces fichiers dans votre répertoire de travail.
c00b.c |
---|
/* ------------------------------------ */
/* Save as : c00b.c */
/* ------------------------------------ */
#include "v_a.h"
/* ------------------------------------ */
int main(void)
{
double ab[R4*C7]={
8, -5, 4, -8, 2, +2, 0,
4, -7, 8, -9, 8, 2, 0,
4, -7, 8, -9, 9, 7, 0,
-8, 5, -4, 8, -2, -2, 0,
};
double **Ab = ca_A_mR(ab,i_Abr_Ac_bc_mR(R4,C6,C1));
double **A = c_Ab_A_mR(Ab,i_mR(R4,C6));
double **b = c_Ab_b_mR(Ab,i_mR(R4,C1));
double **B = i_mR(R4,C3);
double **BT = i_mR(C3,R4);
double **BTb = i_Abr_Ac_bc_mR(C3,R4,C1);
clrscrn();
printf("Basis for a Column Space by Row Reduction :\n\n");
printf(" A :");
p_mR(A,S6,P0,C10);
printf(" b :");
p_mR(b,S6,P0,C10);
printf(" Ab :");
p_mR(Ab,S6,P0,C10);
stop();
clrscrn();
printf(" The leading 8’s of Ab give the position \n"
" of the columns of A which form a basis \n"
" for the column space of A \n\n"
" A :");
p_mR(A,S7,P4,C10);
printf(" gj_PP_mR(Ab,NO) :");
gj_PP_mR(Ab,NO);
p_mR(Ab,S7,P4,C10);
c_c_mR(A,C1,B,C1);
c_c_mR(A,C2,B,C2);
c_c_mR(A,C5,B,C3);
printf(" B : A basis for the column space of A");
p_mR(B,S7,P4,C10);
stop();
clrscrn();
printf(" Check if the columns of B are linearly independent\n\n"
" BT :");
p_mR(transpose_mR(B,BT), S4,P0, C8);
printf(" BTb :");
p_mR(c_mR(BT,BTb), S4,P0, C8);
printf(" gj_PP_FreeV_mZ(BTb) :");
p_mR(gj_PP_mR(BTb,NO), S8,P4, C8);
stop();
f_mR(Ab);
f_mR(b);
f_mR(A);
f_mR(B);
f_mR(BT);
f_mR(BTb);
return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */
La position des pivots de Ab donne la position des colonnes de A qui forment une base pour l'espace colonnes de A.
Exemple de sortie écran :
------------------------------------
Basis for a Column Space by Row Reduction :
A :
+8 -5 +4 -8 +2 +2
+4 -7 +8 -9 +8 +2
+4 -7 +8 -9 +9 +7
-8 +5 -4 +8 -2 -2
b :
+0
+0
+0
+0
Ab :
+8 -5 +4 -8 +2 +2 +0
+4 -7 +8 -9 +8 +2 +0
+4 -7 +8 -9 +9 +7 +0
-8 +5 -4 +8 -2 -2 +0
Press return to continue.
------------------------------------
The leading 8’s of Ab give the position
of the columns of A which form a basis
for the column space of A
A :
+8.0000 -5.0000 +4.0000 -8.0000 +2.0000 +2.0000
+4.0000 -7.0000 +8.0000 -9.0000 +8.0000 +2.0000
+4.0000 -7.0000 +8.0000 -9.0000 +9.0000 +7.0000
-8.0000 +5.0000 -4.0000 +8.0000 -2.0000 -2.0000
gj_PP_mR(Ab,NO) :
+1.0000 -0.6250 +0.5000 -1.0000 +0.2500 +0.2500 +0.0000
-0.0000 +1.0000 -1.3333 +1.1111 -1.5556 -0.2222 -0.0000
+0.0000 +0.0000 +0.0000 +0.0000 +1.0000 +5.0000 +0.0000
+0.0000 +0.0000 +0.0000 +0.0000 +0.0000 +0.0000 +0.0000
B : A basis for the column space of A
+8.0000 -5.0000 +2.0000
+4.0000 -7.0000 +8.0000
+4.0000 -7.0000 +9.0000
-8.0000 +5.0000 -2.0000
Press return to continue.
------------------------------------
Check if the columns of B are linearly independent
BT :
+8 +4 +4 -8
-5 -7 -7 +5
+2 +8 +9 -2
BTb :
+8 +4 +4 -8 +0
-5 -7 -7 +5 +0
+2 +8 +9 -2 +0
gj_PP_FreeV_mZ(BTb) :
+1.0000 +0.5000 +0.5000 -1.0000 +0.0000
+0.0000 +1.0000 +1.1429 +0.0000 +0.0000
+0.0000 +0.0000 +1.0000 +0.0000 +0.0000
Press return to continue.