473,657 Members | 2,654 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 12052
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*********@gm ail.com> wrote in message news:<11******* **************@ l41g2000cwc.goo glegroups.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*********@gm ail.com> wrote in message news:<11******* **************@ l41g2000cwc.goo glegroups.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
39305
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
6422
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 c 1 4 d
1
2328
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
3118
by: Gerard Brunick | last post by:
My way is ugly. These has to be a better way. Thanks, Gerard
0
7273
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 value as row value is not working. Can someone kindly look into the code, if i am missing something. C# Code ------------ private void ManipulateXLS() {
4
3397
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
6782
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 found. Say i have an array a whose transpose is reqd? Thanks, Prads
2
2803
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 fine for part of my program up to where I have to find the matrix transpose at which point it does something I don't understand. I've taken that bit of code out and run it by itself (included below), get the same problem... which is that the input...
4
4035
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 pointer, in this case, to double. The simplest way for me to transpose the array is via addressing its individual elements in the conventional form such as
0
8306
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8825
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8732
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8503
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8605
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6164
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4152
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4304
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1955
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.