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

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 = r_mR( i_mR(r,r),99.); double **InvA = inv_mR(A,i_mR(r,r) ); clrscrn(); printf(" A : det_R(A) = %+.0f", det_R(A) ); p_mR(A, S4, P0, C5); printf(" InvA : 1/det_R(InvA) = %+.0f",1./det_R(InvA)); pE_mR(InvA, S12, P4, C5); f_mR(InvA); 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 A is equal to the inverse of the determinant of the inverse of A Screen output example: A : det_R(A) = +1095780 -72 -90 -17 +48 +8 +97 -42 +90 +48 InvA : 1/det_R(InvA) = +1095780 -7.6165e-03 +2.5461e-03 -7.8428e-03 -5.8205e-03 -3.8055e-03 +5.6289e-03 +4.2490e-03 +9.3632e-03 +3.4167e-03 Press return to continue Press X return to stop