Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > is this a good practice ?

Reply
Thread Tools

is this a good practice ?

 
 
bernard
Guest
Posts: n/a
 
      12-31-2009
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
 
Reply With Quote
 
 
 
 
Ben Bacarisse
Guest
Posts: n/a
 
      12-31-2009
bernard <(E-Mail Removed)> 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.
 
Reply With Quote
 
 
 
 
bernard
Guest
Posts: n/a
 
      12-31-2009
Thank for your reply.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Looking for a Good Sim to Practice on and a good book? Pat MCSA 2 03-29-2008 12:19 AM
Is this good code? Good practice advice needed... SM HTML 9 11-12-2007 03:39 AM
good algorithms come with practice and reading good code/books? vlsidesign C Programming 26 01-02-2007 09:50 AM
Remember when your piano teacher taught you, "Practice, practice,practice ...?" Wayne Wastier Windows 64bit 3 06-10-2005 08:29 PM
Good practice for signal types Alex Young VHDL 3 10-12-2004 08:40 AM



Advertisments