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

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 : c00a.c */ /* ------------------------------------ */ #include "v_a.h" /* ------------------------------------ */ #define RA R3 #define CA C3 /* ------------------------------------ */ int main(void) { double a[RA*CA] ={ 4,2,3, 5,3,1, 8,2,2}; double **A = ca_A_mR(a,i_mR(RA,CA)); int r = R1; int c = C2; clrscrn(); printf(" A :"); p_mR(A,S5,P0,C6); printf(" minor(R%d,C%d) = %+.3f\n" " cofactor(R%d,C%d) = %+.3f\n\n\n", r,c, minor_R(A, r,c), r,c, cofactor_R(A, r,c)); printf(" cofactor(R%d,C%d) = minor(R%d,C%d)*(-1**(R%d+C%d))\n" " = minor(R%d,C%d)*(%0.0f)\n\n\n", r,c, r,c, r,c, r,c, pow(-1,(r+c))); stop(); f_mR(A); return 0; } /* ------------------------------------ */ /* ------------------------------------ */ Screen output example: A : +4 +2 +3 +5 +3 +1 +8 +2 +2 minor(R1,C2) = +2.000 cofactor(R1,C2) = -2.000 cofactor(R1,C2) = minor(R1,C2)*(-1**(R1+C2)) = minor(R1,C2)*(-1) Press return to continue.