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

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 : c00h.c */ /* ------------------------------------ */ #include "v_a.h" /* ------------------------------------ */ void fun(int r) { double **U = r_mR(i_mR(r,r),9.); double **Orth = i_mR(r,r); double **Orth_Normal = i_mR(r,r); double **Orth_Normal_T = i_mR(r,r); clrscrn(); printf(" U :"); p_mR(U, S8,P4, C6); printf(" Orth : orth_mR(U,Orth,NO);"); orth_mR(U,Orth,NO); p_mR(Orth, S8,P4, C6); stop(); clrscrn(); printf(" Orth_Normal : normalize_mR(Orth,Orth_Normal);"); normalize_mR(Orth,Orth_Normal); p_mR(Orth_Normal, S8,P4, C6); printf(" Orth_Normal_T : transpose_mR(Orth_Normal,Orth_Normal_T);"); transpose_mR(Orth_Normal,Orth_Normal_T); p_mR(Orth_Normal_T, S8,P4, C6); printf(" Orth_Normal_T Orth_Normal :"); mul_mR(Orth_Normal_T,Orth_Normal, U); p_mR(U, S8,P4, C6); f_mR(U); f_mR(Orth); f_mR(Orth_Normal); f_mR(Orth_Normal_T); } /* ------------------------------------ */ int main(void) { time_t t; srand(time(&t)); do { fun(rp_I(R2)+R2); } while(stop_w()); return 0; } /* ------------------------------------ */ /* ------------------------------------ */ Screen output example: U : -5.0000 -1.0000 -7.0000 -4.0000 +8.0000 -1.0000 +9.0000 -1.0000 +8.0000 -1.0000 +1.0000 -1.0000 -6.0000 +3.0000 +4.0000 -6.0000 Orth : orth_mR(U,Orth,NO); -5.0000 -1.7672 +0.7821 -4.1397 +8.0000 +0.2275 +4.4562 -1.5236 +8.0000 +0.2275 -3.5438 -3.3060 -6.0000 +2.0794 +0.5648 -2.9898 Press return to continue. Orth_Normal : normalize_mR(Orth,Orth_Normal); -0.3637 -0.6431 +0.1354 -0.6601 +0.5819 +0.0828 +0.7717 -0.2430 +0.5819 +0.0828 -0.6137 -0.5272 -0.4364 +0.7567 +0.0978 -0.4768 Orth_Normal_T : transpose_mR(Orth_Normal,Orth_Normal_T); -0.3637 +0.5819 +0.5819 -0.4364 -0.6431 +0.0828 +0.0828 +0.7567 +0.1354 +0.7717 -0.6137 +0.0978 -0.6601 -0.2430 -0.5272 -0.4768 Orth_Normal_T Orth_Normal : +1.0000 +0.0000 +0.0000 -0.0000 +0.0000 +1.0000 +0.0000 +0.0000 +0.0000 +0.0000 +1.0000 +0.0000 -0.0000 +0.0000 +0.0000 +1.0000 Press return to continue Press X return to stop