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

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 : c00d.c */ /* ------------------------------------ */ #include "v_a.h" /* ------------------------------------ */ void fun(int r) { double s = r_I(9); double **A = r_mR( i_mR(r,r),9.); double **sA = smul_mR(s,A,i_mR(r,r) ); clrscrn(); printf(" A[r][r] : r = rows \n\n\n" " ( s**r)\n" " A : (%+.0f**%d)*det_R(A) = %+.0f", s,r, pow(s,r)*det_R(A) ); p_mR(A, S4, P0, C5); printf(" sA : det_R(%+.0f A) = %+.0f ", s, det_R(sA)); p_mR(sA, S4, P0, C5); f_mR(sA); f_mR(A); } /* ------------------------------------ */ int main(void) { time_t t; srand(time(&t)); do { fun(rp_I(RC3)+C2); } while(stop_w()); return 0; } /* ------------------------------------ */ /* ------------------------------------ */ We can verify numerically that the determinant of sA is equal to the determinant of A multiplied by s to the power of r, where r is the number of rows in A Screen output example: A[r][r] : r = rows ( s**r) A : (-8**4)*det_R(A) = -11739136 -5 -9 +7 -2 +9 -8 +8 +4 +8 +5 -7 +9 -2 +5 -5 +6 sA : det_R(-8 A) = -11739136 +40 +72 -56 +16 -72 +64 -64 -32 -64 -40 +56 -72 +16 -40 +40 -48 Press return to continue Press X return to stop