comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Matrix Multiplication in IDL
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Matrix Multiplication in IDL [message #35997] Mon, 04 August 2003 13:31
K Banerjee is currently offline  K Banerjee
Messages: 14
Registered: September 2001
Junior Member
Folks,

In IDL:

VB> a = indgen(2, 4) - 2
VB> print, a ; Actually prints transpose(a)
-2 -1
0 1
2 3
4 5
VB> help, a ; a is a (2 x 4) matrix.
A INT = Array[2, 4]

VB> b = indgen(4, 2) + 2
VB> print, b ; Actually prints transpose(b)
2 3 4 5
6 7 8 9
VB> help, b ; b is a (4 x 2) matrix.
B INT = Array[4, 2]


VB> c = a ## b
VB> print, c ; Actually prints transpose(c)
-10 -13 -16 -19
6 7 8 9
22 27 32 37
38 47 56 65

Since the matrix C is 4 by 4, the IDL operator "##" performs
the matrix computation:

transpose(a) * transpose(b)

Keeping the above points in mind, I am trying to understand the
IDL command:

transpose(G)##G

(In my case, G is (296 x 4).)

In IDL, the above matrix product turns out to be (4 x 4). However,
I was expecting the matrix product to be (296 x 296) since I
interpret the above IDL command as carrying out the matrix
multiplication:


G * transpose(G)


Clearly, I am not understanding something correctly. Where am
I erring? Thanks.

K. Banerjee
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Itools tutorial on Mac OS X?
Next Topic: Re: Matrix Multiplication in IDL

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 11:51:13 PDT 2025

Total time taken to generate the page: 0.00653 seconds