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

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 C4 # define CA C6 # define Cb C1 /* ------------------------------------ */ # define FREEV C3 /* ------------------------------------ */ /* ------------------------------------ */ void X_put_freeV_mR( double **Ab_free ) { int r; int t=1; for (r=R1; r<Ab_free[R_SIZE][C0]; r++) if(Ab_free[r][r]< ERROR_E) { clrscrn(); printf(" Ab_free: DEBUG 01" " b FREEV"); p_mR(Ab_free, S6,P1,C11); c_s_mR(1.,Ab_free,r,r); c_s_mR(1.,Ab_free,r,rsize_R(Ab_free)+C1+t); t++; printf(" Ab_free: " "put_freeV_mR() Pivot[%d,%d] b FREEV" ,r,r); p_mR(Ab_free, S6,P1,C11); stop(); clrscrn(); } } /* ------------------------------------ */ /* ------------------------------------ */ int main(void) { double ab[R4*C7]={ +1.0, -3.0, +4.5, -0.5, +4.0, +1.0, +0.0, -0.0, -0.0, +1.0, +3.0, -2.0, -6.0, -0.0, +0.0, +0.0, +0.0, +0.0, +1.0, +5.0, +0.0, +0.0, +0.0, +0.0, +0.0, +0.0, +0.0, +0.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); clrscrn(); printf(" Ab: b"); p_mR(Ab, S5,P1,C10); put_zeroR_mR(Ab,Ab_free); printf(" Ab_free: put_zeroR_mR(); b FREEV"); p_mR(Ab_free, S5,P1,C10); stop(); clrscrn(); X_put_freeV_mR(Ab_free); printf(" Ab_free: put_freeV_mR(Ab_free); b FREEV"); p_mR(Ab_free, S5,P1,C10); stop(); f_mR(Ab); f_mR(Ab_free); return 0; } /* ------------------------------------ */ /* ------------------------------------ */ Screen output example: Ab: b +1.0 -3.0 +4.5 -0.5 +4.0 +1.0 +0.0 -0.0 -0.0 +1.0 +3.0 -2.0 -6.0 -0.0 +0.0 +0.0 +0.0 +0.0 +1.0 +5.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 Ab_free: put_zeroR_mR(); b FREEV +1.0 -3.0 +4.5 -0.5 +4.0 +1.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 -0.0 -0.0 +1.0 +3.0 -2.0 -6.0 -0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +1.0 +5.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 Press return to continue. Ab_free: DEBUG 01 b FREEV +1.0 -3.0 +4.5 -0.5 +4.0 +1.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 -0.0 -0.0 +1.0 +3.0 -2.0 -6.0 -0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +1.0 +5.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 Ab_free: put_freeV_mR() Pivot[2,2] b FREEV +1.0 -3.0 +4.5 -0.5 +4.0 +1.0 +0.0 +0.0 +0.0 +0.0 +0.0 +1.0 +0.0 +0.0 +0.0 +0.0 +0.0 +1.0 +0.0 +0.0 -0.0 -0.0 +1.0 +3.0 -2.0 -6.0 -0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.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