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

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 **U_T = ca_A_mR(u_T , i_mR(R1,C3)); double **V_T = ca_A_mR(v_T , i_mR(R1,C3)); double **UxV = UxV_mR(U_T,V_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("\n\n" " u x v : With UxV_mR();"); p_mR(UxV, S5, P0, C6); stop(); f_mR(U_T); f_mR(V_T); f_mR(UxV); return 0; } /* ------------------------------------ */ /* ------------------------------------ */ Vectors in mathematics are assumed to be column vectors, which is why I use _T (Transpose) to display row vectors. Screen output example: u_T: +4 +2 +5 v_T: +3 +4 +1 u x v : With UxV_mR(); -18 +11 +10 Press return to continue.