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

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" /* ------------------------------------ */ /* ------------------------------------ */ double **X_c_r_mR( double **A, int rA, double **B, int rB ) { int c; for(c=C1; c<A[C_SIZE][C0]; c++) B[rB][c] = A[rA][c]; return(B); } /* ------------------------------------ */ /* ------------------------------------ */ void fun(int r,int c) { double **A = r_mR(i_mR(r,c),99.); double **B = i_mR(r,c); clrscrn(); printf(" A :"); p_mR(A, S5,P0,C10); printf(" B : c_r_mR(A,R1,B,R2);"); c_r_mR(A,R1,B,R2); p_mR(B, S5,P0,C10); f_mR(A); f_mR(B); } /* ------------------------------------ */ int main(void) { time_t t; srand(time(&t)); int i; do { i = rp_I(R3)+R1; fun(i,i+C1); } while(stop_w()); return 0; } /* ------------------------------------ */ /* ------------------------------------ */ Copy a row from matrix A into matrix B : Screen output example: A : -98 -41 -8 -19 -83 +10 -97 -80 +96 +56 +75 -1 B : c_r_mR(A,R1,B,R2); +0 +0 +0 +0 -98 -41 -8 -19 +0 +0 +0 +0 Press return to continue Press X return to stop