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

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" /* ------------------------------------ */ void fun(void) { double s = r_I(9); double **U_T = r_mR( i_mR(R1, C3), 9); double **V_T = r_mR( i_mR(R1, C3), 9); double **sU_T = smul_mR(s,U_T, i_mR(R1, C3)); double **sV_T = smul_mR(s,V_T, i_mR(R1, C3)); double **UxV_T = UxV_mR(U_T,V_T, i_mR(R1,C3)); double **s_UxV_T = smul_mR(s,UxV_T, i_mR(R1, C3)); double **sUxV_T = UxV_mR(sU_T,V_T, i_mR(R1,C3)); double **UxsV_T = UxV_mR(U_T,sV_T, i_mR(R1,C3)); clrscrn(); printf(" s = %+.0f\n\n",s); printf(" u_T:"); p_mR(U_T, S4, P0, C6); printf(" v_T:"); p_mR(V_T, S4, P0, C6); printf("\n" " s (uxv) == su x v == u x sv\n\n" " s (uxv):" ); p_mR(s_UxV_T, S5, P0, C6); printf(" su x v:" ); p_mR(sUxV_T, S5, P0, C6); printf(" u x sv:" ); p_mR(UxsV_T, S5, P0, C6); f_mR(U_T); f_mR(V_T); f_mR(sU_T); f_mR(sV_T); f_mR(UxV_T); f_mR(s_UxV_T); f_mR(sUxV_T); f_mR(UxsV_T); } /* ------------------------------------ */ int main(void) { time_t t; srand(time(&t)); do { fun(); } while(stop_w()); return 0; } /* ------------------------------------ */ /* ------------------------------------ */ s (uxv) == su x v == u x sv: Screen output example: s = -2 u_T : -2 +8 -7 v_T : +4 +5 +2 s (uxv) == su x v == u x sv s (uxv) : -102 +48 +84 su x v : -102 +48 +84 u x sv : -102 +48 +84 Press return to continue Press X return to stop