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

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 s = rp_I(8)+1; double **A = rsymmetric_mR( i_mR(r, r),99.); double **EValueA = eigs_mR(A, i_mR(r,C1)); double **ID = eye_mR( i_mR(r, r)); double **sID = smul_mR(s, ID,i_mR(r, r)); double **Apls_sID = add_mR(A, sID,i_mR(r, r)); double **EValueApls_sID = eigs_mR(Apls_sID,i_mR(r,C1)); double **M = m1_mR( i_mR(r,C1)); double **sM = smul_mR(s,M, i_mR(r,C1)); clrscrn(); printf(" A:"); p_mR(A,S3,P0,C6); printf(" EValueA:"); p_mR(EValueA,S13,P6,C1); printf(" A+%.0fID:",s); p_mR(Apls_sID,S4,P0,C6); printf(" EValueA+%.0fID:",s); p_mR(EValueApls_sID,S13,P6,C1); stop(); clrscrn(); printf(" EValueA:"); p_mR(EValueA,S13,P6,C1); printf(" EValueA+%.0fID:",s); p_mR(EValueApls_sID,S13,P6,C1); printf(" EValueA + %.0f:",s); add_mR(EValueA,sM,M); p_mR(M,S13,P6,C1); f_mR(A); f_mR(EValueA); f_mR(ID); f_mR(sID); f_mR(Apls_sID); f_mR(EValueApls_sID); f_mR(M); f_mR(sM); } /* ------------------------------------ */ int main(void) { time_t t; srand(time(&t)); do { fun(rp_I(R2)+R2); } while(stop_w()); return 0; } /* ------------------------------------ */ /* ------------------------------------ */ Screen output example: A: -87 +28 -16 +84 +28 -21 -71 +45 -16 -71 +25 -90 +84 +45 -90 +60 EValueA: +190.984852 -132.592212 -67.065911 -14.326730 A+3ID: -84 +28 -16 +84 +28 -18 -71 +45 -16 -71 +28 -90 +84 +45 -90 +63 EValueA+3ID: +193.984852 -129.592212 -64.065911 -11.326730 Press return to continue. EValueA: +190.984852 -132.592212 -67.065911 -14.326730 EValueA+3ID: +193.984852 -129.592212 -64.065911 -11.326730 EValueA + 3: +193.984852 -129.592212 -64.065911 -11.326730 Press return to continue Press X return to stop