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

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 RCA RC6 /* ------------------------------------ */ void fun(void) { double d[RCA*RCA] ={ +1, +0, +0, +0, +0, +0, +0, +1, +0, +0, +0, +0, +0, +0, +1, +0, +0, +0, +0, +0, +0, +1, +0, +0, +0, +0, +0, +0, +1, +0, +0, +0, +0, +0, +0, +0 }; double **D = ca_A_mR(d, i_mR(RCA,RCA)); double **A = rdefpos_diag_mR(D, i_mR(RCA,RCA),99); clrscrn(); printf(" A:"); p_mR(A, S8,P12, C4); printf(" D = EValue:"); p_mR(D, S8,P2, C6); stop(); clrscrn(); printf(" Choose your eigenvalues (D)," " and copy these lines into the next C file\n\n\n" " A:"); P_mR(A, S8,P12, C6); f_mR(A); f_mR(D); } /* ------------------------------------ */ int main(void) { time_t t; srand(time(&t)); do { fun(); } while(stop_w()); return 0; } /* ------------------------------------ */ /* ------------------------------------ */ Screen output example: A: +0.853214156635 +0.223697489745 -0.130729221324 -0.180799128390 +0.223697489745 +0.659091328080 +0.199227650133 +0.275532777834 -0.130729221324 +0.199227650133 +0.883570997610 -0.161021858298 -0.180799128390 +0.275532777834 -0.161021858298 +0.777306012096 -0.123227848855 +0.187795769834 -0.109748190676 -0.151782264254 -0.101171318892 +0.154182239592 -0.090104382248 -0.124614784740 -0.123227848855 -0.101171318892 +0.187795769834 +0.154182239592 -0.109748190676 -0.090104382248 -0.151782264254 -0.124614784740 +0.896549269431 -0.084934103365 -0.084934103365 +0.930268236148 D = EValue: +1.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +1.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +1.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +1.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +1.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 +0.00 Press return to continue. Choose your eigenvalues (D), and copy these lines into the next C file A: +0.853214156635, +0.223697489745, -0.130729221324, -0.180799128390, -0.123227848855, -0.101171318892, +0.223697489745, +0.659091328080, +0.199227650133, +0.275532777834, +0.187795769834, +0.154182239592, -0.130729221324, +0.199227650133, +0.883570997610, -0.161021858298, -0.109748190676, -0.090104382248, -0.180799128390, +0.275532777834, -0.161021858298, +0.777306012096, -0.151782264254, -0.124614784740, -0.123227848855, +0.187795769834, -0.109748190676, -0.151782264254, +0.896549269431, -0.084934103365, -0.101171318892, +0.154182239592, -0.090104382248, -0.124614784740, -0.084934103365, +0.930268236148 Press return to continue Press X return to stop