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

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: c00b.c */ /* ------------------------------------ */ #include "v_a.h" /* ------------------------------------ */ /* ------------------------------------ */ # define RAb C4 # define CA C6 # define Cb C1 /* ------------------------------------ */ # define FREEV C3 /* ------------------------------------ */ /* ------------------------------------ */ void X_put_zeroR_mR( double **Ab, double **Ab_free ) { int r; int c; int r_free= R1; int t=0; for (r=R1; r<Ab[R_SIZE][C0]; r++) for (c=r+t; c<Ab[C_SIZE_A][C0]; c++) if(Ab[r][c]> ERROR_E) { clrscrn(); printf(" Ab: put_zeroR_mR();" " b"); p_mR(Ab, S7,P2,C10); printf(" Ab_free: DEBUG 01 " " b FREEV"); p_mR(Ab_free, S7,P2,C10); c_r_mR(Ab,r,Ab_free,r_free); printf(" Ab_free: COPY THE ROW [%d] OF Ab" " INTO THE ROW [%d] OF Ab_free",r,r_free); p_mR(Ab_free, S7,P2,C10); stop(); clrscrn(); c = Ab[C_SIZE_A][C0]; r_free++; } else { clrscrn(); printf(" Ab: put_zeroR_mR();" " b"); p_mR(Ab, S7,P2,C10); printf(" Ab_free: DEBUG 02 " " b FREEV"); p_mR(Ab_free, S7,P2,C10); r_free++; t++; printf(" Ab_free: A LINE OF ZERO"); p_mR(Ab_free, S7,P2,C10); 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(); X_put_zeroR_mR(Ab,Ab_free); printf(" Ab_free: put_zeroR_mR();" " b FREEV"); p_mR(Ab_free, S7,P2,C10); stop(); f_mR(Ab); f_mR(Ab_free); return 0; } /* ------------------------------------ */ /* ------------------------------------ */ Screen output example: Ab: put_zeroR_mR(); b +1.00 -3.00 +4.50 -0.50 +4.00 +1.00 +0.00 -0.00 -0.00 +1.00 +3.00 -2.00 -6.00 -0.00 +0.00 +0.00 +0.00 +0.00 +1.00 +5.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 Ab_free: DEBUG 01 b FREEV +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 Ab_free: COPY THE ROW [1] OF Ab INTO THE ROW [1] OF Ab_free +1.00 -3.00 +4.50 -0.50 +4.00 +1.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 Press return to continue. Ab: put_zeroR_mR(); b +1.00 -3.00 +4.50 -0.50 +4.00 +1.00 +0.00 -0.00 -0.00 +1.00 +3.00 -2.00 -6.00 -0.00 +0.00 +0.00 +0.00 +0.00 +1.00 +5.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 Ab_free: DEBUG 02 b FREEV +1.00 -3.00 +4.50 -0.50 +4.00 +1.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 Ab_free: A LINE OF ZERO +1.00 -3.00 +4.50 -0.50 +4.00 +1.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 Press return to continue. Ab: put_zeroR_mR(); b +1.00 -3.00 +4.50 -0.50 +4.00 +1.00 +0.00 -0.00 -0.00 +1.00 +3.00 -2.00 -6.00 -0.00 +0.00 +0.00 +0.00 +0.00 +1.00 +5.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 Ab_free: DEBUG 01 b FREEV +1.00 -3.00 +4.50 -0.50 +4.00 +1.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 Ab_free: COPY THE ROW [2] OF Ab INTO THE ROW [3] OF Ab_free +1.00 -3.00 +4.50 -0.50 +4.00 +1.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 -0.00 -0.00 +1.00 +3.00 -2.00 -6.00 -0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 Press return to continue. Ab: put_zeroR_mR(); b +1.00 -3.00 +4.50 -0.50 +4.00 +1.00 +0.00 -0.00 -0.00 +1.00 +3.00 -2.00 -6.00 -0.00 +0.00 +0.00 +0.00 +0.00 +1.00 +5.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 Ab_free: DEBUG 02 b FREEV +1.00 -3.00 +4.50 -0.50 +4.00 +1.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 -0.00 -0.00 +1.00 +3.00 -2.00 -6.00 -0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 Ab_free: A LINE OF ZERO +1.00 -3.00 +4.50 -0.50 +4.00 +1.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 -0.00 -0.00 +1.00 +3.00 -2.00 -6.00 -0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 Press return to continue. Ab: put_zeroR_mR(); b +1.00 -3.00 +4.50 -0.50 +4.00 +1.00 +0.00 -0.00 -0.00 +1.00 +3.00 -2.00 -6.00 -0.00 +0.00 +0.00 +0.00 +0.00 +1.00 +5.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 Ab_free: DEBUG 01 b FREEV +1.00 -3.00 +4.50 -0.50 +4.00 +1.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 -0.00 -0.00 +1.00 +3.00 -2.00 -6.00 -0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 Ab_free: COPY THE ROW [3] OF Ab INTO THE ROW [5] OF Ab_free +1.00 -3.00 +4.50 -0.50 +4.00 +1.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 -0.00 -0.00 +1.00 +3.00 -2.00 -6.00 -0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +1.00 +5.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 Press return to continue. Ab: put_zeroR_mR(); b +1.00 -3.00 +4.50 -0.50 +4.00 +1.00 +0.00 -0.00 -0.00 +1.00 +3.00 -2.00 -6.00 -0.00 +0.00 +0.00 +0.00 +0.00 +1.00 +5.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 Ab_free: DEBUG 02 b FREEV +1.00 -3.00 +4.50 -0.50 +4.00 +1.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 -0.00 -0.00 +1.00 +3.00 -2.00 -6.00 -0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +1.00 +5.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 Ab_free: A LINE OF ZERO +1.00 -3.00 +4.50 -0.50 +4.00 +1.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 -0.00 -0.00 +1.00 +3.00 -2.00 -6.00 -0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +1.00 +5.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 Press return to continue. Ab_free: put_zeroR_mR(); b FREEV +1.00 -3.00 +4.50 -0.50 +4.00 +1.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 -0.00 -0.00 +1.00 +3.00 -2.00 -6.00 -0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +1.00 +5.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 Press return to continue.