Skip to main content

  | मौसम…

411 समाचार
Public archive edition · Attributed source reporting with original dates · AI drafts are excluded

411 REFERENCE · Wikibooks

Linear Algebra and the C Language/a0li

Reference material by Wikibooks contributors. This retains its source identity and is not 411 news reporting.

__NOTOC__ Install and compile this file in your working directory. /* ------------------------------------ */ /* Save as: c03b.c */ /* ------------------------------------ */ #include "v_a.h" /* ------------------------------------ */ #define RA R2 #define CA C3 #define Cb C1 /* ------------------------------------ */ int main(void) { double a_Tb[RA*(CA+Cb)]={ -2,1,0,0, -3,0,1,0 }; double **A_Tb = ca_A_mR(a_Tb, i_Abr_Ac_bc_mR(RA,CA,Cb)); double **A_T = c_Ab_A_mR(A_Tb, i_mR(RA,CA)); double **b = c_Ab_b_mR(A_Tb, i_mR(RA,Cb)); clrscrn(); printf(" Verify if AT is a basis for a Row Space by Row Reduction.\n\n" " A_T:"); p_mR(A_T,S6,P1,C10); printf(" b:"); p_mR(b,S6,P1,C10); printf(" A_Tb:"); p_mR(A_Tb,S6,P1,C10); stop(); clrscrn(); printf(" The nonzero row vectors of A_Tb form a basis\n" " for the row space of A_T, and hence form a \n" " basis for the column space of A \n\n" " A_Tb:"); p_mR(A_Tb,S7,P3,C10); printf(" A_Tb: gj_PP_mR(A_Tb,NO);"); p_mR(gj_PP_mR(A_Tb,NO),S7,P3,C10); stop(); f_mR(A_Tb); f_mR(b); f_mR(A_T); return 0; } /* ------------------------------------ */ /* ------------------------------------ */ Screen output example: Verify if AT is Basis for a Row Space by Row Reduction: A_T: -2.0 +1.0 +0.0 -3.0 +0.0 +1.0 b: +0.0 +0.0 A_Tb: -2.0 +1.0 +0.0 +0.0 -3.0 +0.0 +1.0 +0.0 Press return to continue. The nonzero row vectors of A_Tb form a basis for the row space of A_T, and hence form a basis for the column space of A A_Tb: -2.000 +1.000 +0.000 +0.000 -3.000 +0.000 +1.000 +0.000 A_Tb: gj_PP_mR(A_Tb,NO); +1.000 -0.000 -0.333 -0.000 +0.000 +1.000 -0.667 +0.000 Press return to continue.