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

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

__NOTOC__ Choose your eigenvalues Introduce the values for the eigenvalues on the diagonal /* ------------------------------------ */ 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)); /* ------------------------------------ */ With this function you can choose the values of your eigenvalues. /* ------------------------------------ */ double **rdefpos_diag_mR( double **D, /* Choose your eigenvalues */ double **A, int n /* Control the function: r_Q_mR(); */ ) { int r = rsize_R(A); double **Q = r_Q_mR( i_mR(r,r),n); /* You create an orthogonal matrix. */ double **invQ = invgj_mR(Q, i_mR(r,r)); /* You take its inverse. */ double **QD = mul_mR(Q,D, i_mR(r,r)); /* You compute: A = Q D invQ */ /* A = Q D invQ */ mul_mR(QD,invQ,A); f_mR(Q); f_mR(invQ); f_mR(QD); return(A); } /* ------------------------------------ */ Application You can choose the values of the eigenvalues with the function: rdefpos_diag_mR(); c00a.c Let's check the result c00b.c An example: The Projection of a space onto a hyperplan (R**6)