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 #79846 is a reply to message #79655] Thu, 05 April 2012 10:29 Go to previous messageGo to previous message
Mats Löfdahl is currently offline  Mats Löfdahl
Messages: 263
Registered: January 2012
Senior Member
Kenneth P. Bowman:
> David Fanning:
>
>> 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

I guess everybody has to understand various concepts in their own way. To me, your example just demonstrates one thing I tried to avoid: having to memorize when an array can be printed as it is and look like the matrix it is intended to represent and when it has to be transposed.

/Mats
[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: Sun Oct 12 10:04:45 PDT 2025

Total time taken to generate the page: 0.80121 seconds