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

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 : c00b.c */ /* ------------------------------------ */ #include "v_a.h" /* ------------------------------------ */ int main(void) { double u_T[R1*C3] = { 4, 2, 5}; double v_T[R1*C3] = { 3, 4, 1}; double w_T[R1*C3] = { 5, 1, 3}; double **U_T = ca_A_mR(u_T , i_mR(R1,C3)); double **V_T = ca_A_mR(v_T , i_mR(R1,C3)); double **W_T = ca_A_mR(w_T , i_mR(R1,C3)); double **VxU = UxV_mR(V_T,U_T, i_mR(R1,C3)); double **WxU = UxV_mR(W_T,U_T, i_mR(R1,C3)); double **VxU_pls_WxU = add_mR(VxU,WxU, i_mR(R1,C3)); double **VplusW = add_mR(V_T,W_T, i_mR(R1,C3)); double **VplusW_xU = UxV_mR(VplusW,U_T, i_mR(R1,C3)); clrscrn(); printf(" u_T:"); p_mR(U_T, S4, P0, C6); printf(" v_T:"); p_mR(V_T, S4, P0, C6); printf(" w_T:"); p_mR(W_T, S4, P0, C6); printf("\n\n" " (v+w) x u:"); p_mR(VplusW_xU, S5, P0, C6); printf(" (vxu) + (wxu):"); p_mR(VxU_pls_WxU, S5, P0, C6); stop(); f_mR(U_T); f_mR(V_T); f_mR(W_T); f_mR(VxU); f_mR(WxU); f_mR(VxU_pls_WxU); f_mR(VplusW); f_mR(VplusW_xU); return 0; } /* ------------------------------------ */ /* ------------------------------------ */ (v+w) x u == (vxu) + (wxu):. Screen output example: u_T : +4 +2 +5 v_T : +3 +4 +1 w_T : +5 +1 +3 (v+w) x u : +17 -24 -4 (vxu) + (wxu) : +17 -24 -4 Press return to continue.