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

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: c00c.c */ /* ------------------------------------ */ #include "v_a.h" /* ------------------------------------ */ #define RCA RC5 /* ------------------------------------ */ /* ------------------------------------ */ double f( double x) { return((x)*(x)*(x)); } char feq[] = "(x)*(x)*(x)"; /* ------------------------------------ */ /* ------------------------------------ */ void fun(void) { double **A = rsymmetric_mR( i_mR(RCA,RCA),999); double **A_p3 = i_mR(RCA,RCA); double **EVector = i_mR(RCA,RCA); double **EVectorT = i_mR(RCA,RCA); double **EValue = i_mR(RCA,RCA); double **f_EValue = i_mR(RCA,RCA); double **T1 = i_mR(RCA,RCA); clrscrn(); printf(" Copy/Paste into the octave windows \n"); p_Octave_mR(A,"A",P0); printf(" A*A*A\n\n"); stop(); clrscrn(); eigs_V_mR(A,EVector); transpose_mR(EVector,EVectorT); /* EValue = EVectorT A EVector */ mul_mR(EVectorT,A,T1); mul_mR(T1,EVector,EValue); printf(" A**3: EVector EValue**3 EVectorT"); f_eigs_mR(f,EValue,f_EValue); mul_mR(EVector,f_EValue,T1); mul_mR(T1,EVectorT,A_p3); pE_mR(A_p3,S10,P4,C6); printf(" A**3:"); pow_mR(3,A,T1); pE_mR(T1,S10,P4,C6); f_mR(A); f_mR(A_p3); f_mR(EVector); f_mR(EVectorT); f_mR(EValue); f_mR(f_EValue); f_mR(T1); } /* ------------------------------------ */ int main(void) { time_t t; srand(time(&t)); do { fun(); } while(stop_w()); return 0; } /* ------------------------------------ */ /* ------------------------------------ */ Screen output example: Copy/Paste into the octave windows A=[ -301,+975,-450,-173,-31; +975,-734,+210,-357,+125; -450,+210,-915,-205,+104; -173,-357,-205,-55,-102; -31,+125,+104,-102,-855] A*A*A Press return to continue. A**3: EVector EValue**3 EVectorT -1.7271e+09 +2.2593e+09 -1.4582e+09 -1.0543e+07 -1.7910e+08 +2.2593e+09 -2.4387e+09 +1.4326e+09 -2.6010e+08 +3.0933e+08 -1.4582e+09 +1.4326e+09 -1.5917e+09 -1.1716e+08 +9.2191e+07 -1.0543e+07 -2.6010e+08 -1.1716e+08 -4.1538e+07 -1.6323e+07 -1.7910e+08 +3.0933e+08 +9.2191e+07 -1.6323e+07 -6.9874e+08 A**3 -1.7271e+09 +2.2593e+09 -1.4582e+09 -1.0543e+07 -1.7910e+08 +2.2593e+09 -2.4387e+09 +1.4326e+09 -2.6010e+08 +3.0933e+08 -1.4582e+09 +1.4326e+09 -1.5917e+09 -1.1716e+08 +9.2191e+07 -1.0543e+07 -2.6010e+08 -1.1716e+08 -4.1538e+07 -1.6323e+07 -1.7910e+08 +3.0933e+08 +9.2191e+07 -1.6323e+07 -6.9874e+08 Press return to continue Press X return to stop