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. Advertising

  2. bernard <> writes:

    > is this a good practice ?
    >
    > double **AT = mul_mR(A,T,i_mR(R2,C3));


    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:

    <snip>
    > 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));


    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.
    Ben Bacarisse, Dec 31, 2009
    #2
    1. Advertising

  3. bernard

    bernard Guest

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

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Alex Young

    Good practice for signal types

    Alex Young, Oct 11, 2004, in forum: VHDL
    Replies:
    3
    Views:
    2,806
    Alan Fitch
    Oct 12, 2004
  2. Ashe Sjedic

    Profile good practice

    Ashe Sjedic, Feb 2, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    301
    Ashe Sjedic
    Feb 2, 2006
  3. Matt
    Replies:
    4
    Views:
    1,363
    Roedy Green
    Jun 23, 2004
  4. vlsidesign
    Replies:
    26
    Views:
    949
    Keith Thompson
    Jan 2, 2007
  5. SM
    Replies:
    9
    Views:
    487
Loading...

Share This Page