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

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 : c00b.c */ /* ------------------------------------ */ #include "v_a.h" /* ------------------------------------ */ #define RCA RC6 /* ------------------------------------ */ int main(void) { double a[RCA*RCA]={ +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}; double **A = ca_A_mR(a, i_mR(RCA,RCA)); double **EValue = eigs_mR(A, i_mR(RCA,C1)); clrscrn(); printf(" Copy/Paste into the octave windows \n\n"); p_Octave_mR(A,"a",P12); printf(" EigenValues = eigs (a,%d) \n\n",RCA); stop(); clrscrn(); printf(" EigenValues:"); p_mR(EValue, S13,P3,C1); stop(); f_mR(A); f_mR(EValue); return 0; } /* ------------------------------------ */ /* ------------------------------------ */ Screen output example: Copy/Paste into the octave windows 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] EigenValues = eigs (a,6) Press return to continue. EigenValues: +1.000 +1.000 +1.000 +1.000 +1.000 -0.000 Press return to continue.