is this a good practice ?

Discussion in 'C Programming' started by bernard, Dec 31, 2009.

  1. bernard

    bernard Guest

    Hi

    is this a good practice ?

    double **AT = mul_mR(A,T,i_mR(R2,C3));

    example:

    /* ------------------------------------ */
    #include "v_a.h"
    /* ------------------------------------ */
    int main(void)
    {
    double t[R2*C3]=
    { 1,0, 1,
    0,1, 2};

    double **T = c_a_A_mR(t,i_mR(R2,C3));
    double **A = r_mR( i_mR(R2,C2),999.);
    double **AT = mul_mR(A,T,i_mR(R2,C3));
    double **Ab = c_mR(AT, i_AbR0_mR(R2,C2,C1));


    printf(" Find a matrice, that has this reduced row-echelon form :
    \n");
    p_mR(T,5,0,6);
    getchar();

    printf(" I suggest this matrix : \n");
    p_mR(AT,5,0,6);
    getchar();

    printf("\n With the Gauss Jordan function :\n");
    p_mR(gj_mR(Ab),10,5,7);
    getchar();

    f_mR(Ab);
    f_mR(A);
    f_mR(T);
    f_mR(AT);

    return 0;
    }

    test:

    Find a matrice, that has this reduced row-echelon form :

    +1 +0 +1
    +0 +1 +2


    I suggest this matrix :

    +42 +486 +1014
    -341 -527 -1395



    With the Gauss Jordan function :

    +1.00000 -0.00000 +1.00000
    +0.00000 +1.00000 +2.00000

    Thank
     
    bernard, Dec 31, 2009
    #1
    1. Advertisements

  2. Your question is not entirely clear because we can't see enough of the
    definitions to know what is going on. I find the above, as well as this:

    hard to follow. The names are not very helpful, so from that point of
    view I think you can improve things.

    If your question is about representing 2D arrays, have you read the C
    FAQs on this topic? There is a lot of good advice, though nowadays
    you might be able to reply on C99's variably modified arrays. For
    scientific computations they simplify array parameter passing
    considerably.

    <snip>
     
    Ben Bacarisse, Dec 31, 2009
    #2
    1. Advertisements

  3. bernard

    bernard Guest

    Thank for your reply.
     
    bernard, Dec 31, 2009
    #3
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.