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

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 rc) { double **A = r_mR( i_mR(rc,rc),9); double **A_t = transpose_mR(A,i_mR(rc,rc) ); clrscrn(); printf(" A:"); p_mR(A, S3,P0,C6); printf(" A_t:"); p_mR(A_t, S3,P0,C6); printf("\n" " Trace(A ) = %+.0f\n" " Trace(A_t) = %+.0f\n", trace_R(A), trace_R(A_t)); f_mR(A); f_mR(A_t); } /* ------------------------------------ */ int main(void) { time_t t; srand(time(&t)); do fun(rp_I(RC5)); while(stop_w()); return 0; } /* ------------------------------------ */ /* ------------------------------------ */ trace(A) = trace(A_t): Screen output example: A: +2 +1 +3 -1 +4 -3 -9 +2 +8 A_t: +2 -1 -9 +1 +4 +2 +3 -3 +8 Trace(A ) = +14 Trace(A_t) = +14 Press return to continue Press X return to stop