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

Home » Public Forums » archive » Bug/feature in matrix multiply
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: Bug/feature in matrix multiply [message #14657 is a reply to message #14582] Mon, 15 March 1999 00:00 Go to previous messageGo to previous message
Martin Schultz is currently offline  Martin Schultz
Messages: 515
Registered: August 1997
Senior Member
Mark Fardal wrote:
> [...]

> So my question becomes, why does this happen? If IDL is going to
> treat an 3x1 array differently than a 3-element vector, it shouldn't
> just cavalierly remove the trailing dimension in my opinion. The
> behavior is probably documented somewhere but I couldn't find it in
> the hyperhelp. There is this one sentence in "Combining Array
> Subscripts with Others": "As with other subscript operations, trailing
> degenerate dimensions (those with a size of 1) are eliminated."
>
> I also notice that the behavior is somewhat inconsistent, in that
> converting an expression to one of the same type does _not_ remove
> the trailing dimension:
> [...]

I agree (somewhat). Generally, I found that IDL is quite "smart" in
removing trailing dimensions so that one doesn't have to worry too much
about them. But when you do encounter a case where you need to (and
this is frequent for any type of matrix manipulation), IDL is just
too smart and you have to think twice to outsmart it ;-)

Anyway: you can always make sure you get what you want with

a = transpose(reform(a))

These statements are not very costly in terms of execution time, because
it's only messing around with the array descriptor (at least I believe
so).

Regards,
Martin.


--
------------------------------------------------------------ -------
Dr. Martin Schultz
Department for Engineering&Applied Sciences, Harvard University
109 Pierce Hall, 29 Oxford St., Cambridge, MA-02138, USA

phone: (617)-496-8318
fax : (617)-495-4551

e-mail: mgs@io.harvard.edu
Internet-homepage: http://www-as.harvard.edu/people/staff/mgs/
------------------------------------------------------------ -------
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: problems printing labels on graphs
Next Topic: Widget Buttons on Mac

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

Current Time: Sun Oct 12 11:54:38 PDT 2025

Total time taken to generate the page: 0.24125 seconds