PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

CUDA-x86.

Matrix outpout
Goto page 1, 2  Next
 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling
View previous topic :: View next topic  
Author Message
camaptrang



Joined: 28 May 2013
Posts: 19

PostPosted: Tue Jun 11, 2013 3:15 am    Post subject: Matrix outpout Reply with quote

Hi all,
I have a problem. The result that i want to obtain is a matrix 2x2(note C). The parameter that i give to calculate the matrix C are a(n),b(n). So I want to obtains n matrix. What is the idea to do i?
Thank of avance
Back to top
View user's profile
mkcolg



Joined: 30 Jun 2004
Posts: 6126
Location: The Portland Group Inc.

PostPosted: Tue Jun 11, 2013 1:51 pm    Post subject: Reply with quote

Hi camaptrang,

Sorry but I'm not quite sure what you're asking. Are "a" and "b" linearized 2-D arrays where n=2 (2x2)? If so, then just take the normal matrix multiply algorithm and instead of accessing using a[i][j], use a computed index "idx=i*2+j".

- Mat
Back to top
View user's profile
camaptrang



Joined: 28 May 2013
Posts: 19

PostPosted: Wed Jun 12, 2013 12:38 am    Post subject: Matrix outpout Reply with quote

Hi,
I'm sorry, I ased a question not clear. Example, I have n couple (a(i),b(i)),i=1,n. I want to calcul matrix A(mxk) n time. Example, at 1-th step, i have
A(i,j)=a(1)^i*b(1)^j; i=1,...,m;j=1,...,n
.
.
.
at n-th step, i have
A(i,j)=a(n)^i*b(n)^j; i=1,...,m;j=1,...,n
The results which I want to obtains are n matrix A(mxk)
Thank you of avance.
Back to top
View user's profile
mecej4



Joined: 19 Jun 2011
Posts: 55

PostPosted: Wed Jun 12, 2013 3:59 am    Post subject: Re: Matrix outpout Reply with quote

camaptrang wrote:
Hi,
...I have n couple (a(i),b(i)),i=1,n. I want to calcul matrix A(mxk) n time.

A(i,j)=a(1)^i*b(1)^j; i=1,...,m;j=1,...,n
.
.
A(i,j)=a(n)^i*b(n)^j; i=1,...,m;j=1,...,n
The results which I want to obtains are n matrix A(mxk)


What is k? There is no occurrence of k in the definitions of A(i,j) that you gave. Given that i=1:m and j=1:n, according to the definitions A is m x n, not m x k, unless k=n.

I am reminded of what one of my mathematics teachers used to drill into his students: "A problem well defined is a problem half solved".
Back to top
View user's profile
camaptrang



Joined: 28 May 2013
Posts: 19

PostPosted: Wed Jun 12, 2013 6:19 am    Post subject: Matrix outpout Reply with quote

Hi,
A is a matrix of size mxk, then j=1,..,k. I had a mistake.
Thank you.
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling All times are GMT - 7 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © phpBB Group