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

Home » Public Forums » archive » Matrix algebra and index order, A # B vs A ## B
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Matrix algebra and index order, A # B vs A ## B [message #79847 is a reply to message #79655] Thu, 05 April 2012 09:48 Go to previous messageGo to previous message
Kenneth P. Bowman is currently offline  Kenneth P. Bowman
Messages: 585
Registered: May 2000
Senior Member
In article <MPG.29e766a33cd1eb35989a43@news.giganews.com>,
David Fanning <news@idlcoyote.com> wrote:

> Mats L�fdahl writes:
>
>> I'm writing some code where matrix algebra is at the heart of things so I
>> really wanted to understand the conventions and convince myself that I can
>> use them in a consistent way.

The "Manipulating Arrays" section of the documentation is some help.

As is so often the case with IDL, the ultimate solution to understanding
how it actually works is to create a trivial example and make sure
that you understand it.

This is easier than trying to figure out row-major, column-major, etc.

Such as

IDL> a = FINDGEN(3,3)
IDL> x = REPLICATE(1.0, 3)
IDL> print, x
1.00000 1.00000 1.00000
IDL> print, TRANSPOSE(a)
0.00000 3.00000 6.00000
1.00000 4.00000 7.00000
2.00000 5.00000 8.00000
IDL> print, a#x
9.00000 12.0000 15.0000
IDL> print, a
0.00000 1.00000 2.00000
3.00000 4.00000 5.00000
6.00000 7.00000 8.00000
IDL> print, a##x
3.00000
12.0000
21.0000



Ken Bowman
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: The IDL way, summing variable sized slices of array.
Next Topic: Minimization: Determine a constant across data sets

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

Current Time: Wed Oct 08 13:59:47 PDT 2025

Total time taken to generate the page: 0.00445 seconds