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

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 : c03a.c */ /* ------------------------------------ */ #include "v_a.h" /* ------------------------------------ */ /* ------------------------------------ */ #define RA R3 #define CA C3 #define RX R3 #define CX C1 /* ------------------------------------ */ /* ------------------------------------ */ int main(void) { double x_B[RX*CX]={ +1, +2, +3 }; double b[RA*CA]={ +1, +2, +6, +3, +4, +1, +5, +5, +2 }; double **B = ca_A_mR(b, i_mR(RA,CA)); double **x_b = ca_A_mR(x_B, i_mR(RX,CX)); double **x_s = mul_mR(B,x_b, i_mR(RX,CX)); clrscrn(); printf(" B is the base change matrix for base \"B\" \n\n" " B :"); p_mR(B,S8,P2,C7); printf(" x_b: (x_b = InvB x_s) (x in the base \"B\")"); p_mR(x_b,S8,P2,C7); printf(" x_s: (x_s = B x_b) (x in the Standard basis)"); p_mR(x_s,S8,P2,C7); stop(); f_mR(B); f_mR(x_b); f_mR(x_s); return 0; } /* ------------------------------------ */ /* ------------------------------------ */ Screen output example: B is the base change matrix for base "B" B : +1.00 +2.00 +6.00 +3.00 +4.00 +1.00 +5.00 +5.00 +2.00 x_b: (x_b = InvB x_s) (x in the base "B") +1.00 +2.00 +3.00 x_s: (x_s = B x_b) (x in the Standard basis) +23.00 +14.00 +21.00 Press return to continue.