By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,395 Members | 2,541 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,395 IT Pros & Developers. It's quick & easy.

Transpose of a non-square matrix

P: 25
Can anybody tell me how i shud go about to perform the transpose of a nonsquare matrix array. Pls give me an idea so that i can write one based on that and then post queries if errors r found. Say i have an array a[10] whose transpose is reqd?
Nov 3 '07 #1
Share this Question
Share on Google+
2 Replies

Expert 100+
P: 671
An array of 10 of is effectively one row and 10 columns. It's transpose is one 1 column and 10 rows.

Before you can assign any numbers, you need to get the appropriate data type. It's multi-dimensional arrays obviously, so let's see some code (or pseudocode logic) that shows how you create the array for the transpose.
Nov 4 '07 #2

Expert Mod 5K+
P: 9,197
And keep in mind that in C++
Expand|Select|Wrap|Line Numbers
  2. int array[10][1];
  4. int arrayA[1][10];
have exactly the same memory layout as int arr[10]

Expand|Select|Wrap|Line Numbers
  2. int array[5][10];
  4. int arrayA[10][5];
have exactly the same memory layout as int arr[50].

I believe you can do the transpose with a typecast.
Nov 4 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.