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

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 : c00g.c */ /* ------------------------------------ */ #include "v_a.h" /* ------------------------------------ */ /* ------------------------------------ */ double **X_gj1_T_mR( double **Ab ) { int r= R1; while(r<Ab[R_SIZE][C0]) { printf(" Ab :"); p_mR(Ab, S12,P4,C8); if(fabs(pivotbest_gj1Ab_mR(Ab,r))>ERROR_E) printf(" Ab : pivot[%d][[%d] " " pivotbest_gj1Ab_mR(Ab,r);\n",r,r); p_mR(Ab, S12,P4,C8); zero_under_pivot_gj1Ab_mR(Ab,r); printf(" Ab : pivot[%d][[%d] " " zero_under_pivot_gj1Ab_mR();\n",r,r); p_mR(Ab, S12,P4,C8); stop(); clrscrn(); r++; } /* while(r>R1) zero_above_pivot_gj1Ab_mR(Ab,--r); */ return(Ab); } /* ------------------------------------ */ /* ------------------------------------ */ double **X_gj_TP_mR( double **Ab ) { X_gj1_T_mR(Ab); /* sort_c_mR(Ab); */ /* sort_r_mR(Ab); */ return(Ab); } /* ------------------------------------ */ /* ------------------------------------ */ void fun(int r) { double **A = r_mR( i_mR(r,r ),999.); double **b = r_mR( i_mR(r,C1),999.); double **Ab = c_A_b_Ab_mR(A,b, i_Abr_Ac_bc_mR(r, r, C1)); /* i_Abr_Ac_bc_mR(RAb, CA, Cb)); */ clrscrn(); X_gj_TP_mR(Ab); printf(" The result of the best pivot and zero below the pivot:\n\n" " gj_TP_mR(Ab);"); p_mR(Ab, S10,P4,C7); f_mR(Ab); f_mR(b); f_mR(A); } /* ------------------------------------ */ int main(void) { time_t t; srand(time(&t)); do { fun(R5); } while(stop_w()); return 0; } /* ------------------------------------ */ /* ------------------------------------ */ Screen output example: Ab : +203.0000 +126.0000 -542.0000 -858.0000 -743.0000 +953.0000 +505.0000 -485.0000 -331.0000 -698.0000 -848.0000 +71.0000 +478.0000 +632.0000 -347.0000 -854.0000 -623.0000 -876.0000 +317.0000 +27.0000 -830.0000 +743.0000 +555.0000 +961.0000 -90.0000 -103.0000 +454.0000 -231.0000 -504.0000 -728.0000 Ab : pivot[1][[1] pivotbest_gj1Ab_mR(Ab,r); -858.0000 +126.0000 -542.0000 +203.0000 -743.0000 +953.0000 -698.0000 -485.0000 -331.0000 +505.0000 -848.0000 +71.0000 -854.0000 +632.0000 -347.0000 +478.0000 -623.0000 -876.0000 +743.0000 +27.0000 -830.0000 +317.0000 +555.0000 +961.0000 -231.0000 -103.0000 +454.0000 -90.0000 -504.0000 -728.0000 Ab : pivot[1][[1] zero_under_pivot_gj1Ab_mR(); +1.0000 -0.1469 +0.6317 -0.2366 +0.8660 -1.1107 +0.0000 -587.5035 +109.9277 +339.8555 -243.5548 -704.2844 +0.0000 +506.5874 +192.4732 +275.9464 +116.5361 -1824.5571 +0.0000 +136.1119 -1299.3543 +492.7914 -88.4138 +1786.2669 +0.0000 -136.9231 +599.9231 -144.6538 -303.9615 -984.5769 Press return to continue. Ab : +1.0000 -0.1469 +0.6317 -0.2366 +0.8660 -1.1107 +0.0000 -587.5035 +109.9277 +339.8555 -243.5548 -704.2844 +0.0000 +506.5874 +192.4732 +275.9464 +116.5361 -1824.5571 +0.0000 +136.1119 -1299.3543 +492.7914 -88.4138 +1786.2669 +0.0000 -136.9231 +599.9231 -144.6538 -303.9615 -984.5769 Ab : pivot[2][[2] pivotbest_gj1Ab_mR(Ab,r); +1.0000 +0.6317 -0.1469 -0.2366 +0.8660 -1.1107 +0.0000 -1299.3543 +136.1119 +492.7914 -88.4138 +1786.2669 +0.0000 +192.4732 +506.5874 +275.9464 +116.5361 -1824.5571 +0.0000 +109.9277 -587.5035 +339.8555 -243.5548 -704.2844 +0.0000 +599.9231 -136.9231 -144.6538 -303.9615 -984.5769 Ab : pivot[2][[2] zero_under_pivot_gj1Ab_mR(); +1.0000 +0.6317 -0.1469 -0.2366 +0.8660 -1.1107 -0.0000 +1.0000 -0.1048 -0.3793 +0.0680 -1.3747 +0.0000 +0.0000 +526.7496 +348.9435 +103.4394 -1559.9576 +0.0000 +0.0000 -575.9882 +381.5465 -251.0347 -553.1630 +0.0000 +0.0000 -74.0790 +82.8722 -344.7829 -159.8421 Press return to continue. Ab : +1.0000 +0.6317 -0.1469 -0.2366 +0.8660 -1.1107 -0.0000 +1.0000 -0.1048 -0.3793 +0.0680 -1.3747 +0.0000 +0.0000 +526.7496 +348.9435 +103.4394 -1559.9576 +0.0000 +0.0000 -575.9882 +381.5465 -251.0347 -553.1630 +0.0000 +0.0000 -74.0790 +82.8722 -344.7829 -159.8421 Ab : pivot[3][[3] pivotbest_gj1Ab_mR(Ab,r); +1.0000 +0.6317 -0.1469 -0.2366 +0.8660 -1.1107 -0.0000 +1.0000 -0.1048 -0.3793 +0.0680 -1.3747 +0.0000 +0.0000 -575.9882 +381.5465 -251.0347 -553.1630 +0.0000 +0.0000 +526.7496 +348.9435 +103.4394 -1559.9576 +0.0000 +0.0000 -74.0790 +82.8722 -344.7829 -159.8421 Ab : pivot[3][[3] zero_under_pivot_gj1Ab_mR(); +1.0000 +0.6317 -0.1469 -0.2366 +0.8660 -1.1107 -0.0000 +1.0000 -0.1048 -0.3793 +0.0680 -1.3747 -0.0000 -0.0000 +1.0000 -0.6624 +0.4358 +0.9604 +0.0000 +0.0000 +0.0000 +697.8734 -126.1355 -2065.8333 +0.0000 +0.0000 +0.0000 +33.8007 -312.4968 -88.6987 Press return to continue. Ab : +1.0000 +0.6317 -0.1469 -0.2366 +0.8660 -1.1107 -0.0000 +1.0000 -0.1048 -0.3793 +0.0680 -1.3747 -0.0000 -0.0000 +1.0000 -0.6624 +0.4358 +0.9604 +0.0000 +0.0000 +0.0000 +697.8734 -126.1355 -2065.8333 +0.0000 +0.0000 +0.0000 +33.8007 -312.4968 -88.6987 Ab : pivot[4][[4] pivotbest_gj1Ab_mR(Ab,r); +1.0000 +0.6317 -0.1469 -0.2366 +0.8660 -1.1107 -0.0000 +1.0000 -0.1048 -0.3793 +0.0680 -1.3747 -0.0000 -0.0000 +1.0000 -0.6624 +0.4358 +0.9604 +0.0000 +0.0000 +0.0000 +697.8734 -126.1355 -2065.8333 +0.0000 +0.0000 +0.0000 +33.8007 -312.4968 -88.6987 Ab : pivot[4][[4] zero_under_pivot_gj1Ab_mR(); +1.0000 +0.6317 -0.1469 -0.2366 +0.8660 -1.1107 -0.0000 +1.0000 -0.1048 -0.3793 +0.0680 -1.3747 -0.0000 -0.0000 +1.0000 -0.6624 +0.4358 +0.9604 +0.0000 +0.0000 +0.0000 +1.0000 -0.1807 -2.9602 +0.0000 +0.0000 +0.0000 +0.0000 -306.3876 +11.3575 Press return to continue. Ab : +1.0000 +0.6317 -0.1469 -0.2366 +0.8660 -1.1107 -0.0000 +1.0000 -0.1048 -0.3793 +0.0680 -1.3747 -0.0000 -0.0000 +1.0000 -0.6624 +0.4358 +0.9604 +0.0000 +0.0000 +0.0000 +1.0000 -0.1807 -2.9602 +0.0000 +0.0000 +0.0000 +0.0000 -306.3876 +11.3575 Ab : pivot[5][[5] pivotbest_gj1Ab_mR(Ab,r); +1.0000 +0.6317 -0.1469 -0.2366 +0.8660 -1.1107 -0.0000 +1.0000 -0.1048 -0.3793 +0.0680 -1.3747 -0.0000 -0.0000 +1.0000 -0.6624 +0.4358 +0.9604 +0.0000 +0.0000 +0.0000 +1.0000 -0.1807 -2.9602 +0.0000 +0.0000 +0.0000 +0.0000 -306.3876 +11.3575 Ab : pivot[5][[5] zero_under_pivot_gj1Ab_mR(); +1.0000 +0.6317 -0.1469 -0.2366 +0.8660 -1.1107 -0.0000 +1.0000 -0.1048 -0.3793 +0.0680 -1.3747 -0.0000 -0.0000 +1.0000 -0.6624 +0.4358 +0.9604 +0.0000 +0.0000 +0.0000 +1.0000 -0.1807 -2.9602 -0.0000 -0.0000 -0.0000 -0.0000 +1.0000 -0.0371 Press return to continue. The result of the best pivot and zero below the pivot: gj_TP_mR(Ab); +1.0000 +0.6317 -0.1469 -0.2366 +0.8660 -1.1107 -0.0000 +1.0000 -0.1048 -0.3793 +0.0680 -1.3747 -0.0000 -0.0000 +1.0000 -0.6624 +0.4358 +0.9604 +0.0000 +0.0000 +0.0000 +1.0000 -0.1807 -2.9602 -0.0000 -0.0000 -0.0000 -0.0000 +1.0000 -0.0371 Press return to continue Press X return to stop