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

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 : c00c.c */ /* ------------------------------------ */ #include "v_a.h" /* ------------------------------------ */ void fun(int r) { double **A = rcentrosymmetric_mR( i_mR(r,r),9.); double **B = rcentrosymmetric_mR( i_mR(r,r),9.); double **J = J_mR( i_mR(r,r)); double **AB = mul_mR(A,B, i_mR(r,r)); double **AJ = mul_mR(A,J, i_mR(r,r)); double **JAB = mul_mR(J,AB, i_mR(r,r)); double **AJB = mul_mR(AJ,B, i_mR(r,r)); double **ABJ = mul_mR(AB,J, i_mR(r,r)); clrscrn(); printf(" A:"); p_mR(A, S5,P0,C7); printf(" B:"); p_mR(B, S5,P0,C7); printf(" J:"); p_mR(J, S5,P0,C7); stop(); clrscrn(); printf(" JAB:"); p_mR(JAB, S5,P0,C7); printf(" AJB:"); p_mR(AJB, S5,P0,C7); printf(" ABJ:"); p_mR(ABJ, S5,P0,C7); f_mR(A); f_mR(B); f_mR(J); f_mR(AB); f_mR(AJ); f_mR(JAB); f_mR(AJB); f_mR(ABJ); } /* ------------------------------------ */ int main(void) { time_t t; srand(time(&t)); do { fun( rp_I(RC2)*RC2 + RC1); } while(stop_w()); return 0; } /* ------------------------------------ */ /* ------------------------------------ */ The product of the matrix AB is centrosymmetric, since JAB = AJB = ABJ Screen output example: A: -7 -9 +9 -7 +8 -7 +9 -9 -7 B: -8 +5 -6 +1 -9 +1 -6 +5 -8 J: +0 +0 +1 +0 +1 +0 +1 +0 +0 Press return to continue. JAB: -39 +91 -7 +106 -142 +106 -7 +91 -39 AJB: -39 +91 -7 +106 -142 +106 -7 +91 -39 ABJ: -39 +91 -7 +106 -142 +106 -7 +91 -39 Press return to continue Press X return to stop