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

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" /* ------------------------------------ */ /* ------------------------------------ */ double **X_rdefinite_positive_mR( double **A, int n ) { int r = rsize_R(A); double **T = r_mR( i_mR(r,r),n); double **TT = transpose_mR(T, i_mR(r,r)); mul_mR(T,TT,A); f_mR(T); f_mR(TT); return(A); } /* ------------------------------------ */ /* ------------------------------------ */ void fun(int r) { double **A = rdefinite_positive_mR( i_mR(r,r), 99); double **EValue = eigs_mR(A, i_mR(r,C1)); clrscrn(); printf(" A:"); p_mR(A, S12,P3,C6); printf(" Eigenvalue: eigs_mR(A,EValue);"); p_mR(EValue, S12,P3,C1); 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; } /* ------------------------------------ */ /* ------------------------------------ */ Screen output example: A: +15918.000 +3710.000 +5430.000 -842.000 +3710.000 +8001.000 -5786.000 -206.000 +5430.000 -5786.000 +11079.000 +2942.000 -842.000 -206.000 +2942.000 +8782.000 Eigenvalue: eigs_mR(A,EValue); +19529.066 +15379.973 +8451.614 +419.347 Press return to continue Press X return to stop