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

Reference material by Wikibooks contributors. This retains its source identity and is not 411 news reporting.

__NOTOC__ Code study: eigs_V_mR(); You must use the algorithm of free variables . GJ_PP_FreeV_mR(); displays a zero row, introduces the free variable, solves the system, and returns a free vector. The for loop allows you to calculate all vectors. /* ------------------------------------ */ /* ------------------------------------ */ double **eigs_V_mR( double **A, double **V ) { int i; int r = rsize_R(A); double **EValue = i_mR(r,C1); double **Ab = i_Abr_Ac_bc_mR(r,r,C1); double **b = i_mR(r,C1); double **b_free = i_mR(r,r); double **Ide = eye_mR( i_mR(r,r)); double **sIde = i_mR(r,r); double **AmnssIde = i_mR(r,r); eigs_mR(A,EValue); // Compute the eigenvalues for(i = R1; i <= rsize_R(EValue); i++) { smul_mR(EValue[i][C1],Ide,sIde); // A - λ Id sub_mR(A,sIde,AmnssIde); // A|b c_A_b_Ab_mR(AmnssIde,b,Ab); // A - λ Id|0 GJ_PP_FreeV_mR(Ab,b_free); // b_free = an eigenvector c_c_mR(b_free,C2,V,i); // copy an eigenvector into V } Normalize_mR(V); f_mR(EValue); f_mR(Ab); f_mR(b); f_mR(b_free); f_mR(Ide); f_mR(sIde); f_mR(AmnssIde); return(V); } /* ------------------------------------ */ /* ------------------------------------ */