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

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 : c00a.c */ /* ------------------------------------ */ #include "v_a.h" /* ------------------------------------ */ /* ------------------------------------ */ #define RAb R2 #define CA C2 #define Cb C1 /* ------------------------------------ */ # define FREEV C1 /* ------------------------------------ */ /* ------------------------------------ */ int main(void) { double ab[RAb*(CA+C1)]={ -3, -9, +12, +2, +6, -8, }; 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, S6,P1,C10); printf(" Ab : gj_PP_mR(Ab,NO) :"); gj_PP_mR(Ab,NO); p_mR(Ab, S6,P1,C10); stop(); clrscrn(); put_zeroR_mR(Ab,Ab_free); printf(" Ab_free : put_zeroR_mR(Ab,Ab_free);"); p_mR(Ab_free, S6,P1,C10); put_freeV_mR(Ab_free); printf(" Ab_free : put_freeV_mR(Ab_free);"); p_mR(Ab_free, S6,P1,C10); printf("\n Ab_free : gj_PP_mR(Ab_free,YES);"); gj_PP_mR(Ab_free,YES); p_mR(Ab_free, S6,P1,C10); c_Ab_b_mR(Ab_free,b_free); printf("\n b_free :"); p_mR(b_free, S6,P1,C7); printf(" b FREEV"); p_freeV(b_free, S4,P1); stop(); f_mR(Ab); f_mR(Ab_free); f_mR(b_free); return 0; } /* ------------------------------------ */ /* ------------------------------------ */ Screen output example: Ab : -3.0 -9.0 +12.0 +2.0 +6.0 -8.0 Ab : gj_PP_mR(Ab,NO) : +1.0 +3.0 -4.0 +0.0 +0.0 +0.0 Press return to continue. Ab_free : put_zeroR_mR(Ab,Ab_free); +1.0 +3.0 -4.0 +0.0 +0.0 +0.0 +0.0 +0.0 Ab_free : put_freeV_mR(Ab_free); +1.0 +3.0 -4.0 +0.0 +0.0 +1.0 +0.0 +1.0 Ab_free : gj_PP_mR(Ab_free,YES); +1.0 +0.0 -4.0 -3.0 +0.0 +1.0 +0.0 +1.0 b_free : -4.0 -3.0 +0.0 +1.0 b FREEV x1 = -4.0 -3.0*w x2 = +0.0 +1.0*w Press return to continue.