Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C++ and Visual C++ > C++ Programming
|
C++ Programming General discussions for the C++ language. For questions specific to Microsoft's Visual C++ variant, see the Visual C++ forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C++ Programming section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old February 12th, 2005, 01:00 PM
sangi
Guest
 
Posts: n/a
Default matrix transpose(very urgent)

Hi,

   I want to multiply 2 matrices one is nx1 and another is nxn ...i know very well that nx1 has to be transposed to be multiplied with nxn...
Can anyone help me in this transpose coding in C language ....
I need it very urgent ....

Thanks in advance

Reply With Quote
  #2 (permalink)  
Old February 13th, 2005, 02:54 PM
Friend of Wrox
 
Join Date: Jul 2004
Posts: 623
Thanks: 0
Thanked 1 Time in 1 Post
Default

it depends on the structure you're using for your matrix.

_____________
Mehdi.
software student.
Reply With Quote
  #3 (permalink)  
Old February 14th, 2005, 02:30 PM
Authorized User
 
Join Date: Feb 2005
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to rockyrak
Default

hi,

if the matric u wanted to transpose is nx1, then why u r writing a separate logic for transposing and then for multiplying.

Anyway you need to walk through elements one by one. Instead of vertical traverse, you need to horizontal traversal if you transpose.

Got it? if u have the multiplication logic, do the vertical traversal and multiply. thatz it.



Ram
Reply With Quote
  #4 (permalink)  
Old February 14th, 2005, 04:20 PM
Friend of Wrox
 
Join Date: Jul 2004
Posts: 623
Thanks: 0
Thanked 1 Time in 1 Post
Default

nx1 with nxn!,you can't multiply them,if you meant nxn with nx1 your result would be a nx1 matrix.

_____________
Mehdi.
software student.
Reply With Quote
  #5 (permalink)  
Old February 15th, 2005, 07:42 AM
sangi
Guest
 
Posts: n/a
Default

hi,
yse i know it cannot be multiplied thats why i asked how to transpose a nx1 matrix to 1xn matrix ...as u said ic an multiply nxn with nx1 but i need to multiply nx1 with nxn aso i need transpose ...
as every one know axb is not equal to bxa in case of matrix

Reply With Quote
  #6 (permalink)  
Old February 15th, 2005, 03:23 PM
Friend of Wrox
 
Join Date: Jul 2004
Posts: 623
Thanks: 0
Thanked 1 Time in 1 Post
Default

okay so tell I am going to multiply 1xn with nxn,i.e for multiplying 1xn with nxn,

             |1 2 3|
|3 2 1| x |0 1 0| = 3 times the first row+2 times the second row +1 time the third row=
             |2 0 0|

                    |3 6 9|+|0 2 0|+|2 0 0|=|5 8 9|

and all of that depends on the structure you are using for your matrix.

_____________
Mehdi.
software student.
Reply With Quote
  #7 (permalink)  
Old February 15th, 2005, 05:35 PM
sangi
Guest
 
Posts: n/a
Default

hi mehdi,
hope it works ...so can i do it without transforming to the
1xn
i mean if the matri

1 1 2 3
2 x 4 5 6
3 7 8 9

then how to do it without transforming .....
can u tell me in c program ....
bcoz of this i am getting struck up and strugling a lot
kindly help me




Reply With Quote





Similar Threads
Thread Thread Starter Forum Replies Last Post
Transpose Tables abc052107 Visual Studio 2005 0 August 23rd, 2007 12:40 AM
Help with transpose fegasa Excel VBA 3 April 7th, 2006 03:43 AM
Transpose Rows JpJoe Access 10 March 17th, 2005 08:15 AM
transfer and transpose sham Excel VBA 4 March 6th, 2005 12:13 PM
alignment of text on dot matrix using vb...urgent syed rose VB How-To 1 July 8th, 2004 06:45 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.