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

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" /* ------------------------------------ */ void fun(int r) { double **A = rsymmetric_mR( i_mR(r,r),9.); double **EValue = eigs_mR(A, i_mR(r,C1)); clrscrn(); printf(" Copy/Paste into the octave windows \n\n"); p_Octave_mR(A,"a",P0); printf(" eigs (a,%d)\n",r); printf(" rank (a)\n\n"); printf(" EValue:"); p_mR(EValue, S10,P4,C6); f_mR(A); f_mR(EValue); } /* ------------------------------------ */ int main(void) { time_t t; srand(time(&t)); do { fun(rp_I(R3)+R2); } while(stop_w()); return 0; } /* ------------------------------------ */ /* ------------------------------------ */ The rank of a symmetric matrix is ​​equal to the number of non-zero eigenvalues. Screen output example: Copy/Paste into the octave windows a=[ -5,-8,-8,-5; -8,-2,+4,-1; -8,+4,-2,+4; -5,-1,+4,+7] eigs (a,4) rank (a) EValue: +13.9555 -13.7618 -6.9042 +4.7105 Press return to continue Press X return to stop