Mathc complexes/a248
Installer et compiler ces fichiers dans votre répertoire de travail.
c03c.c |
---|
/* ------------------------------------ */
/* Save as : c03c.c */
/* ------------------------------------ */
#include "w_a.h"
/* ------------------------------------ */
#define RA R2
#define CA C3
#define CFREE C1+C1 // C1 -> b
/* ------------------------------------ */
int main(void)
{
double a_Tb[RA*((CA+C1)*C2)]={
-2,+3, +1,+0, +0,-1, +0,+0,
-4,+2, -3,+5, -6,+4, +0,+0
};
double **A_Tb = ca_A_mZ(a_Tb,i_Abr_Ac_bc_mZ(RA,CA,C1));
double **A_T = c_Ab_A_mZ(A_Tb,i_mZ(RA,CA));
double **b = c_Ab_b_mZ(A_Tb,i_mZ(RA,C1));
double **A_Tb_free = i_Abr_Ac_bc_mZ(csize_A_Z(A_Tb),csize_A_Z(A_Tb),CFREE);
double **B = i_mZ(rsize_Z(A_Tb_free),csize_b_Z(A_Tb_free));
clrscrn();
printf("Find a basis for the orthogonal complement of A :\n\n");
printf(" A_T :");
p_mZ(A_T,S6,P1,S6,P1,C10);
printf(" b :");
p_mZ(b,S6,P1,S6,P1,C10);
printf(" A_Tb :");
p_mZ(A_Tb,S6,P1,S6,P1,C10);
stop();
clrscrn();
printf(" A_Tb : gj_PP_mZ(A_Tb) :");
gj_PP_mZ(A_Tb);
p_mZ(A_Tb,S7,P3,S7,P3,C10);
put_zeroR_mZ(A_Tb,A_Tb_free);
put_freeV_mZ(A_Tb_free);
clrscrn();
printf(" A_Tb_free :");
p_mZ(gj_mZ(A_Tb_free),S7,P3,S7,P3,C10);
printf(" B is a basis for the orthogonal complement of A :");
P_mZ(c_Ab_b_mZ(A_Tb_free,B),S10,P12,S10,P12,C7);
stop();
f_mZ(A_Tb);
f_mZ(A_Tb_free);
f_mZ(B);
f_mZ(b);
f_mZ(A_T);
return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */
Trouver une projection sur un sous-espace vectoriel par une application linéaire :
- B est une base pour le complément orthogonal de A. Trouver une matrice V qui projette un vecteur x sur R3.
Proj(x) = V * x V = Id - (B * inv(BT*B) * BT) .
- Dans cet exemple nous calculons B. Nous l'utiliserons dans le prochain exemple.
Exemple de sortie écran :
------------------------------------
Find a basis for the orthogonal complement of A :
A_T :
-2.0 +3.0i +1.0 +0.0i +0.0 -1.0i
-4.0 +2.0i -3.0 +5.0i -6.0 +4.0i
b :
+0.0 +0.0i
+0.0 +0.0i
A_Tb :
-2.0 +3.0i +1.0 +0.0i +0.0 -1.0i +0.0 +0.0i
-4.0 +2.0i -3.0 +5.0i -6.0 +4.0i +0.0 +0.0i
Press return to continue.
------------------------------------
A_Tb : gj_PP_mZ(A_Tb) :
+1.000 +0.000i +1.100 -0.700i +1.600 -0.200i +0.000 -0.000i
+0.000 +0.000i +1.000 -0.000i +1.373 +0.232i +0.000 +0.000i
------------------------------------
A_Tb_free :
+1.000 +0.000i -0.000 +0.000i -0.000 +0.000i +0.000 +0.000i +0.073 -0.506i
+0.000 -0.000i +1.000 +0.000i +0.000 +0.000i +0.000 -0.000i -1.373 -0.232i
+0.000 +0.000i +0.000 +0.000i +1.000 +0.000i +0.000 +0.000i +1.000 -0.000i
B is a basis for the orthogonal complement of A :
+0.000000000000,+0.000000000000, +0.072961373391,-0.506437768240,
+0.000000000000,-0.000000000000, -1.373390557940,-0.231759656652,
+0.000000000000,+0.000000000000, +1.000000000000,-0.000000000000
Press return to continue.