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

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" /* ------------------------------------ */ int main(void) { time_t t; srand(time(&t)); double ta[R3*C4]={ 1,0,0, 15, 0,1,0, 20, 0,0,1, 2}; double **T = ca_A_mR(ta, i_mR(R3,C4)); double **A = r_mR( i_mR(R3,C3),9); double **AT = mul_mR(A,T, i_mR(R3,C4)); double **Ab = gj_TP_mR(c_mR(AT, i_Abr_Ac_bc_mR(R3,C3,C1))); clrscrn(); printf(" You want to create this nonlinear system of equations :\n"); printf("\n"); printf(" a X*Y + b X*Z + c Z**(1/2) = d \n"); printf(" e X*Y + f X*Z + g Z**(1/2) = h \n"); printf(" i X*Y + j X*Z + k Z**(1/2) = l \n"); printf("\n"); printf(" With X = 5, Y = 3, Z = 4 \n"); printf(" You have X*Y = 15, X*Z = 20, Z**(1/2) = 2 \n"); printf("\n"); printf(" In fact, you want to find a matrix, \n"); printf(" which has this reduced row-echelon form :\n\n" "Ab:"); p_mR(T, S7,P3,C6); stop(); clrscrn(); printf(" If :\n\n A = r_mR(i_mR(R3,C3),9); "); p_mR(A, S7,P3,C6); printf(" And :\n\n T:"); p_mR(T, S7,P3,C6); printf(" I suggest this matrix : AT = Ab\n\n" " Ab:"); p_mR(AT, S8,P3,C6); stop(); clrscrn(); printf("\n With the Gauss Jordan function :\n" "Ab:"); p_mR(Ab, S7,P3,C6); stop(); f_mR(Ab); f_mR(A); f_mR(T); f_mR(AT); return 0; } /* ------------------------------------ */ /* ------------------------------------ */ Screen output example: You want to create this nonlinear system of equations : a X*Y + b X*Z + c Z**(1/2) = d e X*Y + f X*Z + g Z**(1/2) = h i X*Y + j X*Z + k Z**(1/2) = l With X = 5, Y = 3, Z = 4 You have X*Y = 15, X*Z = 20, Z**(1/2) = 2 In fact, you want to find a matrix, which has this reduced row-echelon form : Ab: +1.000 +0.000 +0.000 +15.000 +0.000 +1.000 +0.000 +20.000 +0.000 +0.000 +1.000 +2.000 Press return to continue. If : A = r_mR(i_mR(R3,C3),9); +3.000 +2.000 +6.000 +5.000 -1.000 +5.000 -3.000 -8.000 -7.000 And : T: +1.000 +0.000 +0.000 +15.000 +0.000 +1.000 +0.000 +20.000 +0.000 +0.000 +1.000 +2.000 I suggest this matrix : AT = Ab Ab: +3.000 +2.000 +6.000 +97.000 +5.000 -1.000 +5.000 +65.000 -3.000 -8.000 -7.000 -219.000 Press return to continue. With the Gauss Jordan function : Ab: +1.000 -0.000 -0.000 +15.000 +0.000 +1.000 +0.000 +20.000 +0.000 +0.000 +1.000 +2.000 Press return to continue.