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

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" /* ------------------------------------ */ int main(void) { double a[R3*C3]={ 2,1,1, 9,9,9, 9,9,9 }; double id[R3*C3]={1./2.,0,0, 0,1,0, 0,0,1 }; double **A = ca_A_mR(a, i_mR(R3,C3)); double **ID = ca_A_mR(id,i_mR(R3,C3)); double **IDA = mul_mR(ID,A,i_mR(R3,C3)); clrscrn(); printf(" The pivot at one\n\n"); printf(" ID:"); p_mR(ID, S3,P2,C6); printf(" A:"); p_mR(A, S3,P2,C6); printf(" ID A:"); p_mR(IDA, S3,P2,C6); stop(); f_mR(A); f_mR(ID); f_mR(IDA); return 0; } /* ------------------------------------ */ /* ------------------------------------ */ The pivot at one: Screen output example: The pivot at one ID: +0.50 +0.00 +0.00 +0.00 +1.00 +0.00 +0.00 +0.00 +1.00 A: +2.00 +1.00 +1.00 +9.00 +9.00 +9.00 +9.00 +9.00 +9.00 ID A: +1.00 +0.50 +0.50 +9.00 +9.00 +9.00 +9.00 +9.00 +9.00 Press return to continue.