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/a09p

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 : c00d.c */ /* ------------------------------------ */ #include "v_a.h" /* ------------------------------------ */ /* ------------------------------------ */ #define RAb R3 #define CA C3 #define Cb C1 /* ------------------------------------ */ # define FREEV C2 /* ------------------------------------ */ /* ------------------------------------ */ int main(void) { double ab[RAb*(CA+C1)]={ +692.0, +524.0, +86.0, -1156.0, +346.0, +262.0, +43.0, -578.0, -1038.0, -786.0, -129.0, +1734.0 }; double **Ab = ca_A_mR(ab,i_Abr_Ac_bc_mR(RAb, CA, Cb)); double **Ab_free = i_Abr_Ac_bc_mR(CA, CA, Cb + FREEV); double **b_free = i_mR(CA, Cb + FREEV); clrscrn(); printf(" Ab :"); p_mR(Ab, S10,P4,C10); printf("\n Ab : gj_PP_mR(Ab,NO) :"); gj_PP_mR(Ab,NO); p_mR(Ab, S10,P4,C10); stop(); clrscrn(); printf(" Ab :"); p_mR(Ab, S10,P4,C10); put_zeroR_mR(Ab,Ab_free); printf(" Ab_free : put_zeroR_mR(Ab,Ab_free);"); p_mR(Ab_free, S10,P4,C10); put_freeV_mR(Ab_free); printf(" Ab_free : put_freeV_mR(Ab_free);"); p_mR(Ab_free, S10,P4,C10); printf(" Ab_free : gj_PP_mR(Ab_free,YES);"); gj_PP_mR(Ab_free,YES); p_mR(Ab_free, S10,P4,C10); stop(); clrscrn(); c_Ab_b_mR(Ab_free,b_free); printf(" b_free :"); p_mR(b_free, S10,P4,C7); printf(" b FREEV"); p_freeV(b_free, S8,P4); stop(); f_mR(Ab); f_mR(Ab_free); f_mR(b_free); return 0; } /* ------------------------------------ */ /* ------------------------------------ */ Screen output example: Ab : +692.0000 +524.0000 +86.0000 -1156.0000 +346.0000 +262.0000 +43.0000 -578.0000 -1038.0000 -786.0000 -129.0000 +1734.0000 Ab : gj_PP_mR(Ab,NO) : +1.0000 +0.7572 +0.1243 -1.6705 +0.0000 +0.0000 +0.0000 +0.0000 +0.0000 +0.0000 +0.0000 +0.0000 Press return to continue. Ab : +1.0000 +0.7572 +0.1243 -1.6705 +0.0000 +0.0000 +0.0000 +0.0000 +0.0000 +0.0000 +0.0000 +0.0000 Ab_free : put_zeroR_mR(Ab,Ab_free); +1.0000 +0.7572 +0.1243 -1.6705 +0.0000 +0.0000 +0.0000 +0.0000 +0.0000 +0.0000 +0.0000 +0.0000 +0.0000 +0.0000 +0.0000 +0.0000 +0.0000 +0.0000 Ab_free : put_freeV_mR(Ab_free); +1.0000 +0.7572 +0.1243 -1.6705 +0.0000 +0.0000 +0.0000 +1.0000 +0.0000 +0.0000 +1.0000 +0.0000 +0.0000 +0.0000 +1.0000 +0.0000 +0.0000 +1.0000 Ab_free : gj_PP_mR(Ab_free,YES); +1.0000 +0.0000 +0.0000 -1.6705 -0.7572 -0.1243 +0.0000 +1.0000 +0.0000 +0.0000 +1.0000 +0.0000 +0.0000 +0.0000 +1.0000 +0.0000 +0.0000 +1.0000 Press return to continue. b_free : -1.6705 -0.7572 -0.1243 +0.0000 +1.0000 +0.0000 +0.0000 +0.0000 +1.0000 b FREEV x1 = -1.6705 -0.7572*v -0.1243*w x2 = +0.0000 +1.0000*v +0.0000*w x3 = +0.0000 +0.0000*v +1.0000*w Press return to continue.