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

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 : c00e.c */ /* ------------------------------------ */ #include "v_a.h" /* ------------------------------------ */ void fun(int r) { double **A = rskewsymmetric_mR( i_mR(r,r),9); double **ID = eye_mR( i_mR(r,r)); double **IDplsA = add_mR(ID,A, i_mR(r,r)); double **invIDplsA = inv_mR(IDplsA, i_mR(r,r)); double **A_invIDplsA = mul_mR(IDplsA,invIDplsA, i_mR(r,r)); clrscrn(); printf(" A:"); p_mR(A, S7,P3,C6); printf(" inv(ID+A):"); p_mR(invIDplsA, S7,P3,C6); printf(" (ID+A) inv(ID+A):"); p_mR(A_invIDplsA , S7,P3,C6); f_mR(A); f_mR(ID); f_mR(IDplsA); f_mR(invIDplsA); f_mR(A_invIDplsA); } /* ------------------------------------ */ int main(void) { time_t t; srand(time(&t)); do { fun(rp_I(R4)+R1); } while(stop_w()); return 0; } /* ------------------------------------ */ /* ------------------------------------ */ If A is an anti-symmetric matrix, then ID + A is invertible Screen output example: A: +0.000 -8.000 +8.000 +8.000 +0.000 -4.000 -8.000 +4.000 +0.000 inv(ID+A): +0.117 +0.276 +0.166 +0.166 +0.448 +0.469 +0.276 +0.414 +0.448 (ID+A) inv(ID+A): +1.000 +0.000 +0.000 +0.000 +1.000 +0.000 +0.000 +0.000 +1.000 Press return to continue Press X return to stop