473,385 Members | 1,676 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

transpose of a nx1 matrix

Hi,
i need to transpose a nx1 matrix to 1xn matrix inorder to multiply
with nxn matrix in c language ...
can anyone help in this coding ..the nx1 matrix is pi[i] the data type
is double *pi..this is used through out the program ..now i need this
transpose for further calculations....

Kindly help as soon as possible.....if this is not possible kindly
suggest me something...
Nov 14 '05 #1
7 12002
911 is busy. Please call later.

Nov 14 '05 #2
sangeetha wrote:
Hi,
i need to transpose a nx1 matrix to 1xn matrix inorder to multiply
with nxn matrix in c language ...
can anyone help in this coding ..the nx1 matrix is pi[i] the data type
is double *pi..this is used through out the program ..now i need this
transpose for further calculations....

Kindly help as soon as possible.....if this is not possible kindly
suggest me something...


I suggest you write the code for the matrix multiplication,
have a long look at it and try to find out what happens if
you exchange your index variables. If you still have problems,
then come back here -- with code.

-Michael
--
E-Mail: Mine is an /at/ gmx /dot/ de address.
Nov 14 '05 #3
sangeetha wrote:
Hi,
i need to transpose a nx1 matrix to 1xn matrix inorder to multiply
with nxn matrix in c language ...
can anyone help in this coding ..the nx1 matrix is pi[i] the data type is double *pi..this is used through out the program ..now i need this
transpose for further calculations....

Kindly help as soon as possible.....if this is not possible kindly
suggest me something...

General notes about transposes of matrices:

If A = B^t, then A is the transpose of B

and also if B = b(i,j) then A = a(j,i)

---

Writing code to find A given B (general transpose algorithm) is much
easier than writing code to mulitply two matrices. If you are the one
who coded your matrix multiplying functions, then you should have no
problem doing this.
In your case, you are starting with a column vector and require
transposing to a row vector. Just treat the column vector as a row
vector whenever you need the transpose (an array with one dimension can
be treated as a column or a row). Just pass your column vector to the
matrix multiplying function (along with your nxn matrix) in a way that
the function thinks it's receiving a row vector. More specific help
will require more details about the current state of your code.
Good luck.

Nov 14 '05 #4
CAN EXPLAIN ME WITH THE CODING ....
"Kiru Sengal" <ki*********@gmail.com> wrote in message news:<11*********************@l41g2000cwc.googlegr oups.com>...
sangeetha wrote:
Hi,
i need to transpose a nx1 matrix to 1xn matrix inorder to multiply
with nxn matrix in c language ...
can anyone help in this coding ..the nx1 matrix is pi[i] the data

type
is double *pi..this is used through out the program ..now i need this
transpose for further calculations....

Kindly help as soon as possible.....if this is not possible kindly
suggest me something...

General notes about transposes of matrices:

If A = B^t, then A is the transpose of B

and also if B = b(i,j) then A = a(j,i)

---

Writing code to find A given B (general transpose algorithm) is much
easier than writing code to mulitply two matrices. If you are the one
who coded your matrix multiplying functions, then you should have no
problem doing this.
In your case, you are starting with a column vector and require
transposing to a row vector. Just treat the column vector as a row
vector whenever you need the transpose (an array with one dimension can
be treated as a column or a row). Just pass your column vector to the
matrix multiplying function (along with your nxn matrix) in a way that
the function thinks it's receiving a row vector. More specific help
will require more details about the current state of your code.
Good luck.

Nov 14 '05 #5
CAN YOU EXPLAIN ME WITH THE CODING...
"Kiru Sengal" <ki*********@gmail.com> wrote in message news:<11*********************@l41g2000cwc.googlegr oups.com>...
sangeetha wrote:
Hi,
i need to transpose a nx1 matrix to 1xn matrix inorder to multiply
with nxn matrix in c language ...
can anyone help in this coding ..the nx1 matrix is pi[i] the data

type
is double *pi..this is used through out the program ..now i need this
transpose for further calculations....

Kindly help as soon as possible.....if this is not possible kindly
suggest me something...

General notes about transposes of matrices:

If A = B^t, then A is the transpose of B

and also if B = b(i,j) then A = a(j,i)

---

Writing code to find A given B (general transpose algorithm) is much
easier than writing code to mulitply two matrices. If you are the one
who coded your matrix multiplying functions, then you should have no
problem doing this.
In your case, you are starting with a column vector and require
transposing to a row vector. Just treat the column vector as a row
vector whenever you need the transpose (an array with one dimension can
be treated as a column or a row). Just pass your column vector to the
matrix multiplying function (along with your nxn matrix) in a way that
the function thinks it's receiving a row vector. More specific help
will require more details about the current state of your code.
Good luck.

Nov 14 '05 #6
sangeetha wrote:

I need to transpose a nx1 matrix to 1xn matrix
in order to multiply with nxn matrix in C.
No. You don't.
Can anyone help in this coding?
The nx1 matrix is pi[i] the data type is double *pi.
This is used through out the program.
Now I need this transpose for further calculations.

Kindly help as soon as possible.
If this is not possible kindly suggest me something.


The C computer programming language doesn't know anything
about matrices, rows or columns.
Your 1-dimensional array

double pi[];

can represent either a row or a column.
you don't need to "transpose" it.

Nov 14 '05 #7
>> I need to transpose a nx1 matrix to 1xn matrix
in order to multiply with nxn matrix in C.


No. You don't.
The nx1 matrix is pi[i] the data type is double *pi.
Now I need this transpose for further calculations.


The C computer programming language doesn't know anything
about matrices, rows or columns.
Your 1-dimensional array

double pi[];

can represent either a row or a column.
you don't need to "transpose" it.


Oh - Good spotting Robert

If all your matricies are one dimensional then transposition does not come
into play. However, if you have ordinary matricies that need transposed
then it is all in the way you traverse the array. A series of nested for
loops to be exact. If you can read Fortran code take a look at
http://www.netlib.org/blas/dgemm.f for code to multiply 2 dimensional
matricies.

Regards
Dawn
Nov 14 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Tuong Do | last post by:
Hi I have a table with data like this ID Type 1 A 1 B 1 C 2 A 2 C
1
by: jenny.rhodes | last post by:
Hello, Please can anyone guide me on how to transpose an access table where I have many records per id eg UserID Question Answer 1 1 a 1 2 d 1 3 ...
1
by: Jenny | last post by:
Hello, Please can anyone guide me on how to transpose an access table where I have many records per id eg UserID Question Answer 1 1 a 1 2 d
3
by: Gerard Brunick | last post by:
My way is ugly. These has to be a better way. Thanks, Gerard
0
by: shantanu | last post by:
I am trying to convert a macro code to c# that will copy the values of a column and paste to anather through paste special. Everything is working fine but the transpose meathod to paste the column...
4
by: tabishazmi | last post by:
hi i m too new to this site and c programming too can u post the program of transpose of matrix using arrays
2
by: prads | last post by:
Hello, 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...
2
by: jbd | last post by:
Hi I'm adapting some code I've written using 2d arrays (to represent matrices) to handle large arrays such that double matrix goes to double **matrix and then I'm using malloc. It seems to work...
4
by: pc_whocares | last post by:
My forehead is flat from pounding. I am building a DLL in VS2005 C++ for use in another software development platform. I am required to pass my array data in/out of the function via a...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.