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

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. thumb| /* ------------------------------------ */ /* Save as : c00c.c */ /* ------------------------------------ */ #include "v_a.h" /* ------------------------------------ */ #define RA R5 #define CA C5 #define Cb C1 /* ------------------------------------ */ int main(void) { double ab[RA*(CA+Cb)]={ // x2 x4 x6 x7 -1, +0, +0, +0, +0, +20 -50, +1, +1, +0, +0, +0, +60, +0, +0, +1, -1, +0, -60, +0, +0, +0, +1, +0, +90 -20, +0, -1, -1, +0, +0, +50 -90 }; double **Ab = ca_A_mR(ab,i_Abr_Ac_bc_mR(RA,CA,Cb)); double **A = c_Ab_A_mR(Ab,i_mR(RA,CA)); double **b = c_Ab_b_mR(Ab,i_mR(RA,Cb)); clrscrn(); printf(" A :"); p_mR(A,S5,P0,C7); printf(" b :"); p_mR(b,S5,P0,C7); printf(" Ab :"); p_mR(Ab,S5,P0,C7); stop(); clrscrn(); printf(" Copy/Paste into the octave window.\n\n"); p_Octave_mR(Ab,"Ab",P0); printf("\n rref(Ab,.00000000001)\n\n"); printf(" gj_TP_mR(Ab) :\n\n" " x2 x4 x6 x7 "); p_mR(gj_TP_mR(Ab),S5,P0,C7); stop(); f_mR(Ab); f_mR(b); f_mR(A); return 0; } /* ------------------------------------ */ /* ------------------------------------ */ thumb| Screen output example: A : -1 +0 +0 +0 +0 +1 +1 +0 +0 +0 +0 +0 +1 -1 +0 +0 +0 +0 +1 +0 +0 -1 -1 +0 +0 b : -30 +60 -60 +70 -40 Ab : -1 +0 +0 +0 +0 -30 +1 +1 +0 +0 +0 +60 +0 +0 +1 -1 +0 -60 +0 +0 +0 +1 +0 +70 +0 -1 -1 +0 +0 -40 Press return to continue. Copy/Paste into the octave window. Ab=[ -1,+0,+0,+0,+0,-30; +1,+1,+0,+0,+0,+60; +0,+0,+1,-1,+0,-60; +0,+0,+0,+1,+0,+70; +0,-1,-1,+0,+0,-40] rref(Ab,.00000000001) gj_TP_mR(Ab) : x2 x4 x6 x7 +1 +0 +0 +0 +0 +30 +0 +1 +0 +0 +0 +30 +0 +0 +1 +0 +0 +10 +0 +0 +0 +1 +0 +70 +0 +0 +0 +0 +0 +0 Press return to continue.